Skip to Main Content
  • Questions
  • How to recover the whole database with RMAN Backup

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, vishnudas.

Asked: March 13, 2019 - 12:34 pm UTC

Last updated: March 25, 2019 - 1:42 pm UTC

Version: 11.2.0.1.0

Viewed 1000+ times

You Asked

Hi Team, First off all a big Thanks for your supports
Now i wanna know the steps to recover a fully operational database with RMAN backup.
I haven't done this scenario before,So i am going for a Test case here.
My requirement is

1) I have database(Running in Archivelog Mode)
2) I have a consistent RMAN Backup including archivelogs
3) Suppose the machine which carrying the database caught on fire and the database went down
4) The only thing i have, a copy of RMAN Backup

The next step i would do is get new Machine and install Oracle software only.

Afterwards what are the steps to recover the database from the RMAN backup ???
If you guys would explain this scenario in detail will much appreciable..


and Connor said...

I'll assume you are not using an RMAN catalog, but you have a pfile ready to go on your new host.

Step 1 - you need to set your DBID. You can find this in the log files for any of your backups. If you don't have them (well...I'd fix that for the future) then it is still possible to find it by doing some binary analysis of the backup files, but you really don't want to be going there :-)

set dbid=123456789
startup nomount


Step 2 - you get a controlfile from your backups

run{
  SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u01/mybackup/location';
  RESTORE CONTROLFILE to '/u01/app/db/my_control.ctl' FROM AUTOBACKUP;
  ALTER DATABASE MOUNT;
}


Step 3 - Now that you have your control file, it contains the information to get your database back. If the backups are in the same location on the new host, you're good to go, otherwise you might need to run CATALOG commands to let RMAN know where the backups are now located. But then you restore and recover like normal

run {
  RESTORE DATABASE;
  RECOVER DATABASE;
}


There are various scenarios in the docs that have variations on the above, but the most important thing is that you practice these things regularly. As the old saying goes:

"A backup is not a backup unless you know how to restore it"

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

A reader, March 20, 2019 - 5:59 am UTC

Thank you so much for your help..
Is there any hand book explaining various backup and restore strategies ??
You guys have already suggested me a hand book for Performance Tuning..
i have got little of knowledge in backup and restore methods,So for this case too please suggest me a hand book..

Connor McDonald
March 25, 2019 - 1:42 pm UTC

Some suggestions ...

J. Laurindo Chiappa, March 21, 2019 - 6:02 pm UTC

Some good books on the topic :


Oracle Database 12c Oracle RMAN Backup and Recovery, by Robert G. Freeman, Matthew Hart

RMAN Recipes for Oracle Database 12c: A Problem-Solution Approach (Expert's Voice in Oracle), by Darl Kuhn , Sam Alapati, & others

Oracle Advanced RMAN Backup & Recovery (Complete Reference Guide): Recover entire production database in the event of server crash using this RMAN guide, by Arun Kumar

Oracle RMAN for Absolute Beginners, by Darl Kuhn

and, in a broader approach (thinking about BACKUP & RESTORE as a part of a more general data management) :

Pro Oracle Database 18c Administration: Manage and Safeguard Your Organization’s Data (Inglês), 3rd ed., by Michelle Malcher, Darl Kuhn


and, OF COURSE, your FIRST STEP would be : READ the RMAN documentation, freely available on docs.oracle.com ....


regards,

Chiappa

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.