Top
PRIMECLUSTER Wizard for Oracle 4.3 Configuration and Administration Guide

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

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

Point

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

Note

In order to use ASM of Oracle 11g R2, 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 ASM instance and database are only created on the operating node. The standby node will only set the ASM instance and the database made by the operation 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

Chang IP address of the Oracle listener

10

Check SPFILE of ASM

11

Check parameter file of the database

12

Stop Oracle Database, 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

Restart the Oracle listener

18

Change SPFILE of ASM

19

Stop temporary diskgroup

20

Restart the ASM

21

Delete temporary diskgroup

22

Register Oracle Database resource

23

Start Oracle Database resource

24

Stop Oracle Database, ASM, Oracle listener

For details of each step as follows.

  1. Set up the kernel parameter
    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 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
    LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
    PATH=$ORACLE_HOME/bin:/usr/bin:/usr/ccs/bin:/usr/ucb; export PATH

    When “/usr/ucb” is contained in PATH, it needs to be set up after “/usr/ccs/bin”.

    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

    When “/usr/ucb” is contained in PATH, it needs to be set up after “/usr/ccs/bin”.

  3. Set up shared disk units
    Set shared disk units that are managed by 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 owner of the device files of the created share disk to the Grid user.

  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 operation node
    Start userApplication on operation node, and verify the shared disk units and the takeover IP address are enabled.

  6. Install Oracle Grid Infrastructure on operation node
    Install Oracle Grid Infrastructure to the local disks on operation node with Grid user by referring to the Oracle manual and installation guide.
    Select "Configure Oracle Grid Infrastructure for a Standalone Server" for the option when Oracle Grid Infrastructure is installed and create the ASM instance and diskgroup which stores the database.
    ASM instance name must begin with “+”. The default name is “+ASM”.

  7. Install Oracle Database on operation node
    Install Oracle Database to the local disks on operation node with Oracle user by referring to the Oracle manual and installation guide. Install only Oracle software, and do not create the database in this step.

  8. Create Oracle Database on operation node
    On operation node, create Oracle Database on diskgroup made at step 6.

  9. Chang 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 ASM
    Execute the following command as a Grid user on operation 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 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".

  12. Stop Oracle Database, ASM, Oracle listener
    Execute the following command as a Grid user on operation node to stop Oracle instance, 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 manual and installation guide.
    Select "Configure Oracle Grid Infrastructure for a Standalone Server" for the option when Oracle Grid Infrastructure is installed and create ASM instance, temporary diskgroup.
    Specify the ASM instance name. The 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 manual and installation guide. Install only Oracle software, and do not create the database in this step.

  16. Copy directory of Oracle
    Copy the following directories of the operation 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

    The access privilege to the directories and files must be also the same as that 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. 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
  18. Change SPFILE of ASM
    Set the location of the Oracle ASM SPFILE recorded at step 10. Execute the following command as a Grid user on standby node.

    # su - <Grid user>
    $ export ORACLE_SID=<ASM SID>
    $ asmcmd spset <SPFILE PATH>
  19. 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>
  20. Restart the ASM
    Execute the following command as a Grid user on standby node to restart the ASM.

    # su - <Grid user>
    $ srvctl stop asm
    $ srvctl start asm
  21. 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>
  22. 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 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>
  23. 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>
  24. Stop Oracle Database, ASM, Oracle listener
    Execute the following command as a Grid user on standby node to stop Oracle Database, 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 11g R2”.