Duplicate Database With RMAN Without Connecting To Target Database [ID 732624.1] | |||||
| |||||
Modified 01-FEB-2011 Type HOWTO Status MODERATED |
In this Document
Goal
Solution
References
Platforms: 1-914CU;
This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review. |
Applies to:
Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 11.1.0.7 - Release: 10.1 to 11.1
Information in this document applies to any platform.
***Checked for relevance on 01-Feb-2011***
Goal
How to do duplicate database without connecting to target database using backups taken from RMAN on alternate host.
Solution
Follow the below steps
1)Export ORACLE_SID=<SID Name as of production>
create init.ora file and give db_name=<dbname of production> and control_files=<location where you
want controlfile to be restored>
2)Startup nomount pfile=<path of init.ora>;
3)Connect to RMAN and issue command :
RMAN>restore controlfile from '<backuppiece of controlfile which you took on production>;
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 <piece name and path>;
If there are more backuppieces, than they can be cataloged using command :
RMAN>catalog start with <path where backuppieces are stored>;
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 Note 224266.1 to change the same