Wednesday, October 11, 2006

Database Hangs for DML Activity ORA-16038, ORA-00354, ORA-00312

fact: Oracle Server - Enterprise Edition 8.1.7.4.0
fact: Oracle Server - Enterprise Edition 9.0.1
fact: Oracle Server - Enterprise Edition 9.2
symptom: Database Hangs for DML Activity ORA-16038, ORA-00354, ORA-00312
symptom: Database hangs for dml (insert, update and delete) activity
symptom: ORA-16038: log %s sequence# %s cannot be archived
symptom: ORA-00354: corrupt redo log block header
symptom: ORA-00312: online log %s thread %s: '%s'
cause: Most probable a hardware failure caused an online redolog corruption.

If database is open then try for log number that is corrupted (check from error or v$log):
1 alter database clear logfile group ;
When not working (unlikely to succeed) then:

2 alter database clear unarchived logfile group ;
If this is successfully, the db is running (not hanging for dml activity anymore) but you miss an archive. This means you have to make a backup first, as long as the backup is not complete you cannot perform media recovery using previous backup as you miss an archive.

3 if 1 and 2 both do not work you will have to perform an incomplete recovery(注1). Shutdown db, restore all datafiles (only datafiles) of a backup and startup mount and issue recover database until cancel and recover until corrupted logfile, then open with alter database open resetlogs; You have dataloss (last corrupted logfile) and you first have to make a new backup after db opens).If the database is closed and cannot be opened you only have option 3.


注1:
以上是metalink提供的解决办法,缺点是情况3时会丢失数据。
实际情况中发生类似3的时候,如果能够正常关闭数据库(immediate),可以先冷备数据库,尝试不用restore,直接recover database until cancel,然后open resetlogs。
这样不会丢失数据。

No comments: