1. 程式人生 > 實用技巧 >Oracle-線上日誌不能歸檔引起例項故障

Oracle-線上日誌不能歸檔引起例項故障

問題現象

Fri Jul 10 09:20:52 2020
ARC3 started with pid=37, OS id=18813 
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
ARCH: All Archive destinations made inactive due to error 742
ARCH: Closing local archive destination LOG_ARCHIVE_DEST_1: '+ARCH/orcl/archivelog/2020_07_10/thread_1_seq_108.314.1045387253' (error 742) (orcl1)
Committing creation of archivelog '+ARCH/orcl/archivelog/2020_07_10/thread_1_seq_108.314.1045387253' (error 742)
Errors in file /apps/oracle/database/diag/rdbms/orcl/orcl1/trace/orcl1_ora_18748.trc:
ORA-16038: log 2 sequence# 108 cannot be archived
ORA-00742: Log read detects lost write in thread %d sequence %d block %d
ORA-00312: online log 2 thread 1: '+DATADG/orcl/onlinelog/group_2.262.947153355'
USER (ospid: 18748): terminating the instance due to error 16038
NOTE: dependency between database orcl and diskgroup resource ora.ARCH.dg is established
System state dump requested by (instance=1, osid=18748), summary=[abnormal instance termination].
System State dumped to trace file /apps/oracle/database/diag/rdbms/orcl/orcl1/trace/orcl1_diag_18688_20200710092052.trc
Dumping diagnostic data in directory=[cdmp_20200710092052], requested by (instance=1, osid=18748), summary=[abnormal instance termination].
Instance terminated by USER, pid = 18748

從DB例項alert日誌,發現在group 2日誌檔案'+DATADG/orcl/onlinelog/group_2.262.947153355'不能建立歸檔日誌檔案導致例項啟動失敗

處理

startup mount;
alter system dump logfile '+DATADG/orcl/onlinelog/group_2.262.947153355' validate;

set lines 168 pages 99
col member for a80
select group#,member,status,type from v$logfile;

alter database clear unarchived logfile group 2;

最後,需要重新做全備(因之前的序列號已經不連續,舊備份一不可用)