Labels

Wednesday, December 8, 2010

Recover when all the online redolog file corrupted.


          

So, what happens if you lose all members of a redo log group?  The steps you have to take are dependent on the groups status and whether or not the database is in archivelog mode. 


INACTIVE: 



  • If the affected redo log group has a status of INACTIVE it is no longer required for crash recovery.  If you are in NOARCHIVELOG mode issue either CLEAR LOGFILE or recreate the group manually.

  • If you are in ARCHIVELOG mode and the group has been archived, issue either of the steps above. 

  • If you are in ARCHIVELOG mode and the group hasn’t been archived then issue CLEAR UNARCHIVED LOGFILE.  If you don’t specify the UNARCHIVED keyword you will receive an error. After you execute this command, you will have a gap in your archivelogs, so perform a complete backup (including the control file) ASAP.

ACTIVE:


  • If the redo log group has a status of ACTIVE, it is still required for crash recovery.  Issue the command ALTER SYSTEM CHECKPOINT, If successful then follow the steps above for INACTIVE. 

  • If the checkpoint fails, then you need to perform recovery.  If you are in NOARCHIVELOG mode then you need to perform a complete recovery of the last cold backup. 

  • If the checkpoint fails and you are in ARCHIVELOG mode then you can perform an INCOMPLETE recovery up to the previous log file. 

CURRENT:

 The current redo log group is the one which Oracle is currently writing to.   If you lose this group or files become corrupted, LGWR may terminate.  For example:

 Corrupted files:

Errors in file /apps/oravis/db/tech_st/10.2.0/admin/test/bdump/test_lgwr_25599.trc: 
ORA-00316: log 1 of thread 1, type 8944 in header is not log file

ORA-00312: online log 1 thread 1: '/oradata/dbf2/testdata/test/redo01.log'

LGWR: terminating instance due to error 316

Instance terminated by LGWR, pid = 25599



Missing files:

Errors in file /apps/oravis/db/tech_st/10.2.0/admin/test/bdump/test_lgwr_1434.trc: 
ORA-00320: cannot read file header from log 1 of thread 1

ORA-00312: online log 1 thread 1: '/oradata/dbf2/testdata/test/redo01.log'

ORA-27091: unable to queue I/O

ORA-27072: File I/O error

SVR4 Error: 11: Resource temporarily unavailable

Additional information: 4

Additional information: 1

LGWR: terminating instance due to error 320

Instance terminated by LGWR, pid = 1434




If LGWR terminates you have to recover the database:

    • If you are in ARCHIVELOG mode, perform an incomplete recovery up to the previous log file. 

    • If you are in NOARCHIVELOG, perform a complete recovery of the last cold backup.   



If the database is still online, you can try and clear the logfile group. If the command is not successful then you will need to recover.
























3 comments:

  1. i cant recover my database after deletion of all control files
    just after control files were deleted i did this
    >shut abort
    >startup mount
    >recover database using backup controlfile until cancel
    then using CLEAR command i recreated log groups
    and then appplied logs

    >alter database open RESETLOGS

    now it needs 'system01.dbf' recovery as the error is about inconsistancy of this file
    what to do now
    please help!

    ReplyDelete