Showing posts with label Duplicate database using RMAN. Show all posts
Showing posts with label Duplicate database using RMAN. Show all posts

Wednesday, March 21, 2007

Duplicate database using RMAN

Let assume you have RMAN backup of database called REDIK. You want to have a copy of this database called REDIKQA on different environment. The simplest way of doing this is to use duplicate command, see below for example:

rman catalog cat_user/cat_pwd@catalog_inst target target_user/target_pwd@REDIK auxiliary aux_user/aux_pwd@REDIKQ

RMAN> run
2> {
3> set newname for datafile 1 to 'd:\ORACLE10\REDIKQA\REDIKQA\SYSTEM01.DBF';
4> set newname for datafile 2 to 'd:\ORACLE10\REDIKQA\REDIKQA\UNDOTBS01.DBF';
5> set newname for datafile 3 to 'd:\ORACLE10\REDIKQA\REDIKQA\SYSAUX01.DBF';
6> set newname for datafile 4 to 'd:\ORACLE10\REDIKQA\REDIKQA\USERS01.DBF';
7> set newname for tempfile 1 to 'd:\ORACLE10\REDIKQA\REDIKQA\TEMP01.dbf';
8> duplicate target database to redikqa;
9> }

In case this is environment that will be refreshing often, to make it simpler, you can do this like this:
1. In init.ora of REDIKQA added two parameters:
DB_FILE_NAME_CONVERT = 'path_on_redik','
path_on_redikqa'
LOG_FILE_NAME_CONVERT =
'path_on_redik','path_on_redikqa'

2.Run:
duplicate target database to redikqa;