Tuesday, August 22, 2017

Cloning an existing ORACLE_HOME on Unix


By using the procedure shown below, we can replicate a ‘master’ copy of an Oracle software installation on any number of target servers. Not only will it ensure that Oracle software installations are standardised and include all the required patches, but will save considerable time and effort required to stage the software on multiple servers.
 How to Clone an existing ORACLE HOME on UNIX
 Source
Hostname: devu014
Oracle Home: /u01/oracle/product/10204
 Target
Hostname: devu007
Oracle Home: /u02/oradata/product/10204
  Use ‘tar’ to create a zipped archive of the source Oracle software. Note: use the  ‘-p’ flag to preserve file permissions
 oracle@devu014:pwd
/u01/oracle/product
 oracle@devu014: tar -pcvf 10204.tar 10204
 On the target machine scp the tar file to the appropriate location and unzip the archive
 crashdb:/u02/oradata> mkdir product
crashdb:/u02/oradata> cd product
crashdb:/u02/oradata/product> scp -rp devu014:/u01/oracle/product/10204.tar .
oracle@devu014’s password:
10204.tar                                                             100% 4389MB  14.1MB/s   05:12
crashdb:/u02/oradata/product> ls
10204.tar
 crashdb:/u02/oradata/product> tar -xvf 10204.tar
 Note the file permissions of the source is preserved after the files are unzipped on the target
 crashdb:/u02/oradata/product/10204> cd bin
 crashdb:/u02/oradata/product/10204/bin> ls -l oracle
rwsr-s–x   1 oracle   dba       133931237 Oct 31 09:54 oracle
 Use the clone.pl perl script to perform the installation process which will also perform the relink and update of the Oracle Inventory
 perl clone.pl ORACLE_HOME=”/u02/oradata/product/10204″ ORACLE_HOME_NAME=”10204_HOME”
 ./runInstaller -silent -clone -waitForCompletion  “ORACLE_HOME=/u02/oradata/product/10204” “ORACLE_HOME_
NAME=10204_HOME” -noConfig -nowait
Starting Oracle Universal Installer…
 No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-11-05_12-20-31PM. Please wait ..
.Oracle Universal Installer, Version 10.2.0.4.0 Production
Copyright (C) 1999, 2008, Oracle. All rights reserved.
 You can find a log of this install session at:
 /u01/oracle/oraInventory/logs/cloneActions2008-11-05_12-20-31PM.log
………………………………………………………………………………………. 100% Done.


Installation in progress (Wednesday, November 5, 2008 12:21:22 PM WST)
………………………………………………………………                                                        72% Done.
Install successful

Linking in progress (Wednesday, November 5, 2008 12:22:04 PM WST)
Link successful

Setup in progress (Wednesday, November 5, 2008 12:28:27 PM WST)
Setup successful

End of install phases.(Wednesday, November 5, 2008 12:28:42 PM WST)
WARNING:
The following configuration scripts need to be executed as the “root” user.
#!/bin/sh
#Root script to run
/u02/oradata/product/10204/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as “root”
    3. Run the scripts

The cloning of 10204_HOME was successful.
 Confirm that the Oracle Inventory has been updated with the cloned Oracle Home information
 crashdb:/u01/oracle/oraInventory/ContentsXML> ls
comps.xml      inventory.xml  libs.xml
 cat inventory.xml
 <?xml version=”1.0″ standalone=”yes” ?>
<!– Copyright (c) 2008 Oracle Corporation. All rights Reserved –>
<!– Do not modify the contents of this file by hand. –>
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>10.2.0.4.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME LOC=”/u01/app/oracle/gnu/product/92″ IDX=”1″/>
<HOME LOC=”/u01/oracle/product/10.2/kana” IDX=”2″/>
<HOME LOC=”/u01/oracle/product/11.0″ IDX=”3″/>
<HOME LOC=”/u01/oracle/agent10g” IDX=”5″/>
<HOME LOC=”/u02/oradata/product/10204″ IDX=”7″/>
</HOME_LIST>
</INVENTORY>


Reference:-Gavin Soorma blog

No comments:

Post a Comment