日志如下:redo log 5无法归档,并且侦测到“写丢失”。最终导致Oracle宕机。 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判断是否真正发生了“写丢失”。 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使其恢复正常归档。
SQL> alter database clear unarchived logfile group 5;
按照以上步骤,朋友的Oracle数据库正常启动。 最后,不要忘记做一次全备份。
参考: Database Crashe with ORA-16038/ORA-742 Errors (文档 ID 2064718.1)