Skip Headers
Oracle® Database Backup and Recovery Advanced User's Guide
10g Release 2 (10.2)

Part Number B14191-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Renaming Database Files in RMAN Duplicate Database

When duplicating a database, RMAN generates names for the required database files. This section describes the different stages of file creation:

Renaming Control Files in RMAN DUPLICATE DATABASE

The rules of precedence for determining the names for the duplicate database control files are the same used by the SQL statement CREATE CONTROLFILE. When choosing names for the duplicate control files, make sure you set the parameters in the initialization parameter file of the auxiliary database correctly; otherwise, you could overwrite the control files of the target database.

Renaming Online Logs in RMAN DUPLICATE DATABASE

RMAN needs new names for the online redo log files of the duplicate database. Either you can specify the names explicitly in the DUPLICATE command, or you can let RMAN generate them according to the rules listed in Table 13-1.

Table 13-1 Order of Precedence for Online Redo Log Filename Generation

Order Method Result

1

Specify the LOGFILE clause of DUPLICATE command.

Creates online redo logs as specified.

2

Set LOG_FILE_NAME_CONVERT initialization parameter.

Transforms target filenames, for example, from log_* to duplog_*. Note that you can specify multiple conversion pairs.

For details on the use of LOG_FILE_NAME_CONVERT with Oracle Managed Files (OMF), see "Initialization Parameters for RMAN DUPLICATE to OMF Storage".

RMAN uses the REUSE parameter when creating the logs. If an online log file already exists at the named location and is of the correct size, it is reused for the duplicate.

3

Set one of the Oracle Managed Files initialization parameters DB_CREATE_FILE_DEST, DB_CREATE_ONLINE_DEST_n, or DB_RECOVERY_FILE_DEST.

Transforms target filenames based on the parameters set. The rules of precedence among these parameters are the same used by the SQL statement ALTER DATABASE ADD LOGFILE.

4

Do none of the preceding steps.

Makes the duplicate filenames the same as the filenames from the target. You must specify the NOFILENAMECHECK option when using this method, and the duplicate database should be in a different host so that the online logs of the duplicate do not conflict with the originals.


Rules higher in the order of precedence override rules lower in the list. For example, if you specify both the LOGFILE clause and the LOG_FILE_NAME_CONVERT parameter, then RMAN uses the LOGFILE clause.

Caution:

  • If the target and duplicate databases are in the same host, then do not use the name of an online redo log currently in use by the target database.

  • Do not use the name of an online log currently in use by the target database if the duplicate database is in a different host and NOFILENAMECHECK is not used.

Does RMAN detect these cases and stop? or does it just smash your target database?

Renaming Datafiles in RMAN DUPLICATE DATABASE

There are several means of specifying new names to be used for the datafiles of your duplicate database. Listed in order of precedence, they are:

  1. Use the RMAN command SET NEWNAME FOR DATAFILE within a RUN block that encloses both the SET NEWNAME commands and the DUPLICATE command.

  2. Use the RMAN command CONFIGURE AUXNAME to specify new names for existing datafiles. Run the CONFIGURE AUXNAME command before the DUPLICATE command.

  3. Specify the DB_FILE_NAME_CONVERT parameter on the DUPLICATE command to specify a rule for converting filenames for any datafiles not renamed with SET NEWNAME or CONFIGURE AUXNAME.

    Note:

    The DB_FILE_NAME_CONVERT clause of the DUPLICATE command cannot be used to control generation of new names for files at the duplicate instance which are Oracle Managed Files (OMF) at the target instance. See Oracle Database Backup and Recovery Reference for details on this restriction.

    BUG 4673106

  4. Set the DB_FILE_NAME_CONVERT initialization parameter.

    Note:

    The DB_FILE_NAME_CONVERT initialization parameter cannot be used to control generation of new names for files at the duplicate instance which are Oracle Managed Files (OMF) at the target instance. It is subject to the same semantics and limitations as the DB_FILE_NAME_CONVERT parameter to the DUPLICATE command. It See Oracle Database Backup and Recovery Reference for details .
  5. Set the DB_CREATE_FILE_DEST initialization parameter to create Oracle Managed Files datafiles at the specified location.

If you do not use any of the preceding options, then the duplicate database reuses the original datafile locations from the target database.

Preventing Filename Checking when Duplicating a Database

It is possible for CONFIGURE AUXNAME, SET NEWNAME, or DB_FILE_NAME_CONVERT to generate a name that is already in use in the target database. In this case, specify NOFILENAMECHECK on the DUPLICATE command to avoid an error message.

For example, assume that the host A database has two files: datafile 1 is named /oracle/data/file1.f and datafile 2 is named /oracle/data/file2.f. When duplicating to host B, you use a configured channel to duplicate as follows:

RUN
{
  SET NEWNAME FOR DATAFILE 1 TO /oracle/data/file2.f; # rename df 1 as file2.f
  SET NEWNAME FOR DATAFILE 2 TO /oracle/data/file1.f; # rename df 2 as file1.f
  DUPLICATE TARGET DATABASE TO newdb;
} 

Even though you issued SET NEWNAME commands for all the datafiles, the DUPLICATE command fails because the duplicate filenames are still in use in the target database. Although datafile 1 in the target is not using /oracle/data/file2.f, and datafile 2 in the target is not using /oracle/data/file1.f, the target filename is used by one of the duplicate datafiles. Thus, you must specify DUPLICATE ... NOFILENAMECHECK to avoid an error.

Renaming Tempfiles in RMAN DUPLICATE DATABASE

RMAN re-creates datafiles for temporary tablespaces as part of the process of duplicating a database. There are several means of specifying locations for duplicate database tempfiles. Listed in order of precedence, they are:

  1. Use the SET NEWNAME FOR TEMPFILE command within a RUN block that encloses both the SET NEWNAME commands and the DUPLICATE command.

  2. Specify the DB_FILE_NAME_CONVERT clause to the DUPLICATE command to specify a rule for converting tempfiles not renamed with SET NEWNAME or CONFIGURE AUXNAME.

    Note:

    The DB_FILE_NAME_CONVERT clause cannot be used to control generation of new names for files at the duplicate instance which are Oracle Managed Files (OMF) at the target instance. See Oracle Database Backup and Recovery Reference for details on this restriction.

    BUG 4673106

  3. Set the DB_FILE_NAME_CONVERT initialization parameter.

    Note:

    The DB_FILE_NAME_CONVERT initialization parameter is subject to the same semantics and limitations as the DB_FILE_NAME_CONVERT parameter to the DUPLICATE command.See Oracle Database Backup and Recovery Reference for details .
  4. Set the DB_CREATE_FILE_DEST initialization parameter to create Oracle Managed Files tempfiles.