Skip Headers

Oracle9i Recovery Manager Reference
Release 2 (9.2)

Part Number A96565-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

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

RMAN Commands , 27 of 59


DUPLICATE

Syntax

Text description of duplicate.gif follows
Text description of the illustration duplicate.gif


dupOptionList::=
Text description of dupOptionList.gif follows
Text description of the illustration dupOptionList.gif


logSpec::=
Text description of logSpec.gif follows
Text description of the illustration logSpec.gif


dupsbyOptionList::=
Text description of dupsbyOptionList.gif follows
Text description of the illustration dupsbyOptionList.gif


Purpose

To use backups of the target database to create either of the following:

To create a standby database with the DUPLICATE command you must specify the FOR STANDBY option. The DUPLICATE ... FOR STANDBY command creates the standby database by restoring a standby control file, mounting the standby control file, and then restoring and recovering backups of the target datafiles. The standby database is left mounted after duplication is complete. Note that backups of the standby database are interchangeable with backups of the primary database.

When duplicating a database that is currently in NOARCHIVELOG mode, recovery occurs with 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 setting.

See Also:

Oracle9i Recovery Manager User's Guide to learn how to create a duplicate database with the DUPLICATE command

Oracle9i Recovery Manager User's Guide to learn how to create a standby database with the DUPLICATE ... FOR STANDBY command

Oracle9i Data Guard Concepts and Administration to learn how to create and manage standby database

Restrictions and Usage Notes

These restrictions apply to all uses of the DUPLICATE command (both for creation of a standby database and creation of a nonstandby duplicate database):

The following restrictions apply when you use the DUPLICATE command with the FOR STANDBY option:

Keywords and Parameters

Syntax Element Description

TO 'database_name'

Specifies the name of the duplicate database. The name should match the name in the initialization parameter file of the duplicate database or Oracle signals an error when creating the control file.

dupOptionList

Specifies options that apply when creating a nonstandby duplicate database.

LOGFILE logSpec

Specifies the online redo logs when creating a nonstandby duplicate database. The syntax is the same used in the LOGFILE option of the CREATE DATABASE statement.

Refer to the description of logSpec for the legal options.

NOFILENAMECHECK

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, assume that you have a small database located in the /dbs directory of host1:

/oracle/dbs/system_prod1.dbf 
/oracle/dbs/users_prod1.dbf 
/oracle/dbs/tools_prod1.dbf 
/oracle/dbs/rbs_prod1.dbf 

Assume that you want to duplicate the database in machine host2, which has the same file system /oracle/dbs/*, and you want to use the same filenames in the duplicate database as in the primary. In this case, specify the NOFILENAMECHECK option to avoid an error message. Because RMAN is not aware of the different hosts, RMAN cannot determine automatically that it should not check the filenames.

SKIP READONLY

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

Note: A record for the skipped read-only tablespace still appears in DBA_TABLESPACES. By using this feature, you can activate the read-only tablespace later. For example, you can store the read-only tablespace data on a CD-ROM, then mount the CD-ROM later and view the data.

SKIP TABLESPACE 'tablespace_name'

Excludes the specified tablespace from the duplicate database. Note that you cannot exclude the SYSTEM tablespace, undo tablespaces, and tablespaces with rollback segments.

Sets the end point for incomplete recovery of the duplicate database. You can achieve the same result by running SET UNTIL before the DUPLICATE command.

See Also: "untilClause"

DEVICE TYPE deviceSpecifier

Allocates automatic channels for the specific deviceSpecifier only (for example, DISK or sbt). This option is valid only if you have configured automatic channels and have not manually allocated channels. For example, if you CONFIGURE automatic disk and tape channels, and if you run DUPLICATE ... DEVICE TYPE DISK, then RMAN allocates only disk channels.

See Also: "deviceSpecifier"

PFILE = 'filename'

Specifies a client-side initialization parameter used by the auxiliary instance. RMAN automatically shuts down and restarts the auxiliary instance during duplication. If the auxiliary does not use a server-side parameter file in the default location, you must specify the client-side parameter file that RMAN should use when starting the auxiliary instance. Otherwise, you do not need to specify PFILE.

logSpec

Specifies the online redo logs when creating a nonstandby duplicate database. If you do not specify LOGFILE, then RMAN uses LOG_FILE_NAME_CONVERT if it is set. If neither LOGFILE nor LOG_FILE_NAME_CONVERT is set, then RMAN uses the original target log filenames for the duplicate files. You must specify the NOFILENAMECHECK option in this case.

See Also: Oracle9i SQL Reference for CREATE DATABASE syntax

'filename' SIZE integer

Specifies the filename of the online redo log member and the size of the file in kilobytes (K) or megabytes (M). The default is in bytes.

REUSE

Allows Oracle to reuse an existing file. If the file already exists, then Oracle verifies that its size matches the value of the SIZE parameter. If the file does not exist, then Oracle creates it.

GROUP integer

Specifies the group containing the online redo log members.

FOR STANDBY

Specifies that database being duplicated is to be used as a standby database. RMAN restores the most recent files (unless SET UNTIL is specified). If DORECOVER is specified, then RMAN also recovers database. RMAN always leaves standby database in mounted state after executing DUPLICATE command.

dupsbyOptionList

Specifies options that only apply when creating a standby database.

DORECOVER

Specifies that RMAN should recover the database after creating it. If you specify an untilClause, then RMAN recovers to the specified point and leaves the database mounted.

NOFILENAMECHECK

Prevents RMAN from checking whether target datafiles sharing the same names as the duplicated files are in use. Note that the NOFILENAMECHECK option is required when the standby and primary datafiles and logs have identical filenames.

See Also: The description in dupOptionList

Examples

Setting New Filenames Manually: Example

This example assumes that the target database is on host1 and you wish to duplicate the database to newdb on host2 with the file structure ?/oradata/newdb/*. Because the filenames in host1 are irregularly named and located in various subdirectories, you use SET NEWNAME commands to rename the files consistently. The DUPLICATE command uses backup sets stored on tape to duplicate the target database to database newdb, and recovers it to a point 24 hours ago:

RUN
{  
  ALLOCATE AUXILIARY CHANNEL newdb1 DEVICE TYPE sbt; 
  SET NEWNAME FOR DATAFILE 1 TO '?/oradata/newdb/system01.dbf'; 
  SET NEWNAME FOR DATAFILE 2 TO '?/oradata/newdb/undotbs01.dbf'; 
  SET NEWNAME FOR DATAFILE 6 TO '?/oradata/newdb/indx01.dbf';
  SET NEWNAME FOR DATAFILE 7 TO '?/oradata/newdb/tools01.dbf';
  SET NEWNAME FOR DATAFILE 8 TO '?/oradata/newdb/users01.dbf';
  DUPLICATE TARGET DATABASE TO newdb
    UNTIL TIME 'SYSDATE-1'  # specifies incomplete recovery
    SKIP TABLESPACE cmwlite, drsys, example   # skip desired tablespaces
    PFILE = $ORACLE_HOME/dbs/initNEWDB.ora
    lOGFILE
      GROUP 1 ('?/oradata/newdb/redo01_1.f', 
               '?/oradata/newdb/redo01_2.f') SIZE 200K, 
      GROUP 2 ('?/oradata/newdb/redo02_1.f', 
               '?/oradata/newdb/redo02_2.f') SIZE 200K 
      GROUP 3 ('?/oradata/newdb/redo03_1.f',
               '?/oradata/newdb/redo03_2.f') SIZE 200K REUSE;
}
Reusing the Target Filenames: Example

This example assumes the following:

Creating a Standby Database: Example

This example creates a standby database on a remote host with the same directory structure as the primary host. In this example, the NOFILENAMECHECK option is specified because the standby and primary datafiles and logs have the same names. Note that an automatic auxiliary channel is already configured, so you do not need to manually allocate a channel:

DUPLICATE TARGET DATABASE FOR STANDBY
  NOFILENAMECHECK;

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

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback