2012-09-27

Cloning Oracle 11.2 database installation on Solaris


Environment

Oracle 11.2.0.2, Solaris 10

Packing Source Oracle Home

export CLONE=/oracle/stage/clone11.2.0.2
echo $CLONE
cd $ORACLE_HOME

Optionally you can create Exclude List for tar command to exclude some files from source home.
Log files:
find . -name "*.log" >$CLONE/ExcludeList.txt
find . -name "*.err" >>$CLONE/ExcludeList.txt
Database templates:
find ./assistants/dbca/templates >>$CLONE/ExcludeList.txt
Network files:
find ./network/admin >>$CLONE/ExcludeList.txt

Check your Exclude file:
cat $CLONE/ExcludeList.txt

tar -cvfX - $CLONE/ExcludeList.txt . | gzip -c >$CLONE/oracle_home11.2.tar.gz

If source and target are on the same host you can use
cp -Rp $ORACLE_HOME
Ignore errors for files owned by root (nmb, nmo, etc.)

Cloning Oracle Home

Check or create oraInst.loc
cat /var/opt/oracle/oraInst.loc

Optionally J check known issues in
Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI) [ID 1154613.1]

Navigate to new Oracle home:
cd /oracle/product/11.2.0.2/db_2
or if you have set the variables
cd $ORACLE_HOME
pwd
Unpack Oracle home to new location
gunzip < /oracle/stage/clone11.2.0.2/oracle_home11.2.tar.gz | tar xvf –

unset LD_LIBRARY_PATH
unset LD_LIBRARY_PATH_64
Check that other variables do not point to different Oracle home or unset them
echo $PATH
unset ORACLE_HOME
unset ORACLE_BASE
unset TNS_ADMIN

cd clone/bin

perl clone.pl ORACLE_HOME="/oracle/product/11.2.0.2/db_2" ORACLE_HOME_NAME="OraDB11g_home2" ORACLE_BASE="/oracle" OSDBA_GROUP=dba OSOPER_GROUP=oper

as root run
/oracle/rdbms/11.2.0.2/ora10R4/root.sh

Update
listener.ora
tnsnames.ora

Useful Links

Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI) [ID 1154613.1]
How To Clone An Existing RDBMS Installation Using OUI [ID 300062.1]
FAQs on RDBMS Oracle Home Cloning Using OUI [ID 565009.1]