Cloning Oracle AS10g

This post is about cloning an Oracle Application Server 10g R3. This was based on one of our requirement to clone AS10g instance. I have carried out those steps and sharing the same. Our instance was a simple J2EE & Webcache installation.

Release we used was oracle AS 10g R3 (10.1.3.3).

Cloning AS10g instance (only mid tier) consists of following simple steps

  1. Pre-Cloning
  2. Cloning
  3. Post-Cloning

Pre-Cloning Steps:

At the source, you run the script called prepare_clone.pl. This is a Perl script that prepares the source for cloning. It takes a snapshot of the information required for cloning.

During this phase, prepare_clone.pl parses files in the source Oracle home to extract and store required values and backs up required files.

Then, you tar the Oracle home directories.

Example in our case:

-bash-3.00$ $ORACLE_HOME/perl/bin/perl prepare_clone.pl ORACLE_HOME=$ORACLE_HOME
Can’t locate English.pm in @INC (@INC contains: /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/5.8.3/i686-linux-thread-multi /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/5.8.3 /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/site_perl/5.8.3/i686-linux-thread-multi /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/site_perl/5.8.3 /ade/smayer_perl58_main_linux/perl58/bin/Linux/Opt/lib/site_perl .) at prepare_clone.pl line 59.
BEGIN failed–compilation aborted at prepare_clone.pl line 59.

-bash-3.00$ export PERL5LIB=$ORACLE_HOME/perl/lib/5.8.3/i686-linux-thread-multi:$ORACLE_HOME/perl/lib/5.8.3:$ORACLE_HOME/perl/lib/site_perl/5.8.3/i686-linux-thread-multi/
-bash-3.00$ $ORACLE_HOME/perl/bin/perl prepare_clone.pl ORACLE_HOME=$ORACLE_HOME

Clone log file location: /slot/ems2261/oracle/product/10.1.3/OracleAS_1/clone/logs/clone1219226546.log
Error log file location: /slot/ems2261/oracle/product/10.1.3/OracleAS_1/clone/logs/error1219226546.log
Wed Aug 20 03:02:26 2008  INFO: Starting with the Prepare Clone operation at the source
Wed Aug 20 03:02:26 2008  INFO: The temp directory being used is /tmp
Wed Aug 20 03:02:26 2008  INFO: The prepare clone operation completed successfully.

Once Pre-Cloning is done, you can tar the complete software installation file and ftp the same to target host.

Cloning:

Cloning step is to be done on target host. You can untar the tar file you created and FTPed to target host. Then you need run clone.pl on target side.

On the target host, you might face a problem regarding the inventory. If /etc/oraInst.loc file is pointing to some inventory and you dont have permission to that inventory then it will throw the error.

-bash-3.00$ perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_HOME=/slot/ems2599/oracle/product/10.1.3/OracleAS_1 -invPtrLoc $HOME/oraInst.loc ORACLE_HOME_NAME=ias_oracle_home -instance OAS -oc4jadmin_old_password dmtra123 -oc4jadmin_new_password dmtra123 -silent
.

.

.

Tue Aug 19 05:05:59 2008  INFO: backing up the dms.conf for instances.
Tue Aug 19 05:05:59 2008  INFO: backing up the httpd.conf for instances.
Tue Aug 19 05:05:59 2008  INFO: backing up the oracle_apache.conf for instances.
Tue Aug 19 05:05:59 2008  INFO: backing up the mod_oc4j.conf for instances.
Tue Aug 19 05:05:59 2008  INFO: backing up the ssl.conf for instances.
Tue Aug 19 05:05:59 2008  INFO: Done with the PreClone operation
You do not have sufficient permissions to access the inventory ‘/slot/ems2400/oracle/oraInventory’. Installation cannot continue. Make sure that you have read/write permissions to the inventory
directory and restart the installer.: Permission denied
Tue Aug 19 05:06:00 2008  INFO: Starting Oracle Universal Installer…

Tue Aug 19 05:06:00 2008  INFO: No pre-requisite checks found in oraparam.ini, no system pre-requ
Tue Aug 19 05:06:00 2008  ERROR: Error occured invoking OUI in the clone mode. Exiting with error
code 65280
Tue Aug 19 05:06:00 2008  ERROR: ………………..(START) Printing contents of file /tmp/silen
tInstall.log………………..
Tue Aug 19 05:06:00 2008  ERROR: ………………..(END) Printing contents of file /tmp/silentI
nstall.log………………..

In this case you need to set the local inventory before stating the cloning. This can be done by editing the file cs.properties present in ORACLE_HOME/clone/ias/config location.

In cs.properties, you will find a line clone_command_line= -silent

Append -invptrloc <Local path for oraInst.loc>

Example:

clone_command_line= -silent -invptrloc /slot/ems2599/oracle/oraInst.loc

Once this is done, save the file and run the above clone command again.

perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_HOME=/slot/ems2599/oracle/product/10.1.3/OracleAS_1 ORACLE_HOME_NAME=ias_oracle_home -instance dmntra4Pro -oc4jadmin_old_password dmtra123 -oc4jadmin_new_password dmtra123
.

.

.

Wed Aug 20 00:13:26 2008  INFO: Final Status:
Wed Aug 20 00:13:26 2008  INFO: ==============
Wed Aug 20 00:13:26 2008  INFO: The clone operation completed successfully.

This completes the clone for AS10g.

Post-Cloning:

The postinstallation configuration assistants are not designed to be run again at clone time. Consequently, some of the instance-specific configuration files that should be updated by the configuration assistants are not updated at the end of the Oracle Universal Installer cloning session. Instead, Oracle has created a set of post-cloning scripts that update those files to bring the cloned home to a working state.

For more detail refer to Oracle Documentation on Post cloning steps

Hope this helps !!

References:

Oracle Documentation