Oracle Database

Fool proof way to restore a database using RMAN

Oracle – Fool proof way to restore a database using RMAN

Goal
This method will ensure a clean restore from tape. Although this is designed to run from ASM to non-ASM, this method can be adapted from NON ASM as well.

Solution
Step 1. First gather the required information from the source database. This can also be obtained using the script below:

Step 2. If using Netbackup, Obtain the policy/client name

Step 3. Copy the Oracle binaries to the destination and ensure all entries of the TNSNAMES.ora are removed. The only entry that should be left is the CATALOGDB

Step 4. Make a copy of the Pfile and modify the contents, ensuring all Data Guard related items and any unnecessary parameters are removed. Also, create the relevant directory structures as listed.

Step 5. Start the database, and restore the controlfile and then mount the database

Start an RMAN session and perform the control file restore.

Then, mount the database

Step 6. If there is a requirement to change the datafile location, the following script will handle the names based on version

Step 7. Get a valid restore point, to ensure we can successfully open with the resetlogs options without any error
With the destination database mounted, run the following sql

Step 8. Restore and recover the database using the information we have gathered. DO NOT CONNECT TO THE RECOVERY CATALOG when restoring the database

Step 9. Disable data block change tracking if it activated

Step 10. After the database has been restored and recovered, you can open the database

If block change tracking needs to be enabled:

Step 10. After the database has been open, create spfile from pfile and restart the DB and create the temp file

How to restore a database from 1 week prior

Follow the same steps above, however when obtaining the SCN use the following syntax:

Then restore the control file

Restore the database as normal using the SCN captured from above.
How to find the last level 0 backup

Known Issues and Problems:

Solution:

These are old archive logs that are being cataloged which is causing an issue. Remove the files and restore the control file again.
Rename Redo Log files prior to open

Applies to:

RMAN on Oracle Version: 10g and 11g and later.

Print Friendly, PDF & Email

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.