Have come across a requirement to clone a database using RMAN from from PROD to TEST in the same server
The only way you can clone a database from PROD to TEST (Different SID) in the same server is using RMAN duplicate command.
Usually RMAN duplicate command uses auxilary database and connect to target(PROD) database while creating the TEST.
We have a new feature in 11GR2, Which allows to clone using RMAN duplicate command without connecting to source PROD database.
It will only access the backup piecies and clones database.
This method works in cloning the database in the same server or different server
Source : PROD
Target : TEST
Steps:
1) Copy the Oracle home from source PROD to target TEST and create the parameter file for TEST database
2) Copy the backupsets to TEST server (If the clone is in the same server, This step is not required)
3)If you are cloning the database in the same server as PROD,Modify the below two parameters in the TEST (target instance),
This step is very importent step to mention the different directory structure for TEST datafiles if you are restoring on the same server as PROD.
db_file_name_convert=('/oradata/PROD' '/oradata/TEST')
log_file_name_convert=('/oradata/PROD' '/oradata/TEST')
4) Start the TEST Instance (This is called as auxilarary database)
$ sqlplus "/ as sysdba"
SQL> startup nomount;
5) Run the RMAN duplicate command from
rman auxiliary /
RMAN> DUPLICATE DATABASE TO NEWDB BACKUP LOCATION '/RMAN_Backup_Location/';
The only way you can clone a database from PROD to TEST (Different SID) in the same server is using RMAN duplicate command.
Usually RMAN duplicate command uses auxilary database and connect to target(PROD) database while creating the TEST.
We have a new feature in 11GR2, Which allows to clone using RMAN duplicate command without connecting to source PROD database.
It will only access the backup piecies and clones database.
This method works in cloning the database in the same server or different server
Source : PROD
Target : TEST
Steps:
1) Copy the Oracle home from source PROD to target TEST and create the parameter file for TEST database
2) Copy the backupsets to TEST server (If the clone is in the same server, This step is not required)
3)If you are cloning the database in the same server as PROD,Modify the below two parameters in the TEST (target instance),
This step is very importent step to mention the different directory structure for TEST datafiles if you are restoring on the same server as PROD.
db_file_name_convert=('/oradata/PROD' '/oradata/TEST')
log_file_name_convert=('/oradata/PROD' '/oradata/TEST')
4) Start the TEST Instance (This is called as auxilarary database)
$ sqlplus "/ as sysdba"
SQL> startup nomount;
5) Run the RMAN duplicate command from
rman auxiliary /
RMAN> DUPLICATE DATABASE TO NEWDB BACKUP LOCATION '/RMAN_Backup_Location/';