Below are the steps for cloning ORACLE_HOME from one server to another server.
1. Check the oracle_home inventory [ SOURCE DB]
$ORACLE_HOME/OPatch/opatch lsinventory Oracle Interim Patch Installer version 12.1.0.1.10 Copyright (c) 2017, Oracle Corporation. All rights reserved. Oracle Home : /oracle/app/oracle/product/12.1.0.2_CRMTST/dbhome_1 Central Inventory : /oracle/app/oraInventory from : /oracle/app/oracle/product/12.1.0.2_CRMTST/dbhome_1/oraInst.loc OPatch version : 12.1.0.1.10 OUI version : 12.1.0.2.0 Log file location : /oracle/app/oracle/product/12.1.0.2_CRMTST/dbhome_1/cfgtoollogs/opatch/opatch2017-02-08_13-03-50PM_1.log Lsinventory Output file location : /oracle/app/oracle/product/12.1.0.2_CRMTST/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2017-02-08_13-03-50PM.txt -------------------------------------------------------------------------------- Local Machine Information:: Hostname: dbatest ARU platform id: 23 ARU platform description:: Solaris Operating System (SPARC 64-bit) Installed Top-level Products (1): Oracle Database 12c 12.1.0.2.0 There are 1 products installed in this Oracle Home. Interim patches (2) : Patch 22139226 : applied on Sun Feb 28 16:22:03 AST 2016 Unique Patch ID: 19731538 Patch description: "Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016)" Created on 8 Jan 2016, 04:08:32 hrs PST8PDT Bugs fixed: 19699946, 19176885, 19623450, 22139226, 19909862, 21811517, 19223010 21068507, 19895326, 19877336, 22118835, 22118851, 21566993, 19153980 20408829, 21047766, 19231857, 19895362, 19855285, 20415564, 21555660 19245191, 21047803, 20408866, 21566944 Patch 21948354 : applied on Sun Feb 28 16:19:33 AST 2016 Unique Patch ID: 19591711 Patch description: "Database Patch Set Update : 12.1.0.2.160119 (21948354)" Created on 23 Dec 2015, 01:11:03 hrs PST8PDT Sub-patch 21359755; "Database Patch Set Update : 12.1.0.2.5 (21359755)" Sub-patch 20831110; "Database Patch Set Update : 12.1.0.2.4 (20831110)" Sub-patch 20299023; "Database Patch Set Update : 12.1.0.2.3 (20299023)" Sub-patch 19769480; "Database Patch Set Update : 12.1.0.2.2 (19769480)" Bugs fixed: 19189525, 19075256, 19141838, 19865345, 19791273, 19280225, 18845653 20951038, 19243521, 19248799, 21756699, 18988834, 19238590, 21281532 20245930, 18921743, 18799063, 19134173, 19571367, 20476175, 20925795 19018206, 20509482, 20387265, 20588502, 19149990, 18849537, 18886413 17551063, 19183343, 19703301, 19001390, 18202441, 19189317, 19644859 19358317, 19390567, 19279273, 19706965, 19068970, 19619732, 20348653 18607546, 18940497, 19670108, 19649152, 18948177, 19315691, 19676905 18964978, 19035573, 20165574, 19176326, 20413820, 20558005, 19176223 19532017, 20134339, 19074147, 18411216, 20361671, 20425790, 18966843 20294666, 19307662, 19371175, 19195895, 19154375, 19468991, 19174521 19520602, 19382851, 21875360, 19326908, 19658708, 20093776, 20618595 21787056, 17835294, 19791377, 19068610, 20048359, 20746251, 19143550 19185876, 19627012, 20281121, 19577410, 22092979, 19001359, 19518079 18610915, 19490948, 18674024, 18306996, 19309466, 19081128, 19915271 20122715, 21188532, 20284155, 18791688, 20890311, 21442094, 18973548 19303936, 19597439, 20235511, 18964939, 19430401, 19044962, 19409212 19879746, 20657441, 19684504, 19024808, 18799993, 20877664, 19028800 19065556, 19723336, 19077215, 19604659, 21421886, 19524384, 19048007 18288842, 19689979, 20446883, 18952989, 16870214, 19928926, 21526048 19180770, 19197175, 19902195, 20318889, 19730508, 19012119, 19067244 20074391, 19512341, 19841800, 14643995, 20331945, 19587324, 19547370 19065677, 19637186, 21225209, 20397490, 18967382, 19174430, 18674047 19054077, 19536415, 19708632, 19289642, 20869721, 19335438, 17365043 18856999, 19869255, 20471920, 19468347, 21620471, 16359751, 18990693 17890099, 19439759, 19769480, 19272708, 19978542, 20101006, 21300341 20402832, 19329654, 19873610, 21668627, 21517440, 19304354, 19052488 20794034, 19291380, 18681056, 19896336, 19076343, 19561643, 18618122 20440930, 18456643, 19699191, 18909599, 19487147, 18250893, 19016730 18743542, 20347562, 16619249, 18354830, 19687159, 19174942, 20424899 19989009, 20688221, 20441797, 19157754, 19032777, 19058490, 19399918 18885870, 19434529, 19018447, 18417036, 20919320, 19022470, 19284031 20474192, 20173897, 22062026, 19385656, 19501299, 17274537, 20899461 19440586, 16887946, 19606174, 18436647, 17655240, 19023822, 19178851 19124589, 19805359, 19597583, 19155797, 19393542, 19050649
2. Check the ORACLE_HOME size[ SOURCE DB]
cd $ORACLE_HOME du -h . | tail -1 14G .
3. Create the ORACLE_HOME directory [TARGET HOST]
mkdir -p /oracle/app/oracle/product/12.1.0.2_clone/dbhome_1
4. Take ORACLE_HOME binary backup [ SOURCE HOST]
cd $ORACLE_HOME tar -cvf /export/home/oracle/HOME_BKUP/home12_bkp.tar .
5. Scp the tar file to target host
cd /oracle/app/oracle/product/12.1.0.2_clone/dbhome_1 scp oracle@192.168.2.3:/export/home/oracle/HOME_BKUP/home12_bkp.tar .
6 . Untar the tar file
cd /oracle/app/oracle/product/12.1.0.2_clone/dbhome_1 tar -xvf home12_bkp.tar
7 . Run the clone script[TARGET HOST]
cd $ORACLE_HOME/oui/bin ./runInstaller -clone -silent -ignorePreReq ORACLE_HOME="/oracle/app/oracle/product/12.1.0.2_clone/dbhome_1" ORACLE_HOME_NAME="dbhome_12gR2" ORACLE_BASE="/oracle/app/oracle" OSDBA_GROUP=dba OSOPER_GROUP=dba
output:
# ./runInstaller -clone -silent -ignorePreReq ORACLE_HOME="/oracle/app/oracle/product/12.1.0.2_clone/dbhome_1" ORACLE_HOME_NAME="dbhome_12gR2" ORACLE_BASE="/oracle/app/oracle" OSDBA_GROUP=dba OSOPER_GROUP=dba Starting Oracle Universal Installer... Checking swap space: must be greater than 500 MB. Actual 256819 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-02-08_02-08-27PM. Please wait ...[STDBY@test/oracle/app/oracle/product/12.1.0.2_clone/dbhome_1/oui/bin# Oracle Universal Installer, Version 12.1.0.2.0 Production Copyright (C) 1999, 2014, Oracle. All rights reserved. You can find the log of this install session at: /oracle/app/oraInventory/logs/cloneActions2017-02-08_02-08-27PM.log .................................................................................................... 100% Done. Installation in progress (Wednesday, February 8, 2017 2:08:38 PM AST) ............................................................................... 79% Done. Install successful Linking in progress (Wednesday, February 8, 2017 2:08:45 PM AST) . 80% Done. Link successful Setup in progress (Wednesday, February 8, 2017 2:09:28 PM AST) .......... 100% Done. Setup successful Saving inventory (Wednesday, February 8, 2017 2:09:29 PM AST) Saving inventory complete Configuration complete End of install phases.(Wednesday, February 8, 2017 2:09:56 PM AST) WARNING: The following configuration scripts need to be executed as the "root" user. /oracle/app/oracle/product/12.1.0.2_clone/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_12gR2 was successful. Please check '/oracle/app/oraInventory/logs/cloneActions2017-02-08_02-08-27PM.log' for more details.
7. Run the root.sh script from root [ TARGET HOST]
root# /oracle/app/oracle/product/12.1.0.2_clone/dbhome_1/root.sh Check /oracle/app/oracle/product/12.1.0.2_clone/dbhome_1/install/root_sec61-1_2017-02-08_14-10-25.log for the output of root script
8.Create ADR REPO:
$ORACLE_HOME/bin/diagsetup basedir=/oracle/app/oracle oraclehome=/oracle/app/oracle/product/12.1.0.2_clone/dbhome_1
Excellent article. Following your steps worked like a charm.
Thanks.
In the first 7. step what is this setting doing?
ORACLE_HOME_NAME=”dbhome_12gR2″
Well I am not sure this actually works. Having run through t twice now.
I am thinking that the target server needs to have a base install of the database software first.
Some environment variables have to be set.
After the root scripts are run things like the listener need to be configured.
What about the init.ora or spfile?
If I am just to new to this and do not understand it, fair enough. I do not get a working clone from these steps.
HI ,
You dont need to install any oracle software on the target. Regarding root.sh , it wil give prompt to run while running the clone script.
All listener and tns and pfile will be copied same as it is in source server. But yes you need to modify them according to your requirement.