Wednesday, May 2, 2012

How to clone an Oracle Home 11gr2

How do you clone an Oracle home manually
Well here is an example

The source is running on server scca5003
The target server is th spca5003
Both the oracle home are named /oracle/home/11.2.0.1 and must by 15 gyg

On the source server scca5003:

$ cd /oracle/home
make a tar file of the 11.2.0.1 directory

$ tar -cvf /oracle/home/11gr2 11.2.0.1

then copy the tar file to the target server spca5003. I've used sftp
$ sftp spca5003

Connecting to spca5003...
oracle@spca5003's password:
sftp> pwd
Remote working directory: /oracle
sftp> cd home
sftp> pwd
Remote working directory: /oracle/home
sftp> put 11gr2.tar
Uploading 11gr2.tar to /oracle/home/exp/11gr2.tar
                  11gr2.tar                                                  100% 6428MB  23.7MB/s   04:31

Logon to the source server spca5003 and do the following:
$ cd /oracle/home
$ tar -xvf 11gr2.tar

After that start clone.pl
$ cd /oracle/home/11.2.0.1.0/clone/bin
$ perl clone.pl ORACLE_BASE=/oracle/home ORACLE_HOME=/oracle/home/11.2.0.1.0  ORACLE_HOME_NAME=oradb11g_home

read the logfile if everything went oke
                 ./runInstaller -clone -waitForCompletion  "ORACLE_BASE=/oracle/home" "ORACLE_HOME=/oracle/home/11.2.0.1.0" "ORACLE_HOME_NAME=OraDb11g_home1" -silent -noConfig -nowait
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 13044 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-06-28_12-19-47PM. 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:
 /oracle/home/oraInventory/logs/cloneActions2011-03-03_12-19-47PM.log
.................................................................................................... 100% Done.



Installation in progress (Wednesday, March 03, 2011 12:20:29 PM WST)
..............................................................................                                                  78% Done.
Install successful

Linking in progress (Wednesday, March 03, 2011 12:21:06 PM WST)
Link successful

Setup in progress (Wednesday, March 03, 2011 12:23:34 PM WST)
Setup successful

End of install phases.(Wednesday, March 03, 2011 12:34:05 PM WST)
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 "/oracle/home/11.2.0.1.0/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 "/oracle/home/11.2.0.1.0/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.

--------------------------------------
WARNING:
The following configuration scripts need to be executed as the "root" user.
/oracle/home/11.2.0.1.0/root.sh
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts

The cloning of OraDb11g_home1 was successful.
Please check '/oracle/home/oraInventory/logs/cloneActions2010-06-28_12-19-47PM.log' for more details.

Run the root script
$ cd /oracle/home/11.2.0.1.0
$./root.sh

check the logfile in /oracle/home/11.2.0.1.0/install
$ cat /oracle/home/11.2.0.1.0/install/root_spca5003_2010-06-29_07-42-31.log

Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /oracle/home/11.2.0.1.0
Entries will be added to the /etc/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.
     Finished product-specific root actions
On the target server spca5003 check the oraInventory
$ cat /etc/oraInst.loc
inventory_loc=/oracle/home/oraInventory
                        inst_group=dba

Check the contents of the inventory.xml. There must be an11gr2 entry
$ cd /oracle/home//oraInventory
$ cd /ContentsXML
$ vi inventory.xml
<?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_LIST>
<HOME NAME="OH_10203" LOC="/oracle/home/10.2.0.3.0" TYPE="O" IDX="1"/>
<HOME NAME="agent10g" LOC="/oracle/home/agent10g" TYPE="O" IDX="2"/>
<HOME NAME="OH_10204" LOC="/oracle/home/10.2.0.4.0" TYPE="O" IDX="4"/>
<HOME NAME="OracleHome1" LOC="/oracle/app/oracle/product/10.2.0.2.0" TYPE="O" IDX="5"/>
<HOME NAME="OraDb11g_home1" LOC="/oracle/home/11.2.0.1.0" TYPE="O" IDX="6"/>
<HOME NAME="APPSDB_AMI401C" LOC="/oracle/home/apps11ic/db10g" TYPE="O" IDX="3" REMOVED="T"/>
</HOME_LIST>
          </INVENTORY


Now your ready to create Oracle 11gr2 database on the target server

No comments:

Post a Comment