DBA Tips Archive for Oracle
How to Restore the controlfile using RMAN
by Jeff Hunter, Sr. Database Administrator
Oracle provides many ways to restore the controlfile for recovery using RMAN (Recovery Manager).
This article provides several examples of how to get the controlfile back quickly so
the restore of the database can occur.
If you do not specify the location where to restore the controlfile to, the parameter
control_files is used with the respective names and locations listed in
the parameter file (init.ora or spfile).
IIIIIIIIII stands for the DBID. YYYYMMDD is a time stamp of the day the backup is generated. QQ is the hex sequence that starts with 00 and has a maximum of FF.
Example OMF autobackup controlfile:
The following examples use Oracle Database 10g and make use of a Recovery Catalog
and the Flash Recovery Area (FRA).
1. Restore controlfile from autobackup.
RMAN> restore controlfile from autobackup;
The following examples use Oracle Database 10g and make use of a Recovery Catalog and the Flash Recovery Area (FRA).
1. Restore controlfile from autobackup.
2. Restore controlfile from a specific backup piece.
3. Restore controlfile from most recent available controlfile backup.
The following examples use Oracle Database 10g and do not require the use of a Recovery Catalog or a Flash Recovery Area (FRA). The big difference is the requirement to set the dbid of the database before executing restore with the instance in a nomount state.
4. The following backup used all defaults. If not using a FRA, this backup should be in $ORACLE_HOME/dbs.
5. Restore from autobackup looks at the most recent 7 days backups by default. If you want to restore an autobackup that's older then the default you can use the 'maxdays' parameter..
6. Restore from autobackup increasing the number of autobackup sequences looked for restore in case your database generated many autobackups in a given day.
7. Restoring from autobackup when the backup location is not default.
8. Restore the controlfile from this specific autobackup.
9. Restore the controlfile from a specific autobackup file to a temporary disk location the replicate the temp controlfile to the respective locations and names given in control_files..
Once you have the controlfile restored and mounted you have access to your previous backup configuration which will also be used during restore as well as the backup information required to restore and recover your database. After you mount the controlfiles from Oracle101g 10.2.x > you can use the RESTORE PREVIEW command to see what backups will be required to restore and recover and what checkpoint you must exceed to open the database resetlogs.
About the Author
Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX / Linux server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 20 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science and Mathematics.
Copyright (c) 1998-2017 Jeffrey M. Hunter. All rights reserved.
All articles, scripts and material located at the Internet address of http://www.idevelopment.info is the copyright of Jeffrey M. Hunter and is protected under copyright laws of the United States. This document may not be hosted on any other site without my express, prior, written permission. Application to host any of the material elsewhere can be made by contacting me at firstname.lastname@example.org.
I have made every effort and taken great care in making sure that the material included on my web site is technically accurate, but I disclaim any and all responsibility for any loss, damage or destruction of data or any other property which may arise from relying on it. I will in no case be liable for any monetary damages arising from such loss, damage or destruction.