From: Державец Борис <dba477@list.ru.>
Newsgroups: email
Date: Mon, 12 Sep 2005 18:21:07 +0000 (UTC)
Subject: Установка Oracle10g (10.2.0.1) в среде CentOS 4.1 (RHEL 4 AS/ES 4 U 1)
Я заранее прошу прощения за статью на английском. Перевод всего
обьема на русский требует очень много времени.
Технический английский достаточен для понимания.
Actually , there are several nice articles on Oracle Technical Network
devoted to the same topic. What's new may be said ?
The target of publication is to highlight the optimal sequence of steps required to bring Oracle10g (10.2.0.1)
ASM-database up on CentOS4.1 , placing ASM instance and serviced databases in different Oracle Homes.
Oracleasm library install is done immediately after creating "oracle" linux account and "dba" group to be ready
for ASM Instance creating during the first Installer run supposed to build it. ASM instance for volumes
and volume's group management is created the first by Installer along with the volume's group for
database supposed to be built during the second run of Installer and to be placed into recently created volume's
group
1. Install CentOS 4.1
2. Run as root:
# groupadd dba # group of users to be granted SYSDBA system privilege
# groupadd oinstall # group owner of Oracle files
# useradd -c "Oracle software owner" -g oinstall -G dba oracle
# passwd oracle
# mkdir -p /u01/app/oracle
# chown -R oracle.oinstall /u01
# mkdir -p /u02/oradata/data
# chown -R oracle.oinstall /u02
OTN instruction:-
Before installing Automatic Storage Management, it is recommended that you install
the optional add-on Automatic Storage Management support library, ASMLib.
ASMLib is an application program interface (API) Oracle that is aimed at
simplifying the interface between the operating system and the database,
and to exploit the capabilities and strengths of storage arrays provided by different vendors.
ASMLib provides an alternative interface for the Automatic Storage Management-enabled
kernel to discover and access block devices. It provides storage and operating system
vendors the opportunity to supply extended storage-related features.
These features provide benefits such as improved performance and greater data integrity.
OTN instruction ends.
Regarding improved performance , please view:-
Optimizing Oracle 10g on Linux: Non-RAC ASM vs. LVM
By Bert Scalzo on Wed, 2005-08-31 01:00. Software
http://www.linuxjournal.com/article/8539
Now you get /etc/init.d/oracleasm ready to go.
Configuring the Oracle ASM library driver:-
# /etc/init.d/oracleasm configure
Default user to own the driver interface [oracle]: oracle
Default group to own the driver interface [dba]: dba
Start Oracle ASM library driver on boot (y/n) [y]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [ OK ]
Scanning system for ASM disks: [ OK ]
# /etc/init.d/oracleasm enable
Create ASM volumes as desired utilizing command:
# /etc/init.d/oracleasm createdisk VLM0X /dev/sdx
Tune /etc/sysctl.conf,/etc/security/limits.conf,/etc/pam.d/login, /etc/profile.
and oracle's shell environment as advised in [1].
Login as oracle:-
$ cd /tmp/database
$./runInstaller
OTN instructions:-
It's recommended that you install Automatic Storage Management in its own Oracle home,
regardless of whether you plan to only have one or multiple database instances.
Installing Automatic Storage Management in its own Oracle home helps ensure higher
availability and manageability.With separate Oracle homes, you can upgrade Automatic
Storage Management and databases independently, and you can remove database software
without impacting the Automatic Storage Management instance. Ensure that the Automatic
Storage Management version is the same or later than the Oracle Database version.
If an Automatic Storage Management installation does not already exist and you select
the Oracle Universal Installer option to install and configure Automatic Storage Management
only, then Oracle Universal Installer installs Automatic Storage Management in its own Oracle home.
OTN instruction ends.
Select " Advanced installation" and
create ASM instance with $ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1
Create volume group during this run .
Exit installer.
$ /runInstaller
Select " Advanced installation" and create new ASM-database placed into existing volume's
group with $ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_2 .
Modify ~oracle/.bash_profile correspondently.Relogin as oracle.
Next:-
$ sqlplus /nolog
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 88082024 bytes
Database Buffers 188743680 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database MastDB flashback on;
Database altered.
SQL> alter database open;
Database altered.
Open Enterpise Manager console.(Enterprise Manager 10g Database Control URL
http://ServerCentOS41:1158/em). Create new volume's group for flashback recovery area
and modify corresponding value on Recovery Settings page of EM.
System startup in this case should look like:-
[oracle@ServerCentOS41 ~]$ ./lsnrstart
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2005 17:57:41
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listen ing on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ServerCentOS41)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ServerCentOS41)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 30-AUG-2005 17:57:42
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
List ener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listen ing Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ServerCentOS41)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 30-AUG-2005 17:57:42
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_2/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_2/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_2/network/log/listener.log
Listen ing on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ServerCentOS41)(PORT=1522)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ServerCentOS41)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 30-AUG-2005 17:57:42
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_2/network/admin/listener.ora
List ener Log File /u01/app/oracle/product/10.2.0/db_2/network/log/listener.log
Listen ing Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ServerCentOS41)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC2)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
TZ set to US/Eastern
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://ServerCentOS41:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ....................... started.
---------------------------------------------------------- --------
Logs are generated in directory /u01/app/oracle/oracle/product/10.2.0/db_2/ServerCentOS41_MastDB/sysma n/log
Install described above was done with different Oracle Homes
for ASM instance and ASM-database.
To put ASM instance and ASM-database in same Oracle Home.
Start runInstaller just once to build all stuff at a time.Login as oracle:-
$ cd /tmp/database
$./runInstaller
Select " Advanced option" and install "Software only"
in ORACLE_HOME - /u01/app/oracle/oracle/product/10.2.0/db_1.
Modify oracle's bash_profile:-
export ORACLE_HOME and new PATH.
Source new bash_profile:-
$. ~oracle/.bash_profile
$dbca
During this run the request to start CRS daemons by root will come up.
# $ORACLE_HOME/bin/localconfig add
ASM instance , needed volume's groups and ASM-database itself will be created.
Then perform listener and local TNS names configuration.
$netca
Oracle's 10gR2 ASM with Standard Linux I/O in CentOS 4.1 environment.
This method creates Oracle database files on raw character devices managed by ASM
using standard Linux I/O system calls.It requires to create RAW devices for all
disk partitions used by ASM.
1.Install CentOS 4.1
2.Run as root:
# groupadd dba # group of users to be granted SYSDBA system privilege
# groupadd oinstall # group owner of Oracle files
# useradd -c "Oracle software owner" -g oinstall -G dba oracle
# passwd oracle
# mkdir -p /u01/app/oracle
# chown -R oracle.oinstall /u01
# mkdir -p /u02/oradata/data
# chown -R oracle.oinstall /u02
Just as an example create 4 partitions:
/dev/hda6,/dev/hdc6 5 GB each one
/dev/hda7,/dev/hdc7 3 GB each one
Create raw devices modifying file /etc/sysconfig/rawdevices as follows:
I was experiencing problems with loosing "oracle:dba" permissions after Linux
reboot. It came up with "root:disk" .
Restart Linux
Run as root:-
# /sbin/service rawdevices restart
Tune /etc/sysctl.conf,/etc/security/limits.conf,/etc/pam.d/login, /etc/profile.
and oracle's shell environment as advised in [1].
Login as oracle:-
$ cd /tmp/database
$./runInstaller
Select " Advanced installation" and
create ASM instance with $ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_1
During this run create disk group RAWDATA1 with normal redundancy mirroring
/dev/raw/raw1 and /dev/raw/raw2
You should be fine with discovering raw devices if permissions are in place (oracle:dba)
Exit installer.
Export ORACLE_HOME for ASM instance and corresponding PATH.
Then run "dbca" to create disk group RAWDATA2 with
normal redundancy mirroring /dev/raw/raw3 and /dev/raw/raw4
$ ./runInstaller
Select " Advanced installation" and create new ASM-database placed RAWDATA1 diskgroup
with $ORACLE_HOME=/u01/app/oracle/oracle/product/10.2.0/db_2 .
Modify ~oracle/.bash_profile correspondently.Relogin as oracle.
Next:-
$ sqlplus /nolog
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 88082024 bytes
Database Buffers 188743680 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database rawdbs flashback on;
Database altered.
SQL> alter database open;
Database altered.
Open Enterpise Manager console.(Enterprise Manager 10g Database Control URL
http://ServerCentOS41:1158/em). Put flashback recovery area in RAWDATA2
modifying corresponding value on Recovery Settings page of EM.