Wednesday, July 14, 2010

How to restore the Database into the same host but with different database name using the PITR option

Assume that you are running the Oracle database (named PROD,could be RAC also) and you need to restore the database into a different name (using the PROD RMAN backup, hot backup) into the same host.
You may need this for business purpose or to test some funcionality.
Please check with your storage space and other resources (RAM and CPU) before doing this.Normally it is not recommended to this on Production
host.

This is not complex, but many thinks that it is not possible.

Here are the steps-

1.Prepare your new database environment - pfile, dump destinations etc.,
File name conversion should be in place for the datafiles and logfiles. This is
very important.RMAN wont overwrite these files by default.But be cautious.
check your logfile name format and destinations.Check the flash recovery
related parameters.
2.start this new database with nomount option.
3.using RMAN, restore the controlfile and mount the database.
4.Now you restore the database.
5.Rename the datafiles and logfiles using "alter database rename file ...."
5.create the controlfile script using alter database backup controlfile to trace
and shutdown the database (not the PROD).
6.remove the original controlfiles (not the PROD database) and edit the database name (db_name=TEST).
7.start the TEST database with nomount option.
8.create the new controlfile. This will create the controlfile and mount the database.
9.Check the datafiles and logfiles point to the restored destination.
select name from v$datafile and select member from v$logfile;
10.Recover the database using until cancel option.Apply the archivefiles and
roll forward your thread as to the point you need.
11.Cancel the recovery at consistent point in time and open the database with resetlogs option.
12.Now you see the PROD and TEST running on the same host.
13.If you need to backup this TEST database using catalog database option, then reset the DBID and register with the catalog.

These steps may not be exactly same.But will give some idea about how this works.

This might be helpful for your OCM preparation.


Hope this helps.

1 comment:

  1. Since i don't understand chinese language, kindly post your comments in English

    ReplyDelete