How To Clone A Database Home From One Server To Other(same SID,directory,path)

Check the oracle home to clone
[oracle@lnx1 dbhome_1]$ opatch lsinv
Invoking OPatch 11.2.0.1.3
Oracle Interim Patch Installer version 11.2.0.1.3
Copyright (c) 2010, Oracle Corporation.  All rights reserved.
Oracle Home       : /oracle/app/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.3
OUI version       : 11.2.0.1.0
OUI location      : /oracle/app/product/11.2.0/dbhome_1/oui
Log file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-11-05_08-52-30AM.log
Patch history file: /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010
11-05_08-52-30AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g                                                  11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch  9952216      : applied on Fri Nov 05 07:13:34 PDT 2010
Unique Patch ID:  12825033
   Created on 13 Sep 2010, 04:55:09 hrs PST8PDT

…………………………………

-------------------------------------------------------------------------------- 
OPatch succeeded.

Check the oracle home size
[oracle@lnx1 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx1 dbhome_1]$
[oracle@lnx1 dbhome_1]$ du -h . | tail -1
4.5G .
Create the directory tree on the remote server and change ownership to oracle
[oracle@lnx2 ~]$ su -
Password:
[root@lnx2 ~]# mkdir -p /oracle/app/product/11.2.0/dbhome_1
[root@lnx2 ~]# chown -R oracle:dba /oracle
On source execute tar command to copy over the network the oracle_home directories to the target server
[oracle@lnx1 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx1 dbhome_1]$ tar cvf - . | ( ssh lnx2 "cd /oracle/app/product/11.2.0/dbhome_1 ; tar xvf -" )
Once the tar finishes to copy on the target oracle home check the total size
[oracle@lnx2 ~]$ cd /oracle/app/product/11.2.0/dbhome_1
[oracle@lnx2 dbhome_1]$ du -h . | tail -1
4.5G .
Using the OUI to finish the cloning process

First I need to detach the inventory because the server was itself a clone of the source
[oracle@lnx2 ~]$ cd /oracle/app/product/11.2.0/dbhome_1/oui/bin
[oracle@lnx2 bin]$ ./runInstaller -detachHome
ORACLE_HOME="/oracle/app/product/11.2.0/dbhome_1"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 1992 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /home/oracle/oraInventory
'DetachHome' was successful.

Once the inventory was detached from the old server version I can run the
cloning procedure:
[oracle@lnx2 bin]$ ./runInstaller -clone -silent -ignorePreReq
ORACLE_HOME="/oracle/app/product/11.2.0/dbhome_1" ORACLE_HOME_NAME="dbhome_11gR2"
ORACLE_BASE="/oracle/app" OSDBA_GROUP=dba OSOPER_GROUP=dba
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB.   Actual 1992 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-11-05_11-28-15AM. Please
wait ...[oracle@lnx2 bin]$ Oracle Universal Installer, Version 11.2.0.1.0 Production
Copyright (C) 1999, 2009, Oracle. All rights reserved.
You can find the log of this install session at:
/home/oracle/oraInventory/logs/cloneActions2010-11-05_11-28-15AM.log
.................................................................................................... 100% Done.
Installation in progress (Friday, November 5, 2010 11:28:48 AM PDT)
..............................................................................                                                  78% Done.
Install successful
Linking in progress (Friday, November 5, 2010 11:29:21 AM PDT)
Link successful
Setup in progress (Friday, November 5, 2010 11:31:59 AM PDT)
Setup successful
End of install phases.(Friday, November 5, 2010 11:35:50 AM PDT)
Starting to execute configuration assistants
Configuration assistant "Oracle Configuration Manager Clone" succeeded
WARNING:
The following configuration scripts need to be executed as the "root" user.
/oracle/app/product/11.2.0/dbhome_1/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts
The cloning of dbhome_11gR2 was successful.
Please check '/home/oracle/oraInventory/logs/cloneActions2010-11-05_11-28-15AM.log' for more details.
The last step is to execute as root the root.sh script:
[root@lnx2 ~]# /oracle/app/product/11.2.0/dbhome_1/root.sh
Check /oracle/app/product/11.2.0/dbhome_1/install/root_lnx2_2010-11-05_11-39-06.log for the output of root script

[oracle@lnx2 ~]$ opatch lsinv
Invoking OPatch 11.2.0.1.3
Oracle Interim Patch Installer version 11.2.0.1.3
Copyright (c) 2010, Oracle Corporation.  All rights reserved.
Oracle Home       : /oracle/app/product/11.2.0/dbhome_1
Central Inventory : /home/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.3
OUI version       : 11.2.0.1.0
OUI location      : /oracle/app/product/11.2.0/dbhome_1/oui
Log file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-11-05_11-46-19AM.log
Patch history file: /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /oracle/app/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010-
11-05_11-46-19AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g                                                  11.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch  9952216      : applied on Fri Nov 05 07:13:34 PDT 2010
Unique Patch ID:  12825033
   Created on 13 Sep 2010, 04:55:09 hrs PST8PDT
   Bugs fixed:
     9068088, 9363384, 8865718, 8898852, 8801119, 9054253, 8725286, 8974548
     9093300, 8909984, 8755082, 8780372, 9952216, 8664189, 8769569, 7519406
     9471411, 9302343, 8822531, 7705591, 8650719, 9637033, 8883722, 8639114
     8723477, 8729793, 8919682, 8856478, 9001453, 8733749, 8565708, 8735201

…………………..

--------------------------------------------------------------------------------
OPatch succeeded.

Post Clone Checkups
It may be needed to update $ORACLE_HOME/dbs,  $ORACLE_HOME/network/admin files to make them match
the new server.
References:
Master Note For Cloning Oracle Database Server ORACLE_HOME's Using the Oracle Universal Installer (OUI)
(Doc ID 1154613.1)
Cloning An Existing Oracle11g Release 2 (11.2.0.x) RDBMS Installation Using OUI (Doc ID 1221705.1)
FAQs on RDBMS Oracle Home Cloning Using OUI (Doc ID 565009.1)

posted @ 2012-03-12 15:29  dbblog  阅读(806)  评论(0编辑  收藏  举报