Translate

Sunday, 4 September 2011

Duplicate Database With RMAN Without Connecting To Target Database

Follow the below steps

1)Export ORACLE_SID=

create init.ora file and give db_name= and control_files=
want controlfile to be restored>

2)Startup nomount pfile=;

3)Connect to RMAN and issue command :

RMAN>restore controlfile from ';

controlfile should be restored.

4) Issue "alter database mount"

Make sure that backuppieces are on the same location where it were there on production db. If you
dont have the same location, then make RMAN aware of the changed location using "catalog" command.

RMAN>catalog backuppiece ;

If there are more backuppieces, than they can be cataloged using command :

RMAN>catalog start with ;

5) After catalogging backuppiece, issue "restore database" command. If you need to restore datafiles to a location different to the one recorded in controlfile, use SET NEWNAME command as below:

run {
set newname for datafile 1 to '/newLocation/system.dbf';
set newname for datafile 2 to '/newLocation/undotbs.dbf';
...
restore database;
switch datafile all; }

6) After database is restored, perform recovery and apply archives which were generated during
backup using RMAN and then open the database with resetlogs. If you need to create online redo logs in a different location to that recorded in controlfile (v$logfile.member) run below rename commands for all redologs before running ALTER DATABASE OPEN RESETLOGS:

SQL> alter database rename file '/oldLocation/redo01.log' to '/newLocation/redo01.log';

7) To change the dbname and dbid, please use the Metalink Note 224266.1 to change the same

No comments:

Post a Comment