How to Restore the controlfile using RMAN


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;
2. Restore controlfile from a specific backup piece.

RMAN> restore controlfile from '/backup_dir/piece_name';
3. Restore controlfile from most recent available controlfile backup.

RMAN> restore controlfile;
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.

RMAN> set dbid=nnnnnnnnn;
RMAN> restore controlfile from autobackup;
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..

RMAN> set dbid=nnnnnnnnn;
RMAN> restore controlfile from autobackup maxdays 20;
6. Restore from autobackup increasing the number of autobackup sequences looked for restore in case your database generated many autobackups in a given day.

RMAN> set dbid=nnnnnnnnn;
RMAN> restore controlfile from autobackup maxseq 10;
7. Restoring from autobackup when the backup location is not default.

RMAN> set dbid=nnnnnnnnn;
RMAN> set controlfile autobackup format for device type disk to '/tmp/%F';
RMAN> restore controlfile from autobackup;
8. Restore the controlfile from this specific autobackup.

RMAN> set dbid=nnnnnnnnn;
RMAN> restore controlfile from '/tmp/c-1140771490-20080502-03';
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..

RMAN> set dbid=nnnnnnnnn;
RMAN> restore controlfile from '/tmp/c-1140771490-2008050203' to '/tmp/control.tmp';
RMAN> replicate controlfile from '/tmp/control.tmp'

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: