This section describes how to install Oracle Grid Infrastructure and Oracle Database when you use Oracle ASM.
Point
When Oracle ASM is used in standby operation, it is necessary to install Oracle Grid Infrastructure.
Note
In order to use Oracle ASM , it is necessary to install Oracle Grid Infrastructure. When installing Oracle Grid Infrastructure, the composition which separates the installation user of Oracle Database and the installation user of Oracle Grid Infrastructure is supported. The composition which creating one user is not supported.
A different directory must be assigned respectively for an ORACLE_BASE of the installation user of Oracle Database and an ORACLE_BASE of the installation user of Oracle Grid Infrastructure.
Diskgroup that stores the parameter file and the password file of Oracle ASM is not shared between each node.
Install Oracle Grid Infrastructure and Oracle Database on the local disk of each node.
The Oracle ASM instance is created on each node. The database are only created on the operating node. The standby node will only set the database made by the operating node.
The table below shows the procedure for settings of Oracle Grid Infrastructure and Oracle Database.
No | Overview | |
---|---|---|
Operating node | Standby node | |
1 | Set up the kernel parameter | Set up the kernel parameter |
2 | Create Grid user, Oracle user | Create Grid user, Oracle user |
3 | Set up shared disk units | |
4 | Create userApplication | Create userApplication |
5 | userApplication startup | |
6 | Install Oracle Grid Infrastructure | |
7 | Create diskgroup for the database | |
8 | Check CSS and OHAS of Oracle Grid Infrastructure is online | |
9 | Check all services status of Oracle Grid Infrastructure | |
10 | Stop Oracle High Availability Services | |
11 | Switch userApplication | |
12 | Install Oracle Grid Infrastructure | |
13 | Mount Diskgroup for the database | |
14 | Check CSS and OHAS of Oracle Grid Infrastructure is online | |
15 | Check all services status of Oracle Grid Infrastructure | |
16 | Restart Oracle High Availability Services | |
17 | Check all services status of Oracle Grid Infrastructure | |
18 | Stop Oracle High Availability Services | |
19 | Switch userApplication | |
20 | Start Oracle High Availability Services | |
21 | Check all services status of Oracle Grid Infrastructure | |
22 | Install Oracle Database | |
23 | Create database | |
24 | Check database status | |
25 | Restart Oracle High Availability Services | |
26 | Check all services status of Oracle Grid Infrastructure | |
27 | Change IP address of the Oracle listener | |
28 | Check parameter file of the database | |
29 | Check directory of the database | |
30 | Stop Oracle High Availability Services | |
31 | Switch userApplication | |
32 | Install Oracle Database | |
33 | Environment setting of the database | |
34 | Register SYSTEM user password | Register SYSTEM user password |
35 | Register the database resource | |
36 | Start the database resource | |
37 | Stop Oracle High Availability Services |
For details of each steps as follows.
Set up the kernel parameter
Set up values in the /etc/sysctl.conf file for Oracle database in addition to the values for PRIMECLUSTER.
The kernel parameter values vary depending on the implemented Oracle Database versions.
Refer to the Oracle Database installation guide. The parameter values should be the same on all the nodes.
For semopm, specify a value of 4 or more.
Create Grid user, Oracle user
Create separate users, Grid user and Oracle user. Grid user is for installation of Oracle Grid Infrastructure and Oracle user is for Oracle Database.
Set a different directory for an ORACLE_BASE of the installation user of Oracle Database and an ORACLE_BASE of the installation user of Oracle Grid Infrastructure, respectively.
Set ORACLE_HOME of Oracle Grid Infrastructure to Grid user's ORACLE_HOME environment variable.
Set ORACLE_HOME of Oracle Database to Oracle user's ORACLE_HOME environment variable.
Set ORACLE_SID of Oracle Grid Infrastructure to Grid user's ORACLE_SID environment variable.
Set ORACLE_SID of Oracle Database to Oracle user's ORACLE_SID environment variable.The user ID, the group ID and environment variable must be the same on all nodes.
Example
The example of setting Oracle user's environment variable.
(.bash_profile)
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE ORACLE_HOME=/u01/app/oracle/product/db; export ORACLE_HOME ORACLE_SID=ora; export ORACLE_SID PATH=$ORACLE_HOME/bin:/usr/bin:/bin:/usr/bin/X11/:/usr/local/bin; export PATH
Example
The example of setting Grid user's environment variable.
(.bash_profile)
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE ORACLE_HOME=/u01/app/grid/product/db; export ORACLE_HOME ORACLE_SID=+ASM; export ORACLE_SID PATH=$ORACLE_HOME/bin:/usr/bin:/bin:/usr/bin/X11/:/usr/local/bin; export PATH
Set up shared disk units
Set shared disk units that are managed by Oracle ASM. Create shared disk to store the database and shared disk to store the parameter file and the password file of Oracle ASM. Set the Grid user to the owner of the device files of the shared disks.
The following three shared disks are at least necessary.
Disk for Oracle ASM on operating node
The disk should have a size of 300MB.
Disk for Oracle ASM on standby node
The disk should have a size of 300MB.
Disk for the database
The database is stored. The disk is shared between each node.
Create userApplication with No Oracle Resources
Create userApplication that does not include Oracle resources before installing Oracle Grid Infrastructure.
For information on how to create the userApplication, see following.
userApplication startup on operation node
Start userApplication on operation node, and verify the shared disk units and the takeover IP address are enabled.
Install Oracle Grid Infrastructure on operation node
Install Oracle Grid Infrastructure to the local disks on operation node with Grid user according to the Oracle Database manuals and the installation guide.
Oracle Database 11g R2
Select the "Configure Oracle Grid Infrastructure for a Standalone Server" option to install and create the Oracle ASM instance.
Oracle Database 12c R1
Select the "Install and Configure Oracle Grid Infrastructure for a Standalone Server" option to install and create the Oracle ASM instance.
Oracle Database 12c R2
Select the "Configure Oracle Grid Infrastructure for a Standalone Server (Oracle Restart)" option to install and create the Oracle ASM instance.
Create diskgroup in the disk for Oracle ASM on operating node.
The Oracle ASM instance name must begin with "+". The default name is "+ASM".
Create diskgroup for the database on operation node
Create diskgroup in the disk for the database with ASMCA or SQL*Plus. For details about ASMCA, refer to the manual of Oracle Grid Infrastructure.
Execute the SQL*Plus as a Grid user, and connect to Oracle ASM instance
# su - <Grid user> $ export ORACLE_SID=<ASM SID> $ sqlplus / as sysasm
Add the disk discovery string associated with the diskgroup for the database to the ASM_DISKSTRING parameter
SQL> alter system set asm_diskstring = <Disk discovery string associated with the diskgroup for Oracle ASM on operating node> , <Disk discovery string associated with the diskgroup for the database> scope=both;
Specify the disk discovery string of diskgroup made at step 6 for <disk discovery string associated with the diskgroup for Oracle ASM on operating node>.
Delimit it by “," when there are two or more disk discovery string of diskgroup for the database.
Add the diskgroup for the database to the ASM_DISKGROUP parameter
SQL> alter system set asm_diskgroups = <Diskgroup for Oracle ASM on operating node> , <Diskgroup for the database> scope=both;
Specify the diskgroup made at step 6 for <Diskgroup for Oracle ASM on operating node>.
Delimit it by “," when there are two or more diskgroups for the database.
Create diskgroup for the database
SQL> create diskgroup <Diskgroup for the database> disk <Disk discovery string associated with the diskgroup for the database>;
Specify the diskgroup made at step 6 for <Diskgroup for Oracle ASM on operating node>.
Execute SQL for each diskgroup when there are two or more diskgroups for the database.
Check CSS and OHAS of Oracle Grid Infrastructure is online on operation node
Execute the following commands as a Grid user on operation node.
Check Oracle High Availability Services and Cluster Synchronization Services of Oracle Grid Infrastructure are online.
# su - <Grid user> $ crsctl check has $ crsctl check css
Example
$ crsctl check has CRS-4638: Oracle High Availability Services is online $ crsctl check css CRS-4529: Cluster Synchronization Services is online
Check all services status of Oracle Grid Infrastructure on operation node
Execute the following commands as a Grid user on operation node.
# su - <Grid user> $ crsctl status resource -t
Example
$ crsctl status resource -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASM1.dg ONLINE ONLINE node1 ora.DATA.dg ONLINE ONLINE node1 ora.asm ONLINE ONLINE node1 Started ora.ons OFFLINE OFFLINE node1 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.cssd 1 ONLINE ONLINE node1 ora.diskmon 1 OFFLINE OFFLINE ora.evmd 1 ONLINE ONLINE node1 $
Check Diskgroup("ora.*.dg") and ASM("ora.asm") are online.
Stop Oracle High Availability Services on operation node
Execute the following commands as a Grid user on operation node to stop Oracle High Availability Services.
# su - <Grid user> $ crsctl stop has
Switch userApplication to standby node
Switch userApplication to the standby node, and verify the shared disk units and the takeover IP address are enabled.
Install Oracle Grid Infrastructure on standby node
Install Oracle Grid Infrastructure to the local disks on standby node with Grid user according to the Oracle Database manuals and the installation guide.
Oracle Database 11g R2
Select the "Configure Oracle Grid Infrastructure for a Standalone Server" option to install and create the Oracle ASM instance.
Oracle Database 12c R1
Select the "Install and Configure Oracle Grid Infrastructure for a Standalone Server" option to install and create the Oracle ASM instance.
Oracle Database 12c R2
Select the "Configure Oracle Grid Infrastructure for a Standalone Server (Oracle Restart)" option to install and create the Oracle ASM instance.
Create diskgroup in the disk for Oracle ASM on standby node. Specify the Oracle ASM instance name. The Oracle ASM instance name must be same made at step 6. The diskgroup for Oracle ASM must be different name and disk discovery string made at step 6.
Mount Diskgroup for the database on standby node
Execute the SQL*Plus as a Grid user, and connect to Oracle ASM instance
# su - <Grid user> $ export ORACLE_SID=<ASM SID> $ sqlplus / as sysasm
Add the disk discovery string associated with the diskgroup for the database to the ASM_DISKSTRING parameter
SQL> alter system set asm_diskstring = <Disk discovery string associated with the diskgroup for Oracle ASM on standby node> , <Disk discovery string associated with the diskgroup for the database> scope=both;
Specify the disk discovery string of diskgroup made at step 12 for <disk discovery string associated with the diskgroup for Oracle ASM on standby node>.
Delimit it by “," when there are two or more disk discovery string of diskgroup for the database.
Add the diskgroup for the database to the ASM_DISKGROUP parameter
SQL> alter system set asm_diskgroups = <Diskgroup for Oracle ASM on standby node> , <Diskgroup for the database> scope=both;
Specify the diskgroup made at step 12 for <Diskgroup for Oracle ASM on standby node>.
Delimit it by “," when there are two or more diskgroups for the database.
Mount Diskgroup for the database
SQL> alter diskgroup <Diskgroup for the database> mount;
Execute SQL for each diskgroup when there are two or more diskgroups for the database.
Example
Example for there are two diskgroups for the database.
The diskgroup for Oracle ASM on standby node is "ASM2", and the disk discovery string is "/dev/raw/raw2".
The diskgroup for the database is "DATA", and the disk discovery string is "/dev/raw/raw3", "/dev/raw/raw4".
The diskgroup for the database(backup) is "BACKUP", and the disk discovery string is "/dev/raw/raw5".
The diskgroup for Oracle ASM "ASM2" has already been mounted.
SQL> alter system set asm_diskstring = '/dev/raw/raw2' , '/dev/raw/raw3' , '/dev/raw/raw4', '/dev/raw/raw5' scope=both; SQL> alter system set asm_diskgroups = 'ASM2' , 'DATA' , 'BACKUP' scope=both; SQL> alter diskgroup 'DATA' mount; SQL> alter diskgroup 'BACKUP' mount;
Check CSS and OHAS of Oracle Grid Infrastructure is online on standby node
Execute the following commands as a Grid user on standby node.
Check Oracle High Availability Services and Cluster Synchronization Services of Oracle Grid Infrastructure are online.
# su - <Grid user> $ crsctl check has $ crsctl check css
Check all services status of Oracle Grid Infrastructure on standby node
Execute the following commands as a Grid user on standby node.
# su - <Grid user> $ crsctl status resource -t
Restart Oracle High Availability Services on standby node
Execute the following commands as a Grid user on standby node.
# su - <Grid user> $ crsctl stop has $ crsctl start has
After restart, check all services status of Oracle Grid Infrastructure on standby node
Execute the following commands as a Grid user on standby node.
# su - <Grid user> $ crsctl status resource -t
Stop Oracle High Availability Services on standby node
Execute the following commands as a Grid user on standby node to stop Oracle High Availability Services.
# su - <Grid user> $ crsctl stop has
Switch userApplication to operation node
Switch userApplication to the operation node, and verify the shared disk units and the takeover IP address are enabled.
Start Oracle High Availability Services on operation node
Execute the following commands as a Grid user on operation node to start Oracle High Availability Services..
# su - <Grid user> $ crsctl start has
Check all services status of Oracle Grid Infrastructure on operation node
Execute the following commands as a Grid user on operation node.
# su - <Grid user> $ crsctl status resource -t
Install Oracle Database on operation node
Install Oracle Database to the local disks on operation node with Oracle user by referring to the Oracle Database manual and installation guide. Install only Oracle Database software, and do not create the database in this step.
Create Oracle Database on operation node
On operation node, create Oracle Database on diskgroup for the database made at step 7.
Check the database status on operation node
Execute the following commands as a Grid user on operation node.
# su - <Grid user> $ crsctl status resource -t or $ crsctl status resource ora.<Database name>.db
Example
Example for "crsctl status resource ora.<Database name>.db".
$ crsctl status resource ora.ora12c.db NAME=ora.ora12c.db TYPE=ora.database.type TARGET=ONLINE STATE=ONLINE on dbsv1
Restart Oracle High Availability Services on operation node
Execute the following commands as a Grid user on operation node.
# su - <Grid user> $ crsctl stop has $ crsctl start has
Check all services status of Oracle Grid Infrastructure on operation node
After restart, wait for about five seconds, and execute the following commands as a Grid user on operation node.
# su - <Grid user> $ crsctl status resource -t
Change IP address of the Oracle listener
If you use Oracle listener switching operation using a logical IP address, specify the logical IP address for the IP address of the Oracle listener.
<Grid user's $ORACLE_HOME>/network/admin/listener.ora
If the Oracle listener is monitored through tnsping, set up the following file.
<Oracle user's $ORACLE_HOME>/network/admin/tnsnames.ora
<Grid user's $ORACLE_HOME>/network/admin/tnsnames.ora
For information on how to modify, see "2.2.6 Oracle Database Creation and Setting".
Check parameter file of the database
Execute the following command as a Grid user on operation node and record the location of the SPFILE.
# su - <Grid user> $ crsctl status resource <Oracle Database resource name> -p | grep SPFILE SPFILE=+DATA/xxxx/spfilexxxx.ora <-- record after "SPFILE =" of this line
Example
You can confirm <Oracle Database resource name> using "crsctl status resource -t" command.
# su - <Grid user> $ crsctl status resource -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.DATA.dg ONLINE ONLINE node1 ora.LISTENER.lsnr ONLINE ONLINE node1 ora.asm ONLINE ONLINE node1 Started ora.ons OFFLINE OFFLINE node1 -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.orcl.db 1 ONLINE ONLINE node1 Open ora.cssd 1 ONLINE ONLINE node1 ora.diskmon 1 OFFLINE OFFLINE ora.evmd 1 ONLINE ONLINE node1 $
In the above configuration, <Oracle Database resource name> is "ora.racdb.db".
Check directory of the database
Check the path and access privilege of the directory set in the following Oracle initialization parameters.
AUDIT_FILE_DEST, BACKGROUND_DUMP_DEST, CORE_DUMP_DEST, USER_DUMP_DEST, DIAGNOSTIC_DEST
Stop Oracle High Availability Services on operation node
Execute the following commands as a Grid user on standby node to stop Oracle High Availability Services.
# su - <Grid user> $ crsctl stop has
Switch userApplication to standby node
Switch userApplication to the standby node, and verify the shared disk units and the takeover IP address are enabled.
Install Oracle Database on standby node
Install Oracle Database to the local disks on standby node with Oracle user by referring to the Oracle Database manual and installation guide. Install only Oracle Database software, and do not create the database in this step.
Environment setting of the database on standby node
Copy the following directory of the operation node to the standby node.
Under <Grid user’s $ORACLE_HOME>/network/admin
Create the directory checked at step 29 on the standby node.
The access privilege to the directories and files must be also the same as that on the operating node.
If you set where archive log is output on the operating node, it is necessary to set the same on the standby node.
Register SYSTEM user password
Execute the command on any one of the nodes, the operation node or the standby node.
PRIMECLUSTER Wizard for Oracle accesses and monitors Oracle instances as the Oracle SYSTEM user. Therefore, the SYSTEM user's password must be registered in PRIMECLUSTER Wizard for Oracle. Refer to "4.3 clorapass - Register Password for Monitoring" to register the password.
Register the password of the SYSTEM user of the CDB when you create the database using the multitenant architecture. The password of Local User of the PDB need not be registered.
Register the database resource
Execute the following command as an Oracle user on standby node to register database resource made at step 23 to Oracle Restart of the standby node.
Specify the <db_unique_name>, <db_name> made at step 23 for <db_unique_name>, <db_name>.
Specify the Oracle user's ORACLE_HOME for <oracle_home>.
Specify the SPFILE recorded at step 28 for <SPFILE PATH>
Specify the Diskgroup made at step 7 for <disk_group_list>.
# su - <Oracle user> $ srvctl add database -d <db_unique_name> -o <oracle_home> -p <SPFILE PATH> -s OPEN -y AUTOMATIC -n <db_name> -a <disk_group_list> -t IMMEDIATE
Note
Note that <db_unique_name> and <db_name> are different when this command is executed on the standby site of Oracle Data Guard.
Start the database resource on standby node
Execute the following command as an Oracle user on standby node and verify the Oracle Database can be started.
# su - <Oracle user> $ export ORACLE_SID=<ORACLE SID> $ sqlplus / as sysdba SQL> startup
Stop Oracle High Availability Services on operation node
Execute the following command as a Grid user on standby node to stop Oracle High Availability Services.
# su - <Grid user> $ crsctl stop has
After the installation of Oracle Grid Infrastructure and Oracle Database is completed, change Oracle Restart Settings and create userApplication. For details, see "2.3.2.1 Environment configuration".