Oracle8i Backup and Recovery Guide Release 8.1.5 A67773-01 |
|
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.
See Also: To learn how to duplicate a database, see Chapter 10, "Creating a Duplicate Database with Recovery Manager".
database_name |
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 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: For more about the CREATE DATABASE statement, see the Oracle8i SQL Reference. |
|
|
'filename' |
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. |
|
reuse |
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. |
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, imagine a small database that in the /oracle/dbs/system_prod1.dbf /oracle/dbs/users_prod1.dbf /oracle/dbs/tools_prod1.dbf /oracle/dbs/rbs_prod1.dbf /oracle/dbs/users2_prod1.dbf
Assume that you want to duplicate the database in machine HOST2, which happens to have the same file system |
|
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. |
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; }
This example assumes that you are restoring to a new host and that:
connect target connect auxiliary sys/aux_pwd@newdb run { allocate auxiliary channel ndbnewh1 type disk; allocate auxiliary channel ndbnewh2 type disk; duplicate target database to ndbnewh logfile '$ORACLE_HOME/dbs/log_1.f' size 200K, '$ORACLE_HOME/dbs/log_2.f' size 200K skip readonly nofilenamecheck; }