Cloning Single instance oracle home

Oracle 11g

Cloning the single instance oracle home (This method require -Sudo privilage on both servers)

here I am going to clone the oracle home to the new server which has same hardware configuration as the source server)

  1. login as root user

$su –
password:

echo $ORACLE_HOME

/u01/app/oracle/product/11.2.0/db_1

cd /u01/app/oracle/product/11.2.0/db_1

2.check the present directory disk usage size
(Note: we need to move the size across the network and makwe sure we have space in the destination location)

du -sh

  1. Then copy the directory without changing the permission of the file
    (note : “-rp ” option help to copy the witout changing the permission of file or folder)
    cp -rp

cd /u01/app/oracle/product/11.2.0/

11.2.0] cp -rp db_1 clonedb_1

tar -zvCf clonedb_1.tar.gz

scp -rp clonedb_1 [email protected]:/u01/app/oracle/product/11.2.0/db_home

4.In the new server create required directory structure

$ mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
$ export ORACLE_BASE=/u01/app
$ export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
$ cd $ORACLE_HOME/

  1. In the clone location unzip tar file what
    dbhome_1]$ cp ~/orahome11gR2_lin32.tar.gz .

dbhome_1]$ gunzip clonedb_1.tar.gz

dbhome_1]$ tar -xvf clonedb_1.tar

dbhome_1]$su –

tar -xvf clonedb_1

exit

$ cd /u01/app/oracle/product/11.2.0/clonedb_1/clone/bin

  1. Now we need to provide the oracle base location. it is going to create the “oracle inventory location”
    and run the perl script in clone/bin location

11.2.0/clonedb_1/clone/bin]$ perl clone.pl ORACLE_BASE=/u01/app/oracle ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 ORACLE_HOME_NAME=11gR2_NEW

by the same time tail the log when the the location mentioned after using the above command

in another terminal
$tail-f /u01/app/oraInventory/logs/cloneAction2012-09-02_10-22.0PM.log
.
.
.
.
.
.
.

The cloning of 11gR2_NEW was sucessesful.
(Note when you get this message in log file cole preocess is sucessful)

  1. run the root script ( to change the permission of the files and folder)

$su –

/u01/app/oracle/product/11.2.0/clonedb_1/root.sh

  1. then check the entry of the database in the /etc/oratab location

and we can check the oracle home location by checking the xml file in the inventory location

cd /u01/app/oraInventory/ContentsXML

cat inventory.xml

then change the listener entry