Thursday, November 24, 2011

Restoring Control File Scenarios


Control file restoration from a backup will always require to perform media recovery on the entire database and then will have to be opened with the open resetlogs command.

Restoring Control File Using Flash Recovery Area

  1. Using the Autobackup of control file
  2. Not Using the Autobackup of the Control File


Using the Autobackup of the Control File

RMAN> connect target /
RMAN> startup nomount;
RMAN> restore controlfile from autobackup;

RMAN restores the control files to the location defined by your control_files initialization parameter.


Not Using the Autobackup of the Control File

If autobackup is disabled, you have to explicitly tell RMAN from which directory and backup piece to restore the control file.


RMAN> connect target /
RMAN> startup nomount;
RMAN> restore controlfile from  
2>'C:\folder1\fodler2\backupset\2011_11_23\ctrol_file_TAG20111123T02kc1vgsh.bck'

Restoring Control File Using Recovery Catalog


RMAN> connect target /
RMAN> connect catalog rcat/rcat@recov
RMAN> startup nomount;
RMAN> restore controlfile;


When you’re connected to the recovery catalog, you can view backup information about your control files even while your target database is in no mount mode.


RMAN> connect target /
RMAN> connect catalog rcat/rcat@recov
RMAN> startup nomount;
RMAN> list backup of controlfile;


Restoring Control File with No Flash Recovery Area or Recovery Catalog:

There could be four scenarios in the above mentioned category

  1. Using Autobackup,with RMAN Backup Piece in the Default Location
  2. Using Autobackup,with RMAN Backup Piece in a Nondefault Location
  3. Not Using Autobackup,with RMAN Backup Piece in the Default Location
  4. Not Using Autobackup,with RMAN Backup Piece in Nondefault Location

Using Autobackup,with RMAN Backup Piece in the Default Location


In this scenario, RMAN will look for the backup in the default location. You need to provide RMAN with
the DBID so that it knows from which backup piece the control file should be restored.



RMAN> connect target /
RMAN> startup nomount;
RMAN> set dbid 2611263161;
RMAN> restore controlfile from autobackup;

Using Autobackup,with RMAN Backup Piece in a Nondefault Location



If you used the configure controlfile autobackup format command to back up the control file to a nondefault location, then you have to tell RMAN where to find the backup file.


RMAN> connect target /
RMAN> startup nomount;
RMAN> set dbid 2611263161;
RMAN> set controlfile autobackup format for device type disk to 'C:\folder\%F';
RMAN> restore controlfile from autobackup;

If you don't want to set the DBID and point RMAN directly to the control file then uses this command


RMAN> connect target /
RMAN> startup nomount;
RMAN> restore controlfile from 'C:\folder\c-1140771490-20111123-07';

Not Using Autobackup,with RMAN Backup Piece in the Default Location



RMAN> connect target /
RMAN> startup nomount;
RMAN> restore controlfile from '/ora01/app/oracle/product/10.2.0/dbs/1hhu0gn1_1_1';

Not Using Autobackup,with RMAN Backup Piece in Nondefault Location

RMAN> configure channel device type disk format '/orabackups/%d%U.bus';



RMAN> connect target /
RMAN> startup nomount;
RMAN> restore controlfile from '/orabackups/BRDSTN1lhu0oi_1_1.bus';

Restoring Control File to Nondefault Location:

  1. Using Autobackups
  2. Using Recovery Catalog
  3. Manually configured RMAN backup piece

Using Autobackups


RMAN> connect target /
RMAN> restore controlfile to 'C:\ctl.bk' from autobackup;

Using a Recovery Catalog


RMAN> connect target /
RMAN> connect rmancat/rmancat@rcat
RMAN> restore controlfile to 'C:\ctl.bk';

Using a Manually Configured RMAN Backup Piece


RMAN> restore controlfile to '/ora01/oraddata/BRDSTN/ctl.bk'
2> from '/orabackups/BRDSTN/1lhu0oi_1_1.bus':



Referenced : RMAN Recipies for oracle database 11g
 














No comments:

Post a Comment