Oracle8i Recovery Manager User's Guide and Reference
Release 2 (8.1.6)

Part Number A76990-01





Go to previous page Go to beginning of chapter Go to next page

Recovery Manager Command Syntax, 24 of 50





To use backups of the target database to create a duplicate database. A duplicate database provides a safe environment for testing backup and recovery procedures.

When duplicating a database that is currently in NOARCHIVELOG mode, recovery occurs using the noredo option. Hence, if incremental backups exist, RMAN applies only these backups to the restored files during recovery. For databases in ARCHIVELOG mode, duplicate recovers by default up to the last archived redo log generated at the time the command was executed--unless the set until clause is specified, in which case recovery is bounded by the parameter settings.

See Also:

Chapter 7, "Creating a Duplicate Database with Recovery Manager" to learn how to duplicate a database. 


Keywords and Parameters


specifies the name of the duplicate database. You must specify the database name because the new database is started but not mounted, so the database name cannot be obtained. The name should match the name in the init.ora file of the duplicate database or Oracle will signal an error when creating the control file.

Note: You can use the same database name for the target and duplicate databases since RMAN generates a new DBID for the duplicate database. 

logfile logSpec 

specifies the online redo logs. The syntax is the same used in the LOGFILE option of the CREATE DATABASE statement.

If you do not specify the logfile clause, then RMAN uses LOG_FILE_NAME_CONVERT if it is set. If neither logfile nor LOG_FILE_NAME_CONVERT is specified, RMAN uses the original target redo log filenames for the duplicate files. You must use the nofilenamecheck option in this case.

See Also: Oracle8i SQL Reference for more about the CREATE DATABASE statement. 



specifies the filename of the online redo log. 


size integer 

specifies the size of the file in kilobytes (K) or megabytes (M). If you omit this parameter, the file must already exist. 



allows Oracle to reuse an existing file. If the file already exists, Oracle verifies that its size matches the value of the size parameter. If the file does not exist, Oracle creates it. If you omit the size parameter, the file must already exist.

The reuse option is significant only when used in conjunction with the size parameter. If you omit the size parameter, Oracle expects the file to exist already. 


group integer ('filename', ... ) 

specifies a redo log group containing one or more members. Each filename specified within the parentheses indicates a member of the group. 


prevents RMAN from checking whether target datafiles sharing the same names as the duplicated files are in use. The user is responsible for determining that the duplicate operation will not overwrite useful data.

This option is necessary when you are creating a duplicate database in a different host that has the same disk configuration, directory structure, and filenames as the host of the target database. For example, imagine a small database that in the /dbs directory of HOST1:


Assume that you want to duplicate the database in machine HOST2, which happens to have the same file system /oracle/dbs/*, and you want to use the same filenames in the duplicate as in the primary. In this case, use the nofilenamecheck option to avoid renaming all the files. Because RMAN is not aware of the different hosts, RMAN cannot determine automatically that it should not check the filenames. 

skip readonly 

excludes the datafiles in read-only tablespaces from the duplicate database.

Note: A record for the skipped read-only tablespace still appears in DBA_TABLESPACES. This feature allows you to activate the read-only tablespace later. For example, you can store the read-only tablespace data on a CD-ROM instead of on disk, then mount the CD-ROM later and view the data. 


Setting New Filenames Manually

This example assumes that your target database is on HOST1 and you wish to duplicate your database to NEWDB on host2 with the file structure /oracle/dbs/*. Because the filenames in HOST1 are irregularly named and located in various sub-directories, you use set newname commands to re-name the files consistently. The duplicate command uses backup sets stored on tape to duplicate the target database to database NEWDB:

connect target;
connect catalog rman/rman@rmancat;
connect auxiliary sys/change_on_install@newdb;
run {  
    allocate auxiliary channel newdb1 type 'sbt_tape'; 
    allocate auxiliary channel newdb2 type 'sbt_tape'; 
    allocate auxiliary channel newdb3 type 'sbt_tape'; 
    allocate auxiliary channel newdb4 type 'sbt_tape'; 
    set newname for datafile 1 TO '$ORACLE_HOME/dbs/newdb_data_01.f'; 
    set newname for datafile 2 TO '$ORACLE_HOME/dbs/newdb_data_02.f'; 
    set newname for datafile 3 TO '$ORACLE_HOME/dbs/newdb_data_11.f'; 
    set newname for datafile 4 TO '$ORACLE_HOME/dbs/newdb_data_12.f'; 
    set newname for datafile 5 TO '$ORACLE_HOME/dbs/newdb_data_21.f'; 
    set newname for datafile 6 TO '$ORACLE_HOME/dbs/newdb_data_22.f'; 
    duplicate target database to newdb logfile
      group 1 ('$ORACLE_HOME/dbs/newdb_log_1_1.f', 
               '$ORACLE_HOME/dbs/newdb_log_1_2.f') size 200K, 
      group 2 ('$ORACLE_HOME/dbs/newdb_log_2_1.f', 
               '$ORACLE_HOME/dbs/newdb_log_2_2.f') size 200K reuse; 
Reusing the Target Filenames

This example assumes that you are restoring to a new host and that:

Related Topics






Go to previous page Go to beginning of chapter Go to next page
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.