Cloning Oracle 10g ORACLE_HOME
I had to apply PSU Patch for few databases running in Common ORACLE_HOME ,where few database should not be patched.
I thought of installing the new oracle for the same and i found it is time consuming, when i googled i found in 10g there is an option to clone the existing home.
Below are the steps to clone the ORACLE_HOME:
1. Copy the Oracle_HOME to the destination location (whether it be on the same or a remote server). When you need to rename the directory where the current installation is located, you can do this as well.
If necessary, take the central inventory as well.
2. Check the existence of the ORACLE_HOME in the Central Inventory
$ pwd
/local/oracle/product/ oraInventory/ContentsXML
$grep "HOME NAME" inventory.xml
<HOME NAME="OUIHome3" LOC="/local/oracle/product/10. 2.0.4" TYPE="O" IDX="1"/>
<HOME NAME="OUIHome7" LOC="/local/oracle/product/10. 2.0.5.2" TYPE="O" IDX="2"/>
$
3. (Conditional) Detach the ORACLE_HOME using runInstaller from the copied ORACLE_HOME (Do this if needed)
$ORACLE_HOME/oui/bin/ runInstaller -detachhome ORACLE_HOME=/local/oracle/ product/10.2.0.5.2
Starting Oracle Universal
Installer...
No pre-requisite checks found in oraparam.ini, no
system pre-requisite checks will be executed.
The inventory pointer is located at
/var/opt/oracle/oraInst.loc
The inventory is located at
/local/oracle/product/ oraInventory'
DetachHome' was successful.
$
4. Check the Inventory to see if the ORACLE_HOME was removed (verify the REMOVED=”T” option is added to the ‘HOME NAME’ tag)
$ cd /local/oracle/product/ oraInventory/ContentsXML
$ grep "HOME NAME" inventory.xml
$
5. cd /local/oracle/product
cp -r 10.2.0.5.2 10.2.0.5.2a
6. Reregister the ORACLE_HOME
Make sure nothing by the current user is running, because it will do a relink as part of the procedure.
$ cd $ORACLE_HOME/clone/bin
./runInstaller -silent -clone -waitForCompletion "ORACLE_HOME=/local/oracle/ product/10.2.0.5.2a" "ORACLE_HOME_NAME=OraDb10g_ home1" -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-07_03- 21-26PM.
Please wait ...Oracle Universal Installer, Version 10.2.0.3.0 Production
Copyright (C) 1999, 2006, Oracle. All rights reserved.
You can find a log of this install session at:
/local/oracle/product/ oraInventory/logs/ cloneActions2008-11-07_03-21- 26PM.log
.............................. .............................. .............................. ..........
100% Done.
Installation in progress (Fri Nov 07 15:21:37 CET 2008)
.............................. .............................. .....................
81% Done.
Install successful
Linking in progress (Fri Nov 07 15:21:49 CET 2008)
Link successful
Setup in progress (Fri Nov 07 15:22:56 CET 2008)
Setup successful
End of install phases.(Fri Nov 07 15:23:03 CET 2008)
WARNING:
The following configuration
scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/local/oracle/product/10.2.0. 5.2a/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
The cloning of OraDb10g_home1 was successful.
Please check '/local/oracle/product/ oraInventory/logs/ cloneActions2008-11-07_03-21- 26PM.log' for more details.
$
7. Run Root.sh
$ su -
Password:
#
# /local/oracle/product/10.2.0. 5a/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /local/oracle/product/10.2.0. 5a
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n) [n]: y
Copying coraenv to /usr/local/bin
...
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
#
8. The clone is ready now.
NOTE : If you have an ORACLE_HOME with a number of patches (like I had with the 10.2.0.5.2 patch set) these will automatically be taken with the clone.
Attaching Home:
ReplyDelete$ORACLE_HOME/oui/bin/runInstaller -silent -attachHome -invPtrLoc /u01/oracle/product/10.2.0.2/oraInst.loc -ignorePreReq ORACLE_HOME=/u01/oracle/product/10.2.0.2 ORACLE_HOME_NAME=Ora10gR2_Home1
Detaching Home:
$ORACLE_HOME/oui/bin./runInstaller -silent -detachhome -invPtrLoc /u01/oracle/product/10.2.0.2/oraInst.loc ORACLE_HOME=/u01/oracle/product/10.2.0.2