Top
PRIMECLUSTER Wizard for Oracle 4.5 Configuration and Administration Guide
FUJITSU Software

Appendix C Oracle Grid Infrastructure Installation and Oracle ASM instance, Oracle Database Creation

This section describes how to install Oracle Grid Infrastructure and Oracle database when you use Oracle ASM of Oracle Database 11g R2/12c R1.

Point

When Oracle ASM of Oracle Database 11g R2/12c R1 is used in standby operation, it is necessary to install Oracle Grid Infrastructure.

Note

  • In order to use Oracle ASM of Oracle Database 11g R2/12c R1, 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.

Install Oracle Grid Infrastructure and Oracle database on the local disk of each node.

The Oracle ASM instance and database are only created on the operating node. The standby node will only set the Oracle ASM instance and the database made by the operating node.

The table below shows the common method of installation and 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 with No Oracle Resources

Create userApplication with No Oracle Resources

5

userApplication startup

6

Install Oracle Grid Infrastructure

7

Install Oracle Database

8

Create Oracle database

9

Change IP address of the Oracle listener

10

Check SPFILE of Oracle ASM

11

Check parameter file of the database

12

Stop Oracle database, Oracle ASM, Oracle listener

13

userApplication switch

14

Install Oracle Grid Infrastructure

15

Install Oracle Database

16

Copy directory of Oracle

Copy directory of Oracle

17

Register the SYSTEM user password

Register the SYSTEM user password

18

Restart the Oracle listener

19

Change SPFILE of Oracle ASM

20

Stop temporary diskgroup

21

Restart the Oracle ASM

22

Delete temporary diskgroup

23

Register Oracle database resource

24

Start Oracle database resource

25

Stop Oracle database, Oracle ASM, Oracle listener

For details of each step as follows.

  1. Set up the kernel parameter
    Set up values in the “/etc/system” 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.

  2. 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 the ORACLE_BASE, ORACLE_HOME and ORACLE_SID environment variables for your Oracle database environment.
    Add $ORACLE_HOME/bin into the PATH environment variable.
    If the directory where listener.ora is stored is not under $ORACLE_HOME/network/admin, set the TNS_ADMIN environment variable.

    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.
    (.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:/usr/ccs/bin:/usr/ucb; export PATH

    Example

    The example of setting Grid user's environment variable.

    (.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:/usr/ccs/bin:/usr/ucb; export PATH
    TNS_ADMIN=$ORACLE_HOME/network/admin2; export TNS_ADMIN
  3. Set up shared disk units
    Set shared disk units that are managed by Oracle ASM. At this time, create at least more than two volumes (devices) on share disk. These volumes are used for storing database or making temporary diskgroup on the step 14. Set the Grid user to the owner of the device files of the shared disk.

  4. 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.

  5. userApplication startup on the operating node
    Start userApplication on the operating node, and verify the shared disk units and the takeover IP address are enabled.

  6. Install Oracle Grid Infrastructure on the operating node
    Install Oracle Grid Infrastructure to the local disks on the operating node with Grid user by referring to the Oracle Database manual and installation guide.

    • Oracle Database 11g R2
      Select "Configure Oracle Grid Infrastructure for a Standalone Server" for the option when Oracle Grid Infrastructure is installed and create the Oracle ASM instance and diskgroup which stores the database.

    • Oracle Database 12c R1
      Select "Install and Configure Oracle Grid Infrastructure for a Standalone Server" for the option when Oracle Grid Infrastructure is installed and create the Oracle ASM instance and diskgroup which stores the database.

    An Oracle ASM instance name must begin with “+”. The default name is “+ASM”.

  7. Install Oracle Database on the operating node
    Install Oracle Database to the local disks on the operating 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.

  8. Create Oracle database on the operating node
    On the operating node, create Oracle database on diskgroup made at step 6.

  9. 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”.

  10. Check SPFILE of Oracle ASM
    Execute the following command as a Grid user on the operating node and record the location of the Oracle ASM SPFILE.

    # su - <Grid user>
    $ ORACLE_SID=+ASM
    $ asmcmd spget
    +DATA/asm/asmparameterfile/registry.xxx  <-- record this line
  11. Check parameter file of the database
    Execute the following command as a Grid user on the operating 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".

  12. Stop Oracle database, Oracle ASM, Oracle listener
    Execute the following command as a Grid user on the operating node to stop Oracle instance, Oracle ASM, Oracle listener. Specify the database name made at step 8 for <db_name>. Specify the Diskgroup made at step 6 for <diskgroup_name>.

    # su - <Grid user>
    $ srvctl stop database -d <db_name>
    $ srvctl stop diskgroup -g <diskgroup_name>
    $ srvctl stop asm
    $ srvctl stop listener
  13. userApplication switch
    Switch userApplication to the standby node, and verify the shared disk units and the takeover IP address are enabled.

  14. Install Oracle Grid Infrastructure on standby node
    Install Oracle Database to the local disks on standby node with Grid user by referring to the Oracle Database manual and installation guide.

    • Oracle Database 11g R2
      Select "Configure Oracle Grid Infrastructure for a Standalone Server" for the option when Oracle Grid Infrastructure is installed and create an Oracle ASM instance, temporary diskgroup.

    • Oracle Database 12c R1
      Select "Install and Configure Oracle Grid Infrastructure for a Standalone Server" for the option when Oracle Grid Infrastructure is installed and create an Oracle ASM instance, temporary diskgroup.

    Specify the Oracle ASM instance name. The Oracle ASM instance name must be same made at step 6.
    Specify the temporary diskgroup name. The temporary diskgroup name must be different name made at step 6.

  15. 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.

  16. Copy directory of Oracle database
    Copy the following directories of the operating node to the standby node.

    • Under <Oracle user’s $ORACLE_HOME>/dbs

    • Under <$ORACLE_BASE>/admin/$ORACLE_SID

    • Under <$ORACLE_BASE>/diag

    • Under <Grid user’s $ORACLE_HOME>/network/admin

    • In the standby node, if the directories which are specified in the initialization parameters, AUDIT_FILE_DEST, BACKGROUND_DUMP_DEST, CORE_DUMP_DEST, USER_DUMP_DEST and DIAGNOSTIC_DEST, do not exist, create them.

    The access privilege to the directories and files must be also the same as that on the operating node.

    Set the standby node similarly when you change the settings such as the destination for archived redo logs on the operating node.

    Information

    The required files on the operating node can be backed up in the tar format with the “cloracpy” command. See “4.4 cloracpy - Create Backup File for Oracle Database Setup”.

    If you use the “cloracpy” command, you must execute respectively by the Oracle user and the Grid user.

  17. Register the SYSTEM user password
    Register the SYSTEM user password on any one of the nodes (the operating node or the standby nodes).
    PRIMECLUSTER Wizard for Oracle accesses and monitors Oracle instances as the Oracle database SYSTEM user. Therefore, the SYSTEM user's password must be registered in PRIMECLUSTER Wizard for Oracle. See “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.

  18. Restart the Oracle listener
    Execute the following command as a Grid user on standby node and verify that the Oracle listener restarts.

    # su - <Grid user>
    $ srvctl stop listener
    $ srvctl start listener
  19. Change SPFILE of Oracle ASM
    Set the location of the Oracle ASM SPFILE recorded at step 10.

    • Oracle Database 11g R2
      Execute the following command as a Grid user on standby node.

      # su - <Grid user>
      $ export ORACLE_SID=<ASM SID>
      $ asmcmd spset <SPFILE PATH>
    • Oracle Database 12c R1
      Execute the following command as a Grid user on standby node.
      Specify the diskgroup made at step 6 for <diskgroup_name>.

      # su - <Grid user>
      $ export ORACLE_SID=<ASM SID>
      $ sqlplus / as sysasm
      SQL> alter diskgroup <diskgroup_name> mount;
      SQL> exit
      $ asmcmd spset <SPFILE PATH>
      # su - <Grid user>
      $ srvctl stop diskgroup -g <diskgroup_name>
  20. Stop temporary diskgroup
    Execute the following command as a Grid user on standby node to stop temporary diskgroup.
    Specify the temporary diskgroup name made at step 14 for <diskgroup_name>.

    # su - <Grid user>
    $ srvctl stop diskgroup -g <diskgroup_name>
  21. Restart the Oracle ASM
    Execute the following command as a Grid user on standby node to restart the Oracle ASM.

    # su - <Grid user>
    $ srvctl stop asm
    $ srvctl start asm
  22. Delete temporary diskgroup
    Execute the following command as a Grid user on standby node to delete temporary diskgroup.
    Specify the temporary diskgroup name made at step 14 for <diskgroup_name>.

    # su - <Grid user>
    $ srvctl remove diskgroup -g <diskgroup_name>
  23. Register Oracle database resource
    Execute the following command as an Oracle user on standby node to register database resource made at step 8 to Oracle Restart of the standby node.
    Specify the database unique name and the database name made at step 8 for <db_unique_name>, <db_name>.
    Specify the Oracle user's ORACLE_HOME for <oracle_home>.
    Specify the SPFILE recorded at step 11 for <SPFILE PATH>
    Specify the Diskgroup made at step 6 for <disk_group_list>.

    # su - <Oracle user>
    $ srvctl add database -d <db_unique_name> -o <oracle_home> -p <SPFILE PATH> -n <db_name> -a <disk_group_list>

    Note

    Note that <db_unique_name> and <db_name> are different when this command is executed on the standby site of Oracle Data Guard.

  24. Start Oracle database resource on standby node
    Execute the following command as a Grid user on standby node and verify the Oracle database can be started. Specify the database name made at step 8 for <db_name>.

    # su - <Grid user>
    $ srvctl start database -d <db_name>
  25. Stop Oracle database, Oracle ASM, Oracle listener
    Execute the following command as a Grid user on standby node to stop Oracle database, Oracle ASM and Oracle listener. Specify the database name made at step 8 for <db_name>. Specify the Diskgroup made at step 6 for <diskgroup_name>.

    # su - <Grid user>
    $ srvctl stop database -d <db_name>
    $ srvctl stop diskgroup -g <diskgroup_name>
    $ srvctl stop asm
    $ srvctl stop listener

After the installation of Oracle Grid Infrastructure and Oracle database is completed, change Oracle Restart Settings and create userApplication. For details, see “2.4.2.2 Environment configuration with Oracle Database 11g R2/12c R1”.