Skip Headers

Oracle9i Database Certified Configuration Installation Guide
Release 2 (9.2.0.2) for Solaris Operating Environment (SPARC 64-bit)
Part No. B12103-02
  Go To Table Of Contents
Contents
Go To Index
Index

Previous Next  

3 Cloning

This chapter describes cloning an Oracle9i Database Certified Configuration instance, and configuring Oracle services for the new instance. This chapter contains the following topics:

Cloning Overview

Cloning is 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 databases. The cloning process uses the dbcc_image.sh 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.

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 -includeconfig
    
    

    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.

Real Application Clusters Cloning

Only Oracle binary cloning without database is supported for Real Application Clusters. The following procedures describe the Real Application Clusters cloning process.

  1. Log in as the ordbname user.

  2. Shut down the source database.

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

    /admin/dbcc/3.1.0/install/dbcc_image.sh  -create -rac \
    -dbname SOURCEDBNAME -imagefile GOLDIMAGE 
    
    
  4. Log in as the root user.

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

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

To create a seed database and configure Oracle, use the procedure described in "Setting Up for Real Application Clusters Configuration" and "Configuring Real Application Clusters".