Wednesday, February 27, 2013

Cloning Oracle database Home from one server to another


How To Clone A  ORACLE Database Home From One Server To Other

Step1 : 
[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 patches1) :
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
8684517, 8870559, 8773383, 8981059, 8812705, 9488887, 8813366, 9242411
8822832, 8897784, 8760714, 8775569, 8671349, 8898589, 9714832, 8642202
9011088, 9369797, 9170608, 9165206, 8834636, 8891037, 8431487, 8570322
8685253, 8872096, 8718952, 8799099, 9032717, 9399090, 9713537, 9546223
8588519, 8783738, 8834425, 9454385, 8856497, 8890026, 8721315, 8818175
8674263, 9145541, 8720447, 9272086, 9467635, 9010222, 9102860, 9197917
8991997, 8661168, 8803762, 8769239, 9654983, 8546356, 8706590, 8778277
9058865, 8815639, 9971778, 9971779, 9027691, 9454036, 9454037, 9454038
9255542, 8761974, 9275072, 8496830, 8702892, 8818983, 8475069, 8875671
9328668, 8891929, 8798317, 8782959, 9971780, 8774868, 8820324, 8544696
8702535, 9406607, 9952260, 8268775, 9036013, 9363145, 8933870, 8405205
9467727, 8822365, 9676419, 8761260, 8790767, 8795418, 8913269, 8717461
8861700, 9531984, 8607693, 8330783, 8780281, 8784929, 8780711, 9341448
9015983, 8828328, 9119194, 8832205, 8665189, 8717031, 9482399, 9676420
9399991, 8821286, 8633358, 9321701, 9231605, 9655013, 8796511, 9167285
8782971, 8756598, 9390484, 8703064, 9066116, 9007102, 9461782, 9382101

8505803, 9352237, 8753903, 9216806, 8918433, 9057443, 8790561, 8795792
8733225, 9067282, 8928276, 8837736, 9210925
--------------------------------------------------------------------------------
OPatch succeeded.

Step 2:   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 -chs

4.5G


step 3: 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/
[root@lnx2 ~]# chown -R oracle:oinstall  /oracle

step4: 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
[oracle@lnx1 11.2.0]$ tar -cvf dbhome_1.tar dbhome_1
[oracle@lnx1 11.2.0]$ scp dbhome_1.tar oracle@linux2: /oracle/app/product/11.2.0/

go to new machine
[oracle@lnx2 11.2.0]$ tar -xvf dbhome_1.tar

 [oracle@lnx2 dbhome_1]$ du -chs


4.5G

step5: 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.

step 6: 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.


Step 7: 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

Post Check:

[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.

........................
OPatch succeeded.




No comments:

Post a Comment

Share your knowledge it really improves, don't show off...