RMAN -
Creating a Duplicate Database on a Remote Host
There are mainly three ways for creating duplicate databases on
the remote host with different directory structure:
1. Making changes to the initialization parameter
2. Using the set newname command with the duplicate
command
3. Using the configure auxname command before running the
duplicate command
Now each of these methods will be demonstrated with real
examples.
Duplicating Database to the Remote Host with Different
Directory Structure
In this example, by making changes to the initialization
parameter file of the auxiliary instance, RMAN is made to 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.
- log_file_name_convert parameter changes location of redo log
files of the production database to a different location on the
auxiliary database.
Note: Make sure the
directories, which are different than the production
database, on the auxiliary server should be created
manually, i.e. new locations on the auxiliary server must
be created manually.
|
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 the duplicate command
is run 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:
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
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
Creating Duplicate Database with Different Directory
Structure
In the previous example, the creation of database files at a
different location in the auxiliary server was accomplished by
making changes to the parameter file. However, this is not the
only way to achieve it. It can be performed directly from RMAN as
follows:
-
Use db_file_name_convert and logfile
parameters in the duplicate database command.
-
Use the set newname command to
change location of files of the auxiliary database directly from
RMAN.
The first way will be explained under this subtopic. The
second way will be shown on the next duplicating database on a
local host? subtopic. To use the first solution, perform all the
steps which were mentioned in the beginning of this chapter until
the duplicate command. Change
the duplicate command and make it as follows:
RMAN> duplicate target database to
clone_db
db_file_name_convert=('/u01/oradata/test/','/
u03/oradata/new_database/')
LOGFILE
'/u03/oradata/new_database/redo01.log' size 5m,
'/u03/oradata /new_database/redo02.log' size 5m,'/u03/oradata
new_database/redo03.log' size 5m;
While running this command, all files will be created on the
/u03/oradata /new_database directory.