Categories

[Oracle] Clone Oracle Home

You are here:
< All Topics

ENVIRONMENT:

  • Red Hat Linux 7
  • Oracle Database 11

VARIABLES:

  • OLD_ORACLE_HOME: path of the Oracle Home to clone
  • NEW_ORACLE_HOME: path of the Oracle Home cloned from the previous
  • NODE1: hostname of the first node of the cluster
  • NODE2: hostname of the second node of the cluster
  • MY_ORACLE_BASE: path of the base directory of Oracle

Hi all,

in this tutorial we are going to clone an existing Oracle Home in a new one. This is done mainly for segregation of databases, in order to simplify patching and maintenance. We assume there is a cluster of two nodes (NODE1 and NODE2) and that the ORACLE_BASE directory is the same on both of them.

There are very few steps to execute. First of all, just copy the old home in the new home as oracle user:

cp -rp OLD_ORACLE_HOME NEW_ORACLE_HOME

The previous step needs to be executed on both NODE1 and NODE2. It is good pratice to remove useless files from OLD_ORACLE_HOME/dbs and OLD_ORACLE_HOME/network/admin and to remove old entries from OLD_ORACLE_HOME/network/admin/tnsnames.ora file.

Next, just launch the following command as oracle user to actually compile binaries:

#NODE1
export ORACLE_HOME=NEW_ORACLE_HOME
perl $ORACLE_HOME/clone/bin/clone.pl 'CLUSTER_NODES={NODE1,NODE2}' 'LOCAL_NODE=NODE1' ORACLE_BASE=MY_ORACLE_BASE ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=MY_NEW_ORACLE_HOME_NAME -debug

#NODE2
export ORACLE_HOME=NEW_ORACLE_HOME
perl $ORACLE_HOME/clone/bin/clone.pl 'CLUSTER_NODES={NODE1,NODE2}' 'LOCAL_NODE=NODE2' ORACLE_BASE=MY_ORACLE_BASE ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=MY_NEW_ORACLE_HOME_NAME -debug

Finally, just launch the following command as root user on both nodes:

NEW_ORACLE_HOME/root.sh

That’s all, see you in the next tutorial.

Table of Contents