Sunteți pe pagina 1din 2

How to clone the Oracle database software

This note describes the process of cloning an Oracle Home - in this case we are cloning a 11g
Release 2 Oracle Home from source machine SOURCE_HOSTNAME to target machine
TARGET_HOSTNAME.

On source (SOURCE_HOSTNAME)

ORACLE_HOME location is : /u01/app/oracle/product/11.2.0/dbhome_1

Go to directory on source machine one level higher and tar the db_home1 directory and all
sub-directories

SOURCE_HOSTNAME: $ pwd

SOURCE_HOSTNAME: $ /u01/app/oracle/product/11.2.0

SOURCE_HOSTNAME: $ tar -cvf 11gr2.tar dbhome_1

On Target (TARGET_HOSTNAME)

Create the directory /u01/app/oracle/product/11.2.0 if it does not exist

On Source

scp or ftp the tar file to this location on the target machine

SOURCE_HOSTNAME: $ scp -rp 11gr2.tar
oracle@TARGET_HOSTNAME:/u01/app/oracle/product/11.2.0

On target

Uncompress the tar file

TARGET_HOSTNAME: $ cd /u01/app/oracle/product/11.2.0

TARGET_HOSTNAME: $ tar -xvf 11gr2.tar

Clone the Oracle Home using the perl script clone.pl which is located under the
$ORACLE_HOME/clone/bin

TARGET_HOSTNAME: $ cd /u01/app/oracle/product/11.2.0/dbhome_1/clone/bin

TARGET_HOSTNAME: $ perl clone.pl ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_HOME_NAME=11GR2_HOME

Af t er t he i nst al l at i on i t woul d pr ompt you t o r un bel ow scr i pt as r oot :

The f ol l owi ng conf i gur at i on scr i pt s need t o be execut ed as t he " r oot " user .
/ u01/ app/ or acl e/ pr oduct / 11. 2. 0/ dbhome_1/ r oot . sh
To execut e t he conf i gur at i on scr i pt s:
1. Open a t er mi nal wi ndow
2. Log i n as "r oot "
3. Run t he scr i pt s

The cl oni ng of 11GR2_HOME was successf ul .

Run the root.sh script as root

# pwd
/ u01/ app/ or acl e/ pr oduct / 11. 2. 0/ dbhome_1

# ./root.sh

Runni ng Or acl e 11g r oot . sh scr i pt . . .

The f ol l owi ng envi r onment var i abl es ar e set as:
ORACLE_OWNER= or acl e
ORACLE_HOME= / u01/ app/ or acl e/ pr oduct / 11. 2. 0/ dbhome_1
Ent r i es wi l l be added t o t he / var / opt / or acl e/ or at ab f i l e as needed by
Dat abase Conf i gur at i on Assi st ant when a dat abase i s cr eat ed
Fi ni shed r unni ng gener i c par t of r oot . sh scr i pt .
Now pr oduct - speci f i c r oot act i ons wi l l be per f or med.
Fi ni shed pr oduct - speci f i c r oot act i ons.


We can now check that the OraInventory has been updated with the 11g Release 2 Oracle
Home details.

On this machine, earlier there was only a 10g Oracle Home installed. When we check the
contents of the inventory.xml file, we will see that it has information about the 11g Oracle
Home 11GR2_HOME

TARGET_HOSTNAME: $ cat /var/opt/oracle/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=dba

TARGET_HOSTNAME: $cd /u01/app/oracle/oraInventory

TARGET_HOSTNAME: $ ls
backup Cont ent sXML l ogs
or aI nst al l er . pr oper t i es oui
Cont ent s i nst al l . pl at f or m or aI nst . l oc
or ai nst Root . sh sessi onCont ext . se

TARGET_HOSTNAME: $cd ContentsXML

TARGET_HOSTNAME: $ ls
comps. xml i nvent or y. xml l i bs. xml


TARGET_HOSTNAME: $ vi inventory.xml

<?xml ver si on="1. 0" st andal one="yes" ?>
<! - - Copyr i ght ( c) 1999, 2009, Or acl e. Al l r i ght s r eser ved. - - >
<! - - Do not modi f y t he cont ent s of t hi s f i l e by hand. - - >
<I NVENTORY>
<VERSI ON_I NFO>
<SAVED_WI TH>11. 2. 0. 1. 0</ SAVED_WI TH>
<MI NI MUM_VER>2. 1. 0. 6. 0</ MI NI MUM_VER>
</ VERSI ON_I NFO>
<HOME_LI ST>
<HOME NAME="or a1020" LOC="/ u01/ app/ or acl e/ pr oduct / 10. 2. 0" TYPE=" O" I DX="1"/ >
<HOME NAME="11GR2_HOME" LOC="/u01/app/oracle/product/11.2.0/dbhome_1" TYPE=" O" I DX="2" / >
</ HOME_LI ST>
</ I NVENTORY>

S-ar putea să vă placă și