11g R2 RAC: CLONE DATABASE HOME

In this article, I am going to discuss the procedure to clone a database home in RAC.
CURRENT SCENARIO:
  • - Two node RAC setup.
  • - Both the current nodes have non shared database home.
  • - Current two node setup is not able to handle increased workload.
  • - Want to add third node to the setup.
Need to
  •   . Install oracle clusterware on the third node
  •   . Install database software on the third node (Since database home is non shared).
Here is the detailed procedure which needs to be implemented:
————————————–
Preparing to Clone Oracle RAC
————————————–
On one of the existing nodes (node1 say):
Step 1   Create a backup of the source home
Create a copy of the Oracle RAC home. You will use this file to copy the Oracle RAC home to each node in the cluster
When creating the backup (tar) file, the best practice is to include the release number in the name of the file. For example:
– Go to ORACLE_HOME –
[root@node1 root]#  cd /u01/app/oracle/product/11.2.0/dbhome_1
– create the backup(tar) file in /home/oracle with name db1120.tgz
[root@node1 dbhome_1]#  tar -zcvf /home/oracle/db1120.tgz .
Step 2  Install and start Oracle Clusterware (Use addnode.sh to add new node in existing cluster)
Before you can use cloning to create a new Oracle RAC home, you must first install and start Oracle Clusterware on the node on which you want to copy a cloned Oracle RAC home. In other words, you configure an Oracle RAC home that you cloned from a source cluster onto the nodes in a target cluster in the same order that you installed the Oracle Clusterware and Oracle RAC software components on the original nodes.
————————————————
Deploying Oracle RAC Database Homes
————————————————
Deploying the Oracle RAC database home to a cluster is a multiple-step process.
This section provides step-by-step instructions that describe how to:
  1.  Prepare the new cluster node
  2.  Deploy the Oracle RAC database softwar
  3.  Run the clone.pl script on each node
  4.  Run the $ORACLE_HOME/root.sh script on each node
Step 1   Prepare the new cluster nodes
Perform the Oracle RAC preinstallation steps, including such things as:
  • ·         Specify the kernel parameters.
  • ·         Use short, nondomain-qualified names for all names in the Hosts file.
  • ·         Verify that you can ping the public and interconnect names.
  • ·         Ensure Oracle Clusterware is active.
  • ·         Ensure that Oracle ASM is active and there at least one Oracle ASM disk group exists and is mounted.
See your platform-specific Oracle RAC installation guide for a complete preinstallation checklist.
Step 2   Deploy the Oracle RAC database software on third node
To deploy the Oracle RAC software, you need to:
1.  Restore the Oracle home to the third node.
    [root@node1 root]# scp /home/oracle/db1120.tgz node3:/home/oracle/db1120.tgz
2.  create the directory for oracle home
     [root@node3 root]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
3.  [root@node3 root]# cd /u01/app/oracle/product/11.2.0/dbhome_1
4.  Extract the contents of the tar file
     [root@node3 dbhome_1]# tar -zxvf /home/oracle/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.
5.  Change the ownership of all files to the oracle and oinstall group. For example:
      [root@node3 dbhome_1]# chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/dbhome_1
Step 3 Create a script file start.sh as oracle user on node3 in folder $ORACLE_HOME/clone/bin with following environment variables.
[oracle@node3 dbhome_1]$cd  $ORACLE_HOME/clone/bin
                                             vi start.sh
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
cd $ORACLE_HOME/clone
THISNODE=`hostname -s`
E01=ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
E02=ORACLE_HOME_NAME=OraDBRAC
E03=ORACLE_BASE=/u01/app/oracle
C01=”-O’CLUSTER_NODES={node1, node2, node3}'”
C02=”-O’LOCAL_NODE=$THISNODE'”
perl $ORACLE_HOME/clone/bin/clone.pl $E01 $E02 $E03 $C01 $C02
THISNODE should be set to the name of the node to be added e.g. node3
Step 4 Run start.sh script as oracle user on node3(owner of database home) from one of existing cluster node where we have database binaries
. This script will copy database binaries from existing node to the node specified in THISNODE variable as well as update inventories on all cluster nodes.
oracle@node3 bin]$chmod u+x start.sh
                               ./start.she
Step 5   Run the $ORACLE_HOME/root.sh script on each node

- check the contents of the inventory.xml file, we will see that it has information about the 11g Oracle Home 

[oracle@node3 dbhome_1]$cd /u01/app/oracle/oraInventory/ContentsXML
                      vi inventory.xml
 
- check the contents of the inventory.xml file on the other nodes. If entry for newly added node  for  database home does not exist, add it manually
 
[oracle@node1 dbhome_1]$vi /u01/app/oracle/oraInventory/ContentsXML/inventory.xml
[oracle@node2 dbhome_1]$vi /u01/app/oracle/oraInventory/ContentsXML/inventory.xml
 
                           ———–

 

Related links:  

 

                                                   ————–
                                                          —————–

7 thoughts on “11g R2 RAC: CLONE DATABASE HOME

  1. Excellent Posts!. Practical Oriented , Far better and clear step by step explanation . Its a cakewalk for anyone learning RAC. Keep up the good work.

  2. Hi Mam,

    Kindly suggest what to do while performing rac db cloning i,m facing lot of problem,

    For your reference below logs kindly suggest best way to resolved this issue.

    The file oraparam.ini could not be found at ./oraparam.ini
    Using paramFile: /u01/app/oracle/product/11.2.0/db_1/oui/oraparam.ini

    Checking swap space: must be greater than 500 MB. Actual 9985 MB Passed
    Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed

    The number of files bootstrapped for the jre is 689.

    The number of files bootstrapped for the oui is 77.
    Using the umask value ‘022’ available from oraparam.ini

    Execvp of the child jre : the cmdline is /tmp/OraInstall2015-08-03_05-32-17PM/jre/bin/java, and the argv is
    /tmp/OraInstall2015-08-03_05-32-17PM/jre/bin/java
    -Doracle.installer.library_loc=/tmp/OraInstall2015-08-03_05-32-17PM/oui/lib/linux
    -Doracle.installer.oui_loc=/tmp/OraInstall2015-08-03_05-32-17PM/oui
    -Doracle.installer.bootstrap=TRUE
    -Doracle.installer.startup_location=/u01/app/oracle/product/11.2.0/db_1/oui/bin
    -Doracle.installer.jre_loc=../../jre
    -Doracle.installer.nlsEnabled=”TRUE”
    -Doracle.installer.prereqConfigLoc=
    -Doracle.installer.unixVersion=2.6.18-164.el5
    -mx96m
    -cp
    /tmp/OraInstall2015-08-03_05-32-17PM::/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/OraPrereqChecks.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/OraPrereq.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/prov_fixup.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/jsch.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/instcommon.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/cvu.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/ssh.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/orai18n-mapping.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/installcommons_1.0.0b.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/emocmutl.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/remoteinterfaces.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/orai18n-utility.jar:/tmp/OraInstall2015-08-03_05-32-17PM/ext/jlib/instdb.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/OraInstaller.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/oneclick.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/xmlparserv2.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/share.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/OraInstallerNet.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/emCfg.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/emocmutl.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/OraPrereq.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/jsch.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/ssh.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/remoteinterfaces.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/http_client.jar:/tmp/OraInstall2015-08-03_05-32-17PM/OPatch/jlib/opatch.jar:/tmp/OraInstall2015-08-03_05-32-17PM/OPatch/jlib/opatchactions.jar:/tmp/OraInstall2015-08-03_05-32-17PM/OPatch/jlib/opatchprereq.jar:/tmp/OraInstall2015-08-03_05-32-17PM/OPatch/jlib/opatchutil.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/OraCheckPoint.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstImages.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_de.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_es.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_fr.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_it.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_ja.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_ko.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_pt_BR.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_zh_CN.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/InstHelp_zh_TW.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/oracle_ice.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/help4.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/help4-nls.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/ewt3.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/ewt3-swingaccess.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/ewt3-nls.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/swingaccess.jar::/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/jewt4.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/jewt4-nls.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/orai18n-collation.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/orai18n-mapping.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/ojmisc.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/xml.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/srvm.jar:/tmp/OraInstall2015-08-03_05-32-17PM/oui/jlib/srvmasm.jar
    oracle.sysman.oii.oiic.OiicInstaller
    -scratchPath
    /tmp/OraInstall2015-08-03_05-32-17PM
    -sourceType
    network
    -timestamp
    2015-08-03_05-32-17PM
    -clone
    -waitForCompletion
    ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
    ORACLE_HOME_NAME=OraDbRAC
    ORACLE_BASE=/u01/app/oracle
    CLUSTER_NODES={host01, host02, host03}
    LOCAL_NODE=
    INFO: Environment Variables:

    INFO: ORACLE_HOME =

    INFO: PATH = /usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin

    INFO: CLASSPATH =

    INFO: Username:oracle

    INFO: Install area Control created with access level 1

    INFO: Oracle Universal Installer version is 11.2.0.1.0

    INFO: Setting variable ‘ORACLE_HOME’ to ‘/u01/app/oracle/product/11.2.0/db_1′. Received the value from the command line.
    INFO: Setting variable ‘ORACLE_BASE’ to ‘/u01/app/oracle’. Received the value from the command line.
    INFO: Setting variable ‘ORACLE_HOME_NAME’ to ‘OraDbRAC’. Received the value from the command line.
    INFO: Setting variable ‘CLUSTER_NODES’ to ‘host01,host02,host03′. Received the value from the command line.
    INFO: Setting variable ‘LOCAL_NODE’ to ”. Received the value from the command line.
    INFO: Setting variable ‘PREREQ_CONFIG_LOCATION’ to ”. Received the value from variable association.
    INFO: Setting variable ‘FROM_LOCATION’ to ‘/u01/app/oracle/product/11.2.0/db_1/inventory/ContentsXML/comps.xml’. Received the value from a code block.
    INFO: config-context initialized
    INFO: Initializing install inventory
    INFO: Setting up install inventory
    SEVERE: OUI-10197:Unable to create a new Oracle Home at /u01/app/oracle/product/11.2.0/db_1. Oracle Home already exists at this location. Select another location.
    INFO: User Selected: Yes/OK

    INFO: java.io.IOException: OUI-10197:Unable to create a new Oracle Home at /u01/app/oracle/product/11.2.0/db_1. Oracle Home already exists at this location. Select another location.

    1. Hi Bharat

      Take a look at this message:
      Unable to create a new Oracle Home at /u01/app/oracle/product/11.2.0/db_1. Oracle Home already exists at this location.

      Pls select another location for Oracle Home or deinstall Oracle Home which is already there.

      regards
      nju

  3. Hi Mam.

    In step 2 of 1 we have copied binaries from node 1 to node 3 and again in step 4 you said the script will copy binaries.

    I am bit confused.

    Thanks for very nice info.

    Regards,
    Sai

    1. Hi Sai,

      In step 1, we have copied the compressed .tgz file to node 3.
      In step 4, we are using tar to extract the contents of compressed file.

      Thanks for your time and feedback.
      Your comments and suggestions are always welcome.

      regards
      Anju

Your comments and suggestions are welcome!