Saturday, October 29, 2011

Cloning Existing Oracle home (RDBMS) using clone.pl or runInstaller


we have a server which runs two Oracle databases on 10203 release on Linux. We had a plan to upgrade only one database on server to 10205 and keep the other database in the same version (10203) on the server

I have document the process of clone, i hope this will be useful.

STEP#1
Before starting the upgrade, we have to clone the ORACLE_HOME for the existing database to continue running on the same version.
MY EXISTING ORACLE_HOME è /oracle/BHUVAN/10203
MY NEW ORACLE_HOME è /oracle/BHUVAN/10205

STEP#2
Before starting the copy process, we have to stop all databases, listeners(all oracle products) that are running from the source home.

Once all oracle process are stopped, we can perform the copy
$ cd /oracle/BHUVAN/10203
$ tar -cvf /tmp/source_1023.tar .

Since I am restoring in the same server, I didn’t move the tar file. If you are moving to a different server then you have use the binary option for transferring the tar file.
$ cd /oracle/BHUVAN/10205
$ tar -xvf /tmp/source_1023.tar


STEP#3

We are perform the clone using two methods
1) Clone.pl
2) Using runInstaller option.

I have performed through runInstaller, but I am specifying the example of cloning using the clone.pl. When you want use the clone.pl, we should have the Perl installed on our Local server. You can check by issuing
$ perl -v

When you perform the runInstaller method, we don’t require any display or any DB console. In end of the clone setup process, oracle will ask us to run the root.sh from the root user.

Note: we don’t need to do the relink using both options.
EX CLONE.PL METHOD

oracle[BHUVAN]> perl $ORACLE_HOME/clone/bin/clone.pl ORACLE_HOME="/oracle/BHUVAN/10205" ORACLE_HOME_NAME="ORA_1205_HOME"

EX RUNINSTALLER METHOD

oracle[BHUVAN]> ./runInstaller -silent -clone -waitForCompletion  "ORACLE_HOME=/oracle/BHUVAN/10205" "ORACLE_HOME_NAME=ORA_1205_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/OraInstall2011-10-02_10-11-03AM. 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:
 /oracle/BHUVAN/oraInventory/logs/cloneActions2011-10-02_10-11-03AM.log
.................................................................................................... 100% Done.



Installation in progress (Sun Oct 02 10:11:34 BST 2011)
.................................................................................                                               81% Done.
Install successful

Linking in progress (Sun Oct 02 10:11:50 BST 2011)
Link successful

Setup in progress (Sun Oct 02 10:17:49 BST 2011)
Setup successful

End of install phases.(Sun Oct 02 10:17:57 BST 2011)
WARNING:
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/oracle/BHUVAN/10205/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts

The cloning of CLONE_HOME was successful.
Please check '/oracle/BHUVAN/oraInventory/logs/cloneActions2011-10-02_10-11-03AM.log' for more details.
STEP#4 (it is optionally only)

Once we complete the process, we can run the ChangePerm.sh to set the proper permission.

$ORACLE_HOME/install/changePerm.sh

STEP#5

Once the Entire clone process completed, we should move the spfile or pfile, tnsnames.ora, listener.ora to the new ORACLE_HOME for the database.

Happy Learning!!!!!!!!!!!!

No comments:

Post a Comment