In a situation where you need to create testing Oracle database environment, the best option is to have exactly same ORACLE_HOME that is in production because many running productions are heavily patched.
Here in this post we will see how to clone the oracle home from server 1 to server 2:
Source database server (sour)
ORACLE_HOME location is: D:\app\oracle\product\11.2.0\dbhome_1
· Zip this complete folder i.e. dbhome_1
Target database server (tart)
Create the directory: D:\app\vishwanaths\product\11.2.0\clone
· Copy the zipped file and uncompress in the above location.
Since we have moved files to different directory and different server, many Oracle paths are wrong. Beside that many libraries point to invalid place what will prevent Oracle form normal functioning. So this will be fixed with clone.pl script, which is placed in $ORACLE_HOME/clone/bin directory:
Now,
Goto D:\app\oracle\product\11.2.0\clone\dbhome_1\clone\bin\clone.pl
C :\>:perl D:\app\oracle\product\11.2.0\clone\dbhome_1\clone\bin\clone.pl ORACLE_BASE=D:\app\oracle ORACLE_HOME=D:\app\oracle\product\11.2.0\clone\dbhome_1 ORACLE_HOME_NAME=11GR2_HOME
....................................................................................................Dll to load is C:\DOCUME~1\VISHWA~1.RAM\LOCALS~1\Temp\OraInstall2011-06-17_04-39-37PM\Win32RunProcesses.dll
Loading psapi.dll from C:\DOCUME~1\VISHWA~1.RAM\LOCALS~1\Temp\OraInstall2011-06-17_04-39-37PM\psapi.dll
100% Done.
Installation in progress (Friday, June 17, 2011 4:57:27 PM IST)
............................................................................. 77% Done.
Install successful
Setup in progress (Friday, June 17, 2011 4:58:31 PM IST)
Unable to open symbol file D:\app\oracle\product\11.2.0\clone\dbhome_1\dbs\opctrn11.hSetup successful
End of install phases.(Friday, June 17, 2011 5:19:16 PM IST)
Starting to execute configuration assistants
The following configuration assistants have not been run. This can happen because Oracle Universal Installer was invoked with the -noConfig option.
--------------------------------------
The "D:\app\oracle\product\11.2.0\clone\dbhome_1\cfgtoollogs\configToolFailedCommands" script contains all commands that failed, were skipped or were cancelled. This file may be used to run these configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.
The "D:\app\oracle\product\11.2.0\clone\dbhome_1\cfgtoollogs\configToolAllCommands" script contains all commands to be executed by the configuration assistants. This file may be used to run the configuration assistants outside of OUI. Note that you may have to update this script with passwords (if any) before executing the same.
--------------------------------------
The cloning of 11GR2_HOME was successful.
Please check 'C:\Program Files\Oracle\Inventory\logs\cloneActions2011-06-17_04-39-37PM.log' for more details.
How to check that cloning was successful?
Goto C:\Program Files\Oracle\Inventory\ContentsXML\
Open inventory.xml file…
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2009, Oracle. All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>11.2.0.1.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraDb11g_home1" LOC="D:\app\oracle\product\11.2.0\dbhome_1" TYPE="O" IDX="1"/>
<HOME NAME="11GR2_HOME" LOC="D:\app\oracle\product\11.2.0\clone\dbhome_1" TYPE="O" IDX="2"/>
</HOME_LIST>
</INVENTORY>
Above marked text shows that new home with name “11GR2_HOME” has been created.
EnjoyJ