Deploying Oracle RAC Clone to Nodes in a Cluster

After you complete the prerequisite tasks described in "Preparing to Clone Oracle RAC", you can deploy cloned Oracle homes.

Deploy the Oracle RAC database home to a cluster, as follows:

  1. Perform any Oracle RAC preinstallation tasks, as described in your platform-specific Oracle RAC installation guide, to prepare the new cluster nodes, such things as:

    • Specify the kernel parameters.

    • Ensure Oracle Clusterware is active.

    • Ensure that Oracle ASM is active and that at least one Oracle ASM disk group exists and is mounted.

  2. Deploy the Oracle RAC database software, as follows:

    1. Copy the clone of the Oracle home to all nodes. For example:

      [root@node1 root]# mkdir -p /opt/oracle/product/12c/db
      [root@node1 root]# cd /opt/oracle/product/12c/db
      [root@node1 db]# tar –zxvf /path_name/db1120.tgz

      When providing the home ___location and path_name, the home ___location can be in the same directory path or in a different directory path from the source home that you used to create the tar.

    2. If either the oracle user or the oinstall group, or both is different between the source and destination nodes, then change the ownership of the Oracle Inventory files, as follows:

      [root@node1]# chown -R oracle:oinstall /opt/oracle/product/12c/db

      When you run the preceding command on the Oracle RAC home, it clears setuid and setgid information from the Oracle binary.

      Note:

      You can perform this step at the same time you perform Step 3 and Step 4 to run the clone.pl and $ORACLE_HOME/root.sh scripts on each cluster node.

  3. Run the clone.pl script on each node, which performs the main Oracle RAC cloning tasks, as follows:

    1. Supply the environment variables and cloning parameters in the start.sh script, as described in Table 8-2 and Table 8-3. Because the clone.pl script is sensitive to the parameters being passed to it, you must be accurate in your use of brackets, single quotation marks, and double quotation marks.

    2. Run the script as oracle or the user that owns the Oracle RAC software.

    The following table lists and describes the clone.pl script parameters:

    Table 8-1 clone.pl Script Parameters

    Parameter Description
    ORACLE_HOME=Oracle_home

    The complete path to the Oracle home you want to clone. If you specify an invalid path, then the script exits. This parameter is required.

    ORACLE_BASE=ORACLE_BASE

    The complete path to the Oracle base you want to clone. If you specify an invalid path, then the script exits. This parameter is required.

    ORACLE_HOME_NAME=
    Oracle_home_name |
    -defaultHomeName

    The Oracle home name of the home you want to clone. Optionally, you can specify the -defaultHomeName flag. This parameter is optional.

    ORACLE_HOME_USER=Oracle_home_user

    The OracleHomeUser for Windows services. This parameter is applicable to Windows only and is optional.

    OSDBA_GROUP=group_name

    Specify the operating system group you want to use as the OSDBA privileged group. This parameter is optional.

    OSOPER_GROUP=group_name

    Specify the operating system group you want to use as the OSOPER privileged group. This parameter is optional.

    OSASM_GROUP=group_name

    Specify the operating system group you want to use as the OSASM privileged group. This parameter is optional.

    OSBACKUPDBA_GROUP=group_name

    Specify the operating system group you want to use as the OSBACKUPDBA privileged group. This parameter is optional.

    OSDGDBA_GROUP=group_name

    Specify the operating system group you want to use as the OSDGDBA privileged group. This parameter is optional.

    OSKMDBA_GROUP=group_name

    Specify the operating system group you want to use as the OSKMDBA privileged group. This parameter is optional.

    -debug

    Specify this option to run the clone.pl script in debug mode

    -help

    Specify this option to obtain help for the clone.pl script.

    See Also:

    Oracle Real Application Clusters Installation Guide for your platform for more information about the operating system groups listed in the preceding table

    The following example shows an excerpt from the start.sh script that calls the clone.pl script:

    ORACLE_BASE=/opt/oracle
    ORACLE_HOME=/opt/oracle/product/12c/db
    cd $ORACLE_HOME/clone
    THISNODE='host_name'
    
    E01=ORACLE_HOME=/opt/oracle/product/12c/db
    E02=ORACLE_HOME_NAME=OraDBRAC
    E03=ORACLE_BASE=/opt/oracle
    C01="-O CLUSTER_NODES={node1,node2}"
    C02="-O LOCAL_NODE=$THISNODE"
    
    perl $ORACLE_HOME/clone/bin/clone.pl $E01 $E02 $E03 $C01 $C02

    The following table lists and describes the environment variables E01, E02, and E03 that are shown in bold typeface in the preceding example:

    Table 8-2 Environment Variables Passed to the clone.pl Script

    Symbol Variable Description

    E01

    ORACLE_HOME

    The ___location of the Oracle RAC database home. This directory ___location must exist and must be owned by the Oracle operating system group: oinstall.

    E02

    ORACLE_HOME_NAME

    The name of the Oracle home for the Oracle RAC database. This is stored in the Oracle Inventory.

    E03

    ORACLE_BASE

    The ___location of the Oracle Base directory.

    The following table lists and describes the cloning parameters C01 and C02, that are shown in bold typeface in the preceding example:

    Table 8-3 Cloning Parameters Passed to the clone.pl Script.

    Variable Name Parameter Description

    C01

    Cluster Nodes

    CLUSTER_NODES

    Lists the nodes in the cluster.

    C02

    Local Node

    LOCAL_NODE

    The name of the local node.

    The following example shows an excerpt from the start.bat script that the user must create that calls the clone.pl script:

    set ORACLE_home=C:\oracle\product\12c\db1
    cd %ORACLE_home%\clone\bin
    set THISNODE=%hostname%
    set E01=ORACLE_HOME=%ORACLE_home%
    set E02=ORACLE_HOME_NAME=OraDBRAC
    set E03=ORACLE_BASE=Oracle_Base
    set C01="CLUSTER_NODES={node1,node2}"
    set C02="-O LOCAL_NODE=%THISNODE%"
    perl clone.pl %E01% %E02% %E03% %C01% %C02%
  4. Note:

    This step applies to Linux and UNIX installations, only.

    Run the $ORACLE_HOME/root.sh as the root operating system user as soon as the clone.pl procedure completes on the node.

    [root@node1 root]# /opt/oracle/product/12c/db/root.sh -silent

    Note that you can run the script on each node simultaneously:

    [root@node2 root]# /opt/oracle/product/12c/db/root.sh -silent

    Ensure the script has completed on each node before proceeding to the next step.

  5. Note:

    You need only run DBCA on one node in the cluster to create Oracle RAC instances on all nodes.

    This step shows how to run DBCA in silent mode and provide response file input to create the Oracle RAC instances.

    The following example creates an Oracle RAC database named ERI on each node, creates database instances on each node, registers the instances in OCR, creates the database files in the Oracle ASM disk group called DATA, and creates sample schemas. It also sets the SYS, SYSTEM, SYSMAN and DBSNMP passwords to password, which is the password for each account:

    [oracle@node1 oracle]$ export ORACLE_HOME=/opt/oracle/product/12c/db
    [oracle@node1 oracle]$ cd $ORACLE_HOME/bin/
    [oracle@node1 bin]$./dbca -silent -createDatabase -templateName General_Purpose.dbc \
    -gdbName ERI -sid ERI \
    -sysPassword password -systemPassword password \
    -sysmanPassword password -dbsnmpPassword password \
    -emConfiguration LOCAL \
    -storageType ASM -diskGroupName DATA \
    -datafileJarLocation $ORACLE_HOME/assistants/dbca/templates \
    -nodelist node1,node2 -characterset WE8ISO8859P1 \
    -obfuscatedPasswords false -sampleSchema true

    See Also:

    Oracle Database 2 Day DBA for information about using DBCA to create and configure a database