Saturday, April 26, 2008

Restore and Recovery of Whole Database. (All datafile damaged but controlfile ok)

Scenario:
-------------

1)You have a current control file and SPFILE but all datafiles are damaged or lost. Now you must restore and recover the whole database.

Before proceed you have to ensure that,

■ The current control file is intact.

■ You have the complete set of archived logs and incremental backups needed for media recovery of your available datafile backups.

■ For any datafiles for which you have no backup, you must have a complete set of online and archived redo logs going back to the creation of that datafile. (With a complete set of redo logs, RMAN can re-create a datafile for which there is no backup, by creating an empty datafile and then re-applying all changes since the file was created as part of the recovery process.)

In this example, I have taken backup and then I dropped the datafiles using OS command. But I have controlfile. Now I am restore and recover the full database.

Procedures:
-----------------

1)I have taken full database rman backup and then I delete some datafiles using OS command.

2)Now whenever I issue command I will show error file can't be open. Like,

SQL> shutdown immediate;
ORA-01116: error in opening database file 1
ORA-01110: data file 1: '/oradata2/data1/data1/system01.dbf'
ORA-27041: unable to open file
Solaris-AMD64 Error: 2: No such file or directory
Additional information: 3


3)Do a shutdown abort and conenct to rman.

SQL> shutdown abort;
ORACLE instance shut down.
SQL> !rman target /


4)From rman mount the database as controlfile is intact so no problem.

RMAN> startup mount;

5)Issue list backup to see available backup and you need to restore database and then recover database.

RMAN> list backup;
RMAN> restore database;
RMAN> recover database;


6)If it successful then open the database.

RMAN>alter database open;

No comments:

Post a Comment