Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

Creating, Cloning, and Deploying an Oracle home Gold Copy

Note that the steps and commands in this section pertain to Oracle10g homes only.

1. Make the initial Oracle home gold copy.  Download the appropriate Oracle
database product, launch the Oracle Universal Installer, and create an Oracle
home.  Do not create a database.  This Oracle home is the original gold copy
version. It is only used for patching and upgrading.
2. Apply all appropriate patches to initial Oracle home gold copy.

To clone or make a new variation of the Oracle home gold copy, perform the following:

1.  Create another gold copy Oracle home.

a)   Navigate to the gold copy Oracle home parent directory.  In our case we will
call this directory /u01/app/oracle/clones.  This directory contains the gold
Oracle homes.  The example gold Oracle home is called 10.2.0.2.jan07.

      cd /u01/app/oracle/clones

b)   Make a CPIO archive of the target gold Oracle home.  Again, the target is a
directory called 10.2.0.2.jan07.  Replace this gold Oracle home directory
reference with yours.  The below CPIO command makes a CPIO file of the
10.2.0.2.jan07 Oracle home.

      find ./10.2.0.2.jan07 -depth | cpio -voB > ./10.2.0.2.jan07.cpio

c)   Make a directory in the /u01/app/oracle/clones directory to unpack the


10.2.0.2.jan07.cpio file created in step b.

      mkdir /u01/app/oracle/clones/tmp

d)   Unpack the 10.2.0.2.jan07.cpio file into the /u01/app/oracle/clones/tmp


directory.  First navigate into the tmp directory and issue a Cpio command. 
The commands are:

      cd /tmp   or cd /u01/app/oracle/clones/tmp

      cpio  -invd < ../10.2.0.2.jan07

e)   Step D created a /u01/app/oracle/clones/tmp/10.2.0.2.jan07 directory.  You


need to rename the 10.2.0.2.jan07 and move it down a directory.  Use this
command:
      mv /u01/app/oracle/clones/tmp/10.2.0.2.jan07
/u01/app/oracle/clones/10.2.0.2.jan07b

f)   Step E creates an unregistered Oracle home locate in


/u01/app/oracle/clones/10.2.0.2.jan07b.  This step registers the new home with
Oracle inventory.  Run these commands:
 
      export ORACLE_HOME=/u01/app/oracle/clones/10.2.0.2.jan07b
      export PATH=${ORACLE_HOME}:${PATH}
      perl $ORACLE_HOME/clone/bin/prepare_clone.pl
      perl $ORACLE_HOME/clone/bin/clone.pl   \
            ORACLE_HOME=/u01/app/oracle/clones/10.2.0.2.jan07b  \
            ORACLE_HOME_NAME=10_2_0_2_jan07b
 
g)   Run /u01/app/oracle/clones/10.2.0.2.jan07b/root.sh. 
 
You now have a cloned, renamed replica of the original Oracle gold copy home
(10.2.0.2.jan07).  If you run Oracle Universal Installer, you will see that the clone is
registered.  You can now add patches to this home without affecting the original gold
home.  After patching, you may want to create a CPIO archive, compress the archive, and
delete the actual Oracle home.  This will save space.  The CPIO’d gold copy can be
restored at any point for further cloning and moved to other servers for use.  You might
note that all of the work was done remotely and does not affect an operating database.
 
To move a gold copy Oracle home to another location, perform the following: 

1.   Create a compressed CPIO archive of the Oracle home gold copy (Steps A and B
above)

2.  FTP the compressed CPIO archive to the new server.  Place the file in the Oracle
homes parent directory (i.e. /u01/app/oracle/product). 

3.   Uncompress and unpack the CPIO gold copy version:

      Uncompress 10.2.0.2.jan07b.cpio.Z

             cpio -imvd < 10.2.0.2.jan07b.cpio


 
4.   Register the database with Oracle Inventory.  Perform Step e.   If this is the first
Oracle Home on the server, you must install an Oracle home with Universal
Installer before trying to register the cloned Oracle home.  This will create the
inventory.  You can delete the home after creation and use the clone.

 
5.   At this point, the cloned Oracle home is ready to support a database.  You can
install a new database for the Oracle home by running Oracle Database
Configuration Agent or point an existing database to the new Oracle home.  The
following steps can be used to point an existing database to the new Oracle home.

a.  Modify the environment file (inst.ksh) so that the environment will point to the
new Oracle home.

b.  Modify the listener file (listener.ora) to point to the new Oracle home.

c.  Modify the Etc/oratab file

d.  Shutdown the database.  Change the environment to the new Oracle home and
reload the listener.

e.  Move the old database’s pfile/spfile to the location used by the new Oracle
home.

f.  Start the database

g.  If this Oracle home is a patched version run Catcpu.sql.

h.  Create a new password file

i.   Check out the upgraded database.

In this article I discussed the benefits of using a gold copy Oracle home and cloning in
place of patching an Oracle home in place.  You will find that this practice reduces the
patching complexities, risk, and time.  Using a cloned gold copy will also result in less
outage time.  Cloning can be done through Oracle Enterprise Manager Grid Control.  If
this tool is unavailable, the article describes a set of simple commands that will enable
you to create and deploy cloned Oracle homes.  I believe that employment of the
techniques discussed in this article will make you life as a DBA easier.

You might also like