Simple RMAN - CONTROL FILE Restore in different server
Written by RD   
Tuesday, 12 February 2008

Copy  RMAN backup files including archive log backup files to the target server

Copy the SNAPSHOT CONTROL FILE or backed up control file from source server to target server.

If you do not remember the snapshot control file location, connect to source rman and query “snapshot controlfile name” and it will give as below: 

Source Server: 

RMAN> connect target /;
connected to target database: HRDMO (DBID=209403493034)

RMAN> show SNAPSHOT CONTROLFILE NAME;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/10g/dbs/snapcf_HRDMO.f'; # default

Copy the snapshot controlfile to your target server or the backup of control file.

NOTE: You need to have same directories created for the restoration of files and the RMAN backup files, including archive log backup and they should be in the same structure as it is in source server. If you don’t have exactly same file system just create soft links to cheat. 

Target Server:

Export ORACLE_SID=HRDMO
RMAN

RMAN>startup nomount;
RMAN> set DBID=209403493034;
executing command: SET DBID
RMAN> restore controlfile from '/opt/oracle/standby/dbs/snapcf_crmprod.f'; # The location where you have it in target srvr.

Starting restore at 06-FEB-08 using channel ORA_DISK_1
channel ORA_DISK_1: copied controlfile copy
replicating controlfile
input filename=/db1/oradata/HRDMO/control01.ctl
output filename=/db2/oradata/HRDMO/control02.ctl
output filename=/db3/oradata/HRDMO/control03.ctl

Finished restore at 06-FEB-08

RMAN>alter database mount;
RMAN> run
2> {
3> sql 'alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';
4> set until time '2008-01-31 01:00:00';
5> restore database;
6> recover database;
7> } 

RMAN>alter database open resetlogs; 

You have the copy of instance in the target server. 

Try it out and if you have any issues, comment here we can fix it.


Add as favourites (45) | Quote this article on your site | Views: 10296 | Print

Comments (12)
RSS comments
1. 02-20-2008 16:52
 
Is there a script that you can share to clone database using RMAN backup? 
 
Thanks in advance
Guest
 
Kumar G
2. 02-21-2008 21:42
 
Sure. I will put together a post to clone with RMAN.
Registered
 
RD
3. 03-03-2008 13:40
 
how do i specify what time to set for set until time  
 
set until time '2008-01-31 01:00:00';
Guest
 
ma
4. 03-06-2008 17:06
 
It depends on the business requirement. If you are cloning to a particular time after a specific process is run and before the next day process, then you can select time depending upon the processes scheduled in your system. 
 
For example, in case of HR databases, I make sure I specify the set in time after all the nightly processes are completed and before the next day transactions, mainly from the users are entered. Usually it is after 2 AM and before 6 AM of next day as most of the batch processes end by 2 AM and the first users’ login around 6 AM.
Registered
 
RD
5. 03-09-2008 20:19
 
i backed up using 
run 

allocate channel disk1 device type disk format '/xx/xx/backup/%u' 
allocate channel disk1 device type disk format  

 
NOW, 
HOW DO I RESTTORE FROM THE ABOVE LOCATION INTO A DATABASE 
1. THAT IS ALEADY POPULATED. 
 
AM I PLEASE ABLE TO GET THE STEPS ONE BY ONE PLEASE.
Guest
 
ma
6. 03-10-2008 20:41
 
Yes. You should be able to restore it once you have the file structure exactly same as you backed up in your source server in the target server also. Like '/xx/xx/backup/%u'. The format and the locations are stored in the control file of the database. So you should be able to restore. If it is already restored, then you may rename the folder and create a new folder with the same name, so that the already restored files are not disturbed.
Registered
 
RD
7. 06-25-2008 10:20
 
How can I restore in a whole DB from a server using ASM directories to a different server using regular filesystem? 
 
Thanks.
Guest
 
Jorge
8. 08-21-2008 09:33
 
You should have same file system and directory structure in standby box exactly like the production box. Then it is the same as other restoration as the database will look for the file systems like in production after restore. While restoring the controlfile you need to provide the full path of the snapshot control file backup. That is it.
Registered
 
RD
9. 12-09-2009 13:58
 
If I want to clone the database with different SID what do I do?
Guest
 
Dinesh
10. 12-09-2009 14:34
 
You can do all the above and shutdown and delete control files and recreate it with trace file.  
 
Note you need to rest logs before using it. Which means you can not apply further logs from production database. 
 
Cheers.
Registered
 
RD

Copy  RMAN backup files including archive log backup files to the target server

Copy the SNAPSHOT CONTROL FILE or backed up control file from source server to target server.

If you do not remember the snapshot control file location, connect to source rman and query “snapshot controlfile name” and it will give as below: 

Source Server: 

RMAN> connect target /;
connected to target database: HRDMO (DBID=209403493034)

RMAN> show SNAPSHOT CONTROLFILE NAME;
using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/10g/dbs/snapcf_HRDMO.f'; # default

Copy the snapshot controlfile to your target server or the backup of control file.

NOTE: You need to have same directories created for the restoration of files and the RMAN backup files, including archive log backup and they should be in the same structure as it is in source server. If you don’t have exactly same file system just create soft links to cheat. 

Target Server:

Export ORACLE_SID=HRDMO
RMAN

RMAN>startup nomount;
RMAN> set DBID=209403493034;
executing command: SET DBID
RMAN> restore controlfile from '/opt/oracle/standby/dbs/snapcf_crmprod.f'; # The location where you have it in target srvr.

Starting restore at 06-FEB-08 using channel ORA_DISK_1
channel ORA_DISK_1: copied controlfile copy
replicating controlfile
input filename=/db1/oradata/HRDMO/control01.ctl
output filename=/db2/oradata/HRDMO/control02.ctl
output filename=/db3/oradata/HRDMO/control03.ctl

Finished restore at 06-FEB-08

RMAN>alter database mount;
RMAN> run
2> {
3> sql 'alter session set NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"';
4> set until time '2008-01-31 01:00:00';
5> restore database;
6> recover database;
7> } 

RMAN>alter database open resetlogs; 

You have the copy of instance in the target server. 

Try it out and if you have any issues, comment here we can fix it.


Add as favourites (45) | Quote this article on your site | Views: 10296 | Print

Comments (12)
RSS comments
11. 06-19-2010 09:52
 
i am following your above steps to redirect restore the oracle DB 
i am getting with the ora-01103 database name aba in control file is not abb 
can you help me..?
Guest
 
srinivas
12. 06-23-2010 05:07
 
You should make sure that the control file that you are using is from the backup of same DB. 
 
If you are trying to clone the DB ABB to ABA, then it will not work. First restore with the same name and change the SID.  
 
You can not clone in the same server/box. You need to restore it in different box and rename the DB.
Registered
 
RD

Write Comment
  • Thankyou for your comments.
  • Feel free to comment if there are any mistake in the postings also.
  • If you have a Blog or website, feel free to provide the link. We will take a peak.
  • Just ensure to *Refresh* your browser for a new security code to be displayed prior to clicking on the 'Send' button.
  • Keep in mind that the above process only applies if you simply entered the wrong security code.
Name:
Homepage
BBCode:Web AddressEmail AddressBold TextItalic TextUnderlined TextQuoteCodeOpen ListList ItemClose List
Comment:

Code:* Code
I wish to be contacted by email regarding additional comments

Copy Right: AKOComments v.1.4.6

Last Updated ( Monday, 28 July 2008 )