RAC Oracle Home Cloning (Fast Clone)
The following procedures and examples come from an 11.2 RAC cluster running Linux. Although most of the Oracle documentation states that the services running out of the Oracle home to be cloned must be stopped, there are also other notes and this guide that have found this not to be the case. This section has been successfully tested with cloning 11.2, 11.1 and 10.2 Oracle homes into an 11.2 cluster. There are two additional sections that deal with switching over to a cloned home in a rolling manner to minimize downtime. This can be helpful when cloning an Oracle home to apply patches and then switching running databases to the new Oracle home.
The following basic steps will be performed to clone the RAC database Oracle home.
- Create new target directories on all target nodes.
- Un-tar the source Oracle home into the target directories.
- Update the oratab file on each node.
- Run the Oracle clone.pl script to register the Oracle homes on all nodes from one of the new Oracle homes.
- Verify the local and central inventories on each node.
- Apply any required patches.
Create New Oracle Home
Create new target directories
These procedures will use following format:
Create new Oracle home directories on each node as oracle and verify the proper ownership of the new directory (i.e. oracle:oinstall):
chown oracle:oinstall db_2
Note: This example assumes that the /u01/app/oracle/product/11.2.0 directory already exists and that we're adding a seconde Oracle home.
Copy and untar the source Oracle home as root into the target directory on each node
tar -zxvpf /orasrc/gold_copies/db11203_clone.tgz .
Update the oratab file (optional)
Update the oratab file and add the new Oracle home. The new entry for this example should look like this:
Run Clone Utility
For each cloned Oracle home run the following as oracle:
Set the environment to the new Oracle home:
Note: It’s easiest to add the new ORACLE_HOME to the oratab file and run orasetup to set the environment correctly.
$ . orasetup
$ export ORACLE_BASE=/u01/app/oracle
$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_2
$ export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Run the clone.pl script:
On each node run the clone.pl following, updating the values as appropriate:
perl $ORACLE_HOME/clone/bin/clone.pl $E01 $E02 $E03 $C01 $C02
Note: The script will ask you to run the root.sh script.
On the primary node run the following to update the node list in the local and central inventory files:
$ORACLE_HOME/oui/bin/runInstaller –updateNodeList \
ORACLE_HOME="$ORACLE_HOME" ORACLE_HOME_NAME="OraDb11g_home2" \
Check inventory files:
Verify the central inventory on each node
The easiest way to verify that the central inventory has been properly updated is to run an opatch lsinventory command from the cloned Oracle home:
$ opatch lsinventory
11.1 and 10.2 Note - Pin Nodes
# olsnodes -t
# crsctl pin css -n node1
CRS-4664: Node node1 successfully pinned.
# crsctl pin css -n node2
CRS-4664: Node node2 successfully pinned.
# olsnodes -t
Apply patches to the cloned Oracle home
Any patches can now be applied to the cloned Oracle homes. The idea here is to save down time by performing all non-database specific tasks while the database(s) continue to run in their original Oracle home.
Note: Any database required scripts that are included in the patches applied to the Oracle home that have not been previously run will need to be run once the database is switched to the cloned Oracle home.
Oracle® Real Application Clusters Administration and Deployment Guide,
11g Release 2 (11.2) – Cloning Oracle RAC to Nodes in a New Cluster
Oracle Clusterware Administration and Deployment Guide, 11g Release 2 – Cloning Oracle Clusterware
Oracle Database Installation Guide, 11g Release 2 (11.2) for Linux, Cloning an Oracle Home
Oracle Universal Installer and OPatch User’s Guide, 11g Release 2 (11.2) for Windows and UNIX
Oracle® Universal Installer and OPatch User's Guide, 11g Release 1 (11.1) for Windows and UNIX
Minimal downtime patching via cloning 11gR2 ORACLE_HOME directories [ID 1136544.1]
Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI) [ID 1154613.1]
How to Clone an 22.214.171.124 Grid Infrastructure Home and Clusterware [ID 1413846.1]
Oracle Universal Installer (OUI) FAQ [ID 458893.1]