ORA-16038/ORA-00742: Log read detects lost write in thread %d sequence %d block %d
2,789 total views, 1 views today
朋友遇到Oracle数据库的 REDO LOG 写丢失,造成数据库,且无法启动。
日志如下:redo log 5无法归档,并且侦测到“写丢失”。最终导致Oracle宕机。
1 2 3 4 5 6 7 8 |
Errors in file /u01/app/oracle/diag/rdbmsdbcontrol/GZDBCONTROL/trace/GZDBCONTROL_ora_32198.trc: ORA-16038: log 5 sequence# 23 cannot be archived ORA-00742: Log read detects lost write in thread %d sequence %d block %d ORA-00312: online log 5 thread 1: '/u01/app/oracle/fast_recovery_area/GZDBCONTROL/onlinelog/o1_mf_5_d61ctj3y_.log' USER (ospid: 32198): terminating the instance due to error 16038 System state dump requested by (instance=1, osid=32198), summary=[abnormal instance termination]. System State dumped to trace file /u01/app/oracle/diag/rdbmsdbcontrol/GZDBCONTROL/trace/GZDBCONTROL_diag_32167_20161227110109.trc Dumping diagnostic data in directory=[cdmp_20161227110109], requested by (instance=1, osid=32198), summary=[abnormal instance termination]. |
问题原因:
这三种清空都可能导致“写丢失”发生:操作系统、存储系统、Oracle内部错误。
解决办法:
使用dump判断redo logfile是否真正发生了”写丢失”。
1 2 3 4 5 6 |
SQL> alter system dump logfile '/u01/app/oracle/fast_recovery_area/GZDBCONTROL/onlinelog/o1_mf_5_d61ctj3y_.log' validate; ERROR at line 1: ORA-00742: Log read detects lost write in thread %d sequence %d block %d ORA-00334: archived log: '/u01/app/oracle/fast_recovery_area/GZDBCONTROL/onlinelog/o1_mf_5_d61ctj3y_.log' |
从上面dump的结果确认发生了”写丢失”,清空问题redo logfile使其恢复正常归档。
1 |
SQL> alter database clear unarchived logfile group 5; |
按照以上步骤,朋友的Oracle数据库正常启动。
最后,不要忘记做一次全备份。
参考:
Database Crashe with ORA-16038/ORA-742 Errors (文档 ID 2064718.1)
http://docs.oracle.com/cd/E11882_01/server.112/e17766/e0.htm