Using CONFIGURE AUXNAME configuration to rename
It's possible to specify the
location of database files of a duplicated database directly from
RMAN configuration. By doing so, RMAN will keep these configuration
changes and we'll not need to specify them in the future.
To clear the AUXNAME from the
default CONFIGURE settings, issue the following command at the RMAN
RMAN> configure auxname for
datafile <data file number> clear;
Now, perform all steps above till
the run block and add the following steps:
Make changes to RMAN
configuration default settings
and configure AUXNAME
parameter for each data file.
CONFIGURE AUXNAME FOR DATAFILE 1 TO '/u03/oracle/clone_db/system01.dbf';
CONFIGURE AUXNAME FOR DATAFILE 2 TO '/u03/oracle/clone_db/undotbs01.dbf';
CONFIGURE AUXNAME FOR DATAFILE 3 TO '/u03/oracle/clone_db/sysaux01.dbf';
CONFIGURE AUXNAME FOR DATAFILE 4 TO
Above, we've configured RMAN so
that it will change the location of each file specified
Run the following block
to duplicate the database in the same host
Even though, we use AUXNAME for
data files, the CONFIGURE AUXNAME can't be used for temp files and
redo log files. Thus, for temp files we have to use SET NEWNAME
clause and for redo log files we have to use LOGFILE clause.
SET NEWNAME FOR TEMPFILE 1 TO '/u03/oracle/clone_db/temp01.dbf';
DUPLICATE TARGET DATABASE TO clone_db
'/u03/oracle/clone_db/redolog01.log' SIZE 5M, '/u03/oracle/clone_db/redolog02.log'
SIZE 5M, '/u03/oracle/clone_db/redolog03.log' SIZE 5M;