Dataguard · Oracle · RMAN

Restore Corrupt Datafile using Another Standby

If there is a corruption on one of the datafiles on a dataguard you can restore the corruption using another dataguard. I will explain how to do the restore operation in rman using oracle 11.2.

ON THE WORKING DATAGUARD

Backup the datafile as image copy.

RMAN> BACKUP AS COPY DATAFILE 178 FORMAT "+data/test2/datafile/test_datafile178";

Uncatalog the image backup on the working dataguard.

RMAN> LIST COPY OF DATAFILE 178;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - --------------- ---------- ---------------
2208 178 A 01-JUL-14 125562119884 01-JUL-14
Name: +DATA/test2/datafile/test_datafile178
Tag: TAG20140112T080845

RMAN> CHANGE DATAFILECOPY '+data/test2/datafile/test_datafile178' UNCATALOG;
uncataloged datafile copy
datafile copy file name=+DATA/test2/datafile/test_datafile178 RECID=2208 STAMP=852710960
Uncataloged 1 objects

ON THE CORRUPT DATAGUARD

Copy the datafile image backup to the remote host. If they are on the same host you do not need to do anything. Assume they are on the same host for now. Catalog the datafile image copy

RMAN> CATALOG DATAFILECOPY "+data/test2/datafile/test_datafile178";
using target database control file instead of recovery catalog
cataloged datafile copy
datafile copy file name=+DATA/test2/datafile/test_datafile178 RECID=2730 STAMP=852711106

Switch the dataguard copy.

RMAN> SWITCH DATAFILE 178 TO COPY ;
using target database control file instead of recovery catalog
datafile 178 switched to datafile copy "+data/test2/datafile/test_datafile178"

Delete the corrupt datafile

Advertisements

3 thoughts on “Restore Corrupt Datafile using Another Standby

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