Cloning the Oracle instance using dbed_clonedb

You have the option to manually or automatically recover the database when using the dbed_clonedb command:

Before cloning the Oracle instance, review the following information:

Prerequisites

  • You must first create a Storage Checkpoint.

    See Creating Storage Checkpoints using dbed_ckptcreate.

  • You must be logged in as the database administrator.

  • Make sure you have enough space and system resources to create a clone database on your system.

  • A clone database takes up as much memory and machine resources as the primary database.

Usage notes

  • In an Oracle RAC environment, cloning an Oracle database with an instant Storage Checkpoint is not supported.

  • The dbed_clonedb command is used to create a copy of a database, cloning all existing database files to new locations.

  • The ORACLE_SID and ORACLE_HOME environment variables must be set to the primary database.

  • It is assumed that the user has a basic understanding of the database recovery process.

  • See the dbed_clonedb(1M) manual page for more information.

Table: dbed_clonedb command options lists the options for cloning the Oracle database.

Table: dbed_clonedb command options

Option

Description

-S CLONE_SID

Specifies the name of the new Oracle SID, which will be the name of the new database instance.

-m MOUNT_POINT

Indicates the new mount point of the Storage Checkpoint.

-c CKPT_NAME

Indicates the name of the Storage Checkpoint.

-i

Runs the command in interactive mode where you must respond to prompts by the system. The default mode is non-interactive. (Optional)

-o umount

Shuts down the clone database and unmounts the Storage Checkpoint file system.

-o restartdb

Mounts the Storage Checkpoint file system and starts the clone database. The -o restartdb option will not attempt to recover the clone database.

-d

Used with the -o umount option. If the -d option is specified, the Storage Checkpoint used to create the clone database will be removed along with the clone database.

-p pfile_modification_file

Specifies a file containing initialization parameters to be modified or added to the clone database's initialization parameter file prior to startup. The format is the same as the Oracle initialization parameter file.

To clone an Oracle instance with manual Oracle recovery

Primary Oracle SID is FLAS11r1
New Oracle SID is test2cln
Cloning an online Storage Checkpoint Checkpoint_1239013340.
Mounting Checkpoint_1239013340 at /tmp/test2cln.
All redo-log files found.
Creating inittest2cln.ora from /tmp/vxdba.rel.tmp.27511/initFLAS11r1.ora.
Altering db_name parameter in inittest2cln.ora.
Editing remote_login_passwordfile in inittest2cln.ora.
Altering control file locations in inittest2cln.ora.
Copying inittest2cln.ora to /oracle/11gr1/dbs/inittest2cln.ora.
About to start up new database and begin reconfiguration.
Database test2cln is being reconfigured.
Did not see error regarding database name.
Altering clone database archive log directory.
Updating log_archive_dest in clone database init file.
Found archive log destination at /snap_arch11r1/FLAS11r1.
The latest archive log(s) must now be applied. To apply
the logs, open a new window and perform the following steps:
1. You must copy required archive log(s) from primary to clone:
   Primary archive logs in /snap_arch11r1/FLAS11r1
   Clone archive logs expected in /tmp/test2cln/snap_arch11r1/FLAS11r1.
2. ORACLE_SID=test2cln; export ORACLE_SID # sh and ksh, OR
   setenv ORACLE_SID test2cln #csh
3. /oracle/11gr1/bin/sqlplus /nolog
4. CONNECT / AS SYSDBA
5. RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE
6. enter the archive log(s) you would like to apply
7. EXIT
Press <Return> after you have completed the above steps

To clone an Oracle instance with automatic Oracle recovery

Primary Oracle SID is FLAS11r1
New Oracle SID is test1cln
Cloning an online Storage Checkpoint Checkpoint_1239012493.
Mounting Checkpoint_1239012493 at /tmp/test1cln.
All redo-log files found.
Creating inittest1cln.ora from /tmp/vxdba.rel.tmp.25063\
/initFLAS11r1.ora.
Altering db_name parameter in inittest1cln.ora.
Editing remote_login_passwordfile in inittest1cln.ora.
Altering control file locations in inittest1cln.ora.
Copying inittest1cln.ora to /oracle/11gr1/dbs/inittest1cln.ora.
About to start up new database and begin reconfiguration.
Database test1cln is being reconfigured.
Did not see error regarding database name.
Starting automatic database recovery.
Shutting down clone database.
Altering clone database archive log directory.
Updating log_archive_dest in clone database init file.
Found archive log destination at /snap_arch11r1/FLAS11r1.
Mounting clone database.
Resetting logs on new database test1cln.
The sql script for adding tempfiles to test1cln is at \
/tmp/add_tf.test1cln.sql.
Database instance test1cln is up and running.

To shut down the clone database and unmount the Storage Checkpoint

To mount a Storage Checkpoint file system and start the clone database

To delete a clone database and the Storage Checkpoint used to create it