Monday, 7 April 2014

How to bring a datafile ONLINE as it is in RECOVER mode because it was OFFLINE(ORA-01113: )


I want  to bring the datafile online but got below error :


SQL> alter database datafile '/home/oracle/oradaata/tbs01.dbf' online;
alter database datafile '/home/oracle/oradaata/tbs01.dbf' online
*
ERROR at line 1:
ORA-01113: file 5 needs media recovery
ORA-01110: data file 5: '/home/oracle/oradaata/tbs01.dbf'


I have checked the (status.dba_data_files) then found it's in recover mode
instead it should be in offline mode as DBA have switched it to offline mode earlier

This is due to DBA have not performed the manual checkpoint before switched it to offline .

Solution:

Not need to restore the datafile as it in place.If you have lost your datafile or corupted then only you need to be restore the datafile

Here only needs those ArchiveLogs thatcaptured the Checkpoint of the Datafile and it's being taken OFFLINE

step 1 :

SQL> recover datafile 5;

ORA-00279: change 718137 generated at 12/05/2012 15:32:56 needed for thread 1
ORA-00289: suggestion : archs/1_09.dbf
ORA-00280: change 718137 for thread 1 is in sequence #11714

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/archs/1_11714_785958283.dbf
ORA-00279: change 718252 generated at 12/05/2012 15:33:01 needed for thread 1
ORA-00289: suggestion : archs/1_10.dbf
ORA-00280: change 718252 for thread 1 is in sequence #11715

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/archs/1_11715_785958283.dbf
Log applied.
Media recovery complete.
SQL>

SQL> alter database datafile '/home/oracle/oradaata/tbs01.dbf' online;

Database alterd.

No comments:

Post a Comment