Friday, September 10, 2010

Cloning Oracle Homes

Oracle Homes could be cloned with either $ORACLE_HOME/clone/bin/clone.pl or $ORACLE_HOME/oui/bin/runInstaller.

Using clone.pl

1. Run prepare_clone.pl on the source oracle home before it's copied to destination and tar the source oracle home and copy to destination.

2. Extract the oracle home at the destination server.

3. set ORACLE_BASE and ORACLE_HOME variables (not necessary) and run the clone.pl
perl clone.pl ORACLE_HOME=/opt/app/oracle/product/10.2.0/ent ORACLE_HOME_NAME=10ghome
./runInstaller -silent -clone -waitForCompletion  "ORACLE_HOME=/opt/app/oracle/product/10.2.0/ent" "ORACLE_HOME_NAME=10ghome" -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/OraInstall2010-09-10_10-41-16AM. Please wait ...Oracle Universal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.

SEVERE:1. OUI-10035:You do not have permission to write to the inventory location.
OR
2. OUI-10033:The inventory location /opt/app/oraInventory set by the previous installation session is no longer accessible. Do you still want to continue by creating a new inventory? Note that you may lose the products installed in the earlier session.
SEVERE:OUI-10180:Either a component of the path prefix or the file referred to by path does not exist or is a null pathname.
As shown in the inventory creation post when oracle base is set the inventory location deviate from default 10g inventory position. To fix the problem oraInventory directory could be pre-created or ORACLE_BASE could be unset, in the second case oraInventory will be created in /home/oracle.

3. After fixing the issue with oraInventory run the command again
unset ORACLE_BASE
unset ORACLE_HOME
perl clone.pl ORACLE_HOME=/opt/app/oracle/product/10.2.0/ent ORACLE_HOME_NAME=10ghome
./runInstaller -silent -clone -waitForCompletion  "ORACLE_HOME=/opt/app/oracle/product/10.2.0/ent" "ORACLE_HOME_NAME=10ghome" -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/OraInstall2010-09-10_10-43-12AM. Please wait ...Oracle Universal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.

You can find a log of this install session at:
/home/oracle/oraInventory/logs/cloneActions2010-09-10_10-43-12AM.log
.................................................................................................... 100% Done.

Installation in progress (Friday, September 10, 2010 10:43:28 AM BST)
...........................................................................                                                     75% Done.
Install successful

Linking in progress (Friday, September 10, 2010 10:43:39 AM BST)
Link successful

Setup in progress (Friday, September 10, 2010 10:44:17 AM BST)
Setup successful

End of install phases.(Friday, September 10, 2010 10:44:21 AM BST)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/home/oracle/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/home/oracle/oraInventory/orainstRoot.sh
/opt/app/oracle/product/10.2.0/ent/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts

The cloning of 10ghome was successful.
Please check '/home/oracle/oraInventory/logs/cloneActions2010-09-10_10-43-12AM.log' for more details.
oraInst.loc would have been created inside oraInventory (this is linux x86_64) instead of in /etc


Using runInstaller

1. Step 1,2 are same as above.

2. Run the runInstaller command from $ORACLE_HOME/oui/bin
./runInstaller -silent -clone ORACLE_HOME=/opt/app/oracle/product/10.2.0/ent ORACLE_HOME_NAME="10g2home1"
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/OraInstall2010-09-10_11-49-48AM. Please wait ...
Oracle Universal Installer, Version 10.2.0.5.0 Production
Copyright (C) 1999, 2010, Oracle. All rights reserved.

You can find a log of this install session at:
/home/oracle/oraInventory/logs/cloneActions2010-09-10_11-49-48AM.log
.................................................................................................... 100% Done.

Installation in progress (Friday, September 10, 2010 11:50:05 AM BST)
...........................................................................                                                     75% Done.
Install successful

Linking in progress (Friday, September 10, 2010 11:50:15 AM BST)
Link successful

Setup in progress (Friday, September 10, 2010 11:50:55 AM BST)
Setup successful

End of install phases.(Friday, September 10, 2010 11:50:59 AM BST)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/home/oracle/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/home/oracle/oraInventory/orainstRoot.sh
/opt/app/oracle/product/10.2.0/ent/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts

The cloning of 10g2home1 was successful.
Please check '/home/oracle/oraInventory/logs/cloneActions2010-09-10_11-49-48AM.log' for more details.
Same as before oraInst.loc is inside oraInventory not in /etc.

On 11gR1 and 11gR2 ORACLE_BASE must also be specified in the command line if not cloning will fail.
./runInstaller -silent -clone ORACLE_HOME=/opt/app/oracle/product/11.2.0/ent ORACLE_HOME_NAME="11g2home1"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 16002 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-09-10_11-07-10AM. Please wait ...
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-09-10_11-07-10AM.log
Values for the following variables could not be obtained from the command line or response file(s):
ORACLE_BASE
Cloning cannot continue.
This is same even if clone.pl was used
perl clone.pl ORACLE_HOME=/opt/app/oracle/product/11.2.0/ent ORACLE_HOME_NAME="11g2home1"
ERROR: Invalid Oracle Base specified. Aborting the clone operation. 
Once oracle base is specified cloning will suceed.
./runInstaller -silent -clone ORACLE_HOME=/opt/app/oracle/product/11.2.0/ent ORACLE_HOME_NAME="11g2home1" ORACLE_BASE=/opt/app/oracle
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 16002 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-09-10_12-12-04PM. Please wait ...
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-09-10_12-12-04PM.log
.................................................................................................... 100% Done.

Installation in progress (Friday, September 10, 2010 12:12:14 PM BST)
.............................................................................                                                   77% Done.
Install successful

Linking in progress (Friday, September 10, 2010 12:12:20 PM BST)
Link successful

Setup in progress (Friday, September 10, 2010 12:12:51 PM BST)
Setup successful

End of install phases.(Friday, September 10, 2010 12:13:38 PM BST)
Starting to execute configuration assistants
Configuration assistant "Oracle Configuration Manager Clone" succeeded
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/home/oracle/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts need to be executed as the "root" user.
/home/oracle/oraInventory/orainstRoot.sh
/opt/app/oracle/product/11.2.0/ent/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts

The cloning of 11g2home1 was successful.
Please check '/home/oracle/oraInventory/logs/cloneActions2010-09-10_12-12-04PM.log' for more details.