You can use the dbed_clonedb command to clone an Oracle instance using a Storage Checkpoint.
Cloning an existing database using a Storage Checkpoint must be done on the same host.
You have the option to manually or automatically recover the database when using the dbed_clonedb command:
Manual (interactive) recovery, which requires using the -i option, of the clone database allows the user to control the degree of recovery by specifying which archive log files are to be replayed.
Automatic (non-interactive) recovery, which is the default usage of the command, recovers the entire database and replays all of the archive logs. You will not be prompted for any archive log names.
Before cloning the Oracle instance, the following conditions must be met:
Table: dbed_clonedb command options lists the options for the dbed_clonedb command.
Table: dbed_clonedb command options
To clone an Oracle instance with manual Oracle recovery
Use the dbed_clonedb command as follows:
$ /opt/VRTS/bin/dbed_clonedb -S new1 -m /tmp/new1 \ -c Checkpoint_1249624009 -i Primary Oracle SID is FLAS11r1 New Oracle SID is new1 Cloning an online Storage Checkpoint Checkpoint_1249624009. Mounting Checkpoint_1249624009 at /tmp/new1. All redo-log files found. Creating initnew1.ora from /tmp/vxdba.rel.tmp.28185/initFLAS11r1.ora. Altering db_name parameter in initnew1.ora. Editing remote_login_passwordfile in initnew1.ora. Altering control file locations in initnew1.ora. Copying initnew1.ora to /oracle/11gr1/dbs/initnew1.ora. About to start up new database and begin reconfiguration. Database new1 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/new1/snap_arch11r1/FLAS11r1. 2. ORACLE_SID=new1; export ORACLE_SID # sh and ksh, OR setenv ORACLE_SID new1 #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. <Return> Resetting logs on new database NEW1 Database instance NEW1 is up and running
To clone an Oracle instance with automatic Oracle recovery
Use the dbed_clonedb command as follows:
$/opt/VRTS/bin/dbed_clonedb -S new2 -m /tmp/new2 \ -c Checkpoint_1249624426 Primary Oracle SID is FLAS11r1 New Oracle SID is new2 Cloning an online Storage Checkpoint Checkpoint_1249624426. Mounting Checkpoint_1249624426 at /tmp/new2. All redo-log files found. Creating initnew2.ora from /tmp/vxdba.rel.tmp.30929/initFLAS11r1.ora. Altering db_name parameter in initnew2.ora. Editing remote_login_passwordfile in initnew2.ora. Altering control file locations in initnew2.ora. Copying initnew2.ora to /oracle/11gr1/dbs/initnew2.ora. About to start up new database and begin reconfiguration. Database new2 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 new2. The sql script for adding tempfiles to new2 is at /tmp/add_tf.new2.sql. Database instance new2 is up and running.
More Information