Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-02 |
|
|
View PDF |
When duplicating a database, RMAN generates names for the required database files. This section describes the different stages of file creation:
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.
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 |
Creates online redo logs as specified. |
2 |
Set |
Transforms target filenames, for example, from For details on the use of RMAN uses the |
3 |
Set one of the Oracle Managed Files initialization parameters |
Transforms target filenames based on the parameters set. The rules of precedence among these parameters are the same used by the SQL statement |
4 |
Do none of the preceding steps. |
Makes the duplicate filenames the same as the filenames from the target. You must specify the |
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:
Does RMAN detect these cases and stop? or does it just smash your target 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:
Use the RMAN command SET NEWNAME FOR DATAFILE
within a RUN
block that encloses both the SET NEWNAME
commands and the DUPLICATE
command.
Use the RMAN command CONFIGURE AUXNAME
to specify new names for existing datafiles. Run the CONFIGURE AUXNAME
command before the DUPLICATE
command.
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: TheDB_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 |
Set the DB_FILE_NAME_CONVERT
initialization parameter.
Note: TheDB_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 . |
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.
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.
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:
Use the SET NEWNAME FOR TEMPFILE
command within a RUN
block that encloses both the SET NEWNAME
commands and the DUPLICATE
command.
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: TheDB_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 |
Set the DB_FILE_NAME_CONVERT
initialization parameter.
Note: TheDB_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 . |
Set the DB_CREATE_FILE_DEST
initialization parameter to create Oracle Managed Files tempfiles.