Search

Wednesday, August 10, 2016

Procedure to clone a database home in RAC for add node ( new) to the cluster

n 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