There are three main ways to create a duplicate
database on the remote host with a different directory structure:
In this example by making changes to
the initialization parameter file of the auxiliary instance we
make RMAN create all Control Files, Redo Log files and Data
Files on the different directory.
In this process, all steps will be
the same as they were in the previous example. Except two
parameters which will be added to the initialization parameter
file such as DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT.
DB_FILE_NAME_CONVERT parameter
changes location of datafiles of the production database to a
different location on the auxiliary database.
Note: The directories
which are different from the production
database on the auxiliary server are created manually. New locations on Auxiliary server must be created
manually.
LOG_FILE_NAME_CONVERT parameter
changes location of redo log files of the production database
to a different location on the auxiliary database
At the end, the parameter file will
be as follows:
*.compatible='10.2.0.1.0'
*.control_files='/u03/oracle/new_database/control01.ctl','/u03/oracle/new_database/control02.ctl',
'/u03/oracle/new_database/control03.ctl'
*.db_file_name_convert='/u01/oradata/test/','/u03/oracle/new_database/'
*.log_file_name_convert='/u01/oradata/test/','/u03/oracle/new_database/'
*.db_block_size=8192
*.db_name='test'
*.sga_target=285212672
Now, if we run DUPLICATE COMMAND as
in the previous example, all database files will be created on
the /u03/oracle/new_database directory. It can be seen by
querying the following views on the auxiliary database.
sys@TEST>SELECT name FROM
v$datafile;
NAME
--------------------------------------------------
/u03/oracle/new_database/system01.dbf
/u03/oracle/new_database/undotbs01.dbf
/u03/oracle/new_database/sysaux01.dbf
/u03/oracle/new_database/users01.dbf
sys@TEST>SELECT member FROM v$logfile;
MEMBER
-------------------------------------------------
/u03/oracle/new_database/redo03.log
/u03/oracle/new_database/redo02.log
/u03/oracle/new_database/redo01.log
sys@TEST>SELECT name FROM
v$controlfile;
NAME
-----------------------------------------
/u03/oracle/new_database/control01.ctl
/u03/oracle/new_database/control02.ctl
/u03/oracle/new_database/control03.ctl