Total Pageviews

Oracle Database Clone ORACLE_HOME to some other location (within or on other node) - Manual Method

Purpose: 
Clone the current database home to another location either or on other server.


Assumptions:
RDBMS home owner is oracle.
Source Home : /u01/app/oracle/product/11.2.0.2/dbhome_1
Target home : /u01/app/oracle/product/11.2.0.2/dbhome_2

Steps:
Stop Database:
Stop the database and other services running from source database home.


Create a tar file of Database Binaries:
As root user
cd /u01/app/oracle/product/11.2.0.2/dbhome_1
nohup tar -cvpf /tmp/dbhome_1.tar . > /tmp/dbhome_1.log & 

Note: (make sure / directory has space to contain dbhome_1.tar)

Create destination directory and grant required permissions:

As oracle user
mkdir -p /u01/app/oracle/product/11.2.0.2/dbhome_2

Unzip/Untar create binaries backup to destination directory:
As root user
cd /u01/app/oracle/product/11.2.0.2/dbhome_2
tar -xvf /tmp/dbhome_1.tar

Backup config file in destination RDBMS home:

As oracle user
cd /u01/app/oracle/product/11.2.0.2/dbhome_2/rdbms/lib
mv config.o config.o_bkp

As oracle user
cd /u01/app/oracle/product/11.2.0.2/dbhome_2/clone/bin

Note: On the next step the ORACLE_HOME_NAME should be the one that does not exists in inventory (cat /u01/app/oraInventory/ContentsXML/inventory.xml | grep HOME_NAME) 

Execute perl script clone.pl:

perl clone.pl ORACLE_HOME="/u01/app/oracle/product/11.2.0.2/dbhome_2" ORACLE_HOME_NAME="OraDb11g_home2" ORACLE_BASE="/u01/app/oracle" OSDBA_GROUP=oinstall

Run root.sh script from destination RDBMS home:
As root user run the root.sh script as shown after the clone script is done in above step

Relink RDBMS Binaries:

As oracle user
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/dbhome_2
cd /u01/app/oracle/product/11.2.0.2/dbhome_2/rdbms/lib
make -f ins_rdbms.mk ipc_rds ioracle


Check the opatch inventory from destination RDBMS home:
As Oracle user,
export PATH=/u01/app/oracle/product/11.2.0.2/dbhome_2/OPatch:$PATH
opatch lsinventory -oh /u01/app/oracle/product/11.2.0.2/dbhome_2 

Note: (should succeed and should show new home with list of patches applied)
Note: In the above output of lsinventory the local and remote nodes should show the correct output.

run Opatch lsinventory :

Must return nodes details "current and remote nodes (in case of RAC)" without any error message

Might be opatch lsinventory is not updated properly: Attache the DB home using runInstaller attachhome method.


  • In case of DB Home is cloned on other node:
./runInstaller -silent -attachHome -invPtrLoc ./oraInst.loc 
ORACLE_HOME="<Oracle_Home_Location>" ORACLE_HOME_NAME="<Oracle_Home_Name>"
  • In Case of the DB HOME is the part of clusterware: In above command add the cluster details clauses as mentioned below:
"CLUSTER_NODES={<node1,node2>}" LOCAL_NODE="<node_name>"

No comments:

Post a Comment