Skip Headers

Oracle9 Database Certified Configuration Installation Guide
Release 2 (9.2.0.3) for Linux Intel
Part No. B10925-01
Go To Table Of Contents
Contents
Go To Index
Index

Previous Next

3 Cloning

This chapter describes the steps to clone an Oracle9i Database Certified Configuration instance, and configure Oracle services for the new instance. This chapter contains the following topics:

3.1 Cloning Overview

Cloning refers to the ability to copy and restore a database image, and to set up a database image as a new instance. The new instance can reside on the same system as the original database, or on a different system.

There are two methods for cloning, cold cloning and hot cloning. Cold cloning does not require database recovery because the source database is shut down normally before the image is created. Hot cloning does not include the database. The database is recovered from the hot backup of the database, backup control files and archive logs.

The cloning process supports both single-instance and Real Application Clusters environments. The cloning process uses the dbcc_image.sh script and reconfig.sh scripts.

The cloning utility does not include application migration. It does not migrate or clone installed user applications to another system. It only copies those portions of the applications that reside in the Oracle directories.


Note:

The cloning process does not support datafiles in raw volumes.

3.2 Single-instance Cloning

The following procedures describe the single-instance cloning process. If the hot cloning method is used, then enable archiving before starting the cloning process.

  1. Log in as the ordbname user.

  2. Back up the control files to a trace file using the following command:

    /admin/dbcc/3.1.0/ref_config/bkupcontrol2trc.sh -single
    
    

    The script will generate the trace gen_controlfile_DBNAME.trc file, and put it under the /admin/dbcc/3.1.0/ref_config/work directory.

    • If using the cold cloning method, then shut down the source database.

    • If using the hot cloning method, then perform a redo-log switch, and put the database in backup mode.

  3. Log in as the root user.

  4. Create an image of the source database using one of the following commands.

    • For cold cloning method:

      /admin/dbcc/3.1.0/install/dbcc_image .sh -create -single -dbname \
      
      SOURCEDBNAME -imagefile GOLDIMAGE -includedb
      
      

      In the preceding command, SOURCENAME is the name of the source database, and IMAGEFILE is the name of the new image.

    • For hot cloning method:

      /admin/dbcc/3.1.0/install/dbcc_image .sh -create  -single  \
      
      -dbname SOURCEDBNAME  -imagefile GOLDIMAGE  -includeconfig
      
      

      In the preceding command, SOURCENAME is the name of the source database, and IMAGEFILE is the name of the new image.

  5. Restore the image to the new target location using the following command:

    /admin/dbcc/3.1.0/install/dbcc_image.sh  -restore -single \
    
    -dbname CLONEDBNAME  -includedb -imagefile GOLDIMAGE 
    
    

    In the preceding command, CLONEDBNAME is the name of the cloned database.

  6. Log in as the ordbname user of the dbdbname group using the destination database name for dbname.

  7. Set the following environment variables:

    • SRC_CC_DBNAME. Enter the source database name or SID.

    • DST_CC_DBNAME. Enter the new database name or SID.

    • SRC_CC_HOSTNAME. Enter the host name of the source, as specified in the listener.ora file.

    • DST_CC_HOSTNAME. Enter the new host name.

    • SRC_CC_LISTENER_PORT. Enter listener port number of the source database.

    • DST_CC_LISTENER_PORT. Enter the desired listener port number.

    In the preceding variables, SRC is for source, and DST is for destination.

  8. Reconfigure the restored image using one of the following commands.

    • For cold cloning method:

      /admin/dbcc/3.1.0/ref_config/reconfig.sh -single
      
      
    • For hot cloning method:

      Restore the backup database datafiles along with archive logs, then run the following command:

      /admin/dbcc/3.1.0/ref_config/reconfig.sh -single recoverdb
      
      

      In the preceding command, the -recoverdb option allows the script to perform recovery using the backup control files. The script also renames the database. A complete hot backup is required. No scripts are available with Oracle9i Database Certified Configuration to create hot backups or to restore them. It is expected the users will use their preferred method for backup and restore procedures.

3.3 Real Application Clusters Cloning

Only cold cloning is supported for Real Application Clusters. In addition, Real Application Clusters cloning is not supported if data exists in raw volumes. The following procedures describe the Real Application Clusters cloning process.

  1. Log in as the ordbname user.

  2. Back up the control files to a trace file using the following command:

    /admin/dbcc/3.0.0/ref_config/bkupcontrol2trc.sh -rac
    
    

    The script will generate the trace gen_controlfile_DBNAME.trc.rac file, and put it under the /admin/dbcc/3.1.0/ref_config/work directory.

  3. Shut down the source database.

  4. Create an image of the source database using the following command. This is one to be cloned in this procedure.

    /admin/dbcc/3.1.0/install/dbcc_image.sh  -create -rac \
    
    -dbname SOURCEDBNAME -imagefile GOLDIMAGE -includedb 
    
    
  5. Ensure that the cluster manager has been installed and configured on the nodes. If cluster manager has not been installed and configured, then perform steps 1 through 5 in "Real Application Clusters Installation" in Chapter 2, " Installation " of this guide.

  6. Log in as the root user.

  7. Restore the image in the target location using the following command:

    /admin/dbcc/3.1.0/install/dbcc_image.sh  -restore -rac  -dbname  \
    
    CLONEDBNAME  -includedb -imagefile GOLDIMAGE 
    
    
  8. Log in as the ordbname user of the dbdbname group using the destination database name for dbname.

  9. Set the following environment variables:

    • SRC_CC_DBNAME. Enter the source database name which is the SID without the instance number.

    • DST_CC_DBNAME. Enter the desired database name.

    In the preceding variables, SRC is for source, and DST is for destination.

  10. Set up .rhosts access for the ordbname user for all private interconnects in the cluster.

  11. Reconfigure the restored image using the following command:

    /admin/dbcc/3.1.0/ref_config/reconfig.sh -rac
    
    


Previous Next
Oracle Logo
Copyright © 2002, 2003 Oracle Corporation

All rights reserved
Go To Table Of Contents
Contents
Go To Index
Index