非正常关机REDOLOG损坏数据库无法正常打开
测试库服务器由于非正常关机,导致数据库无法正常打开,查看alert日志如下:
Mon May 25 15:36:51 2020
alter database mount
Mon May 25 15:36:55 2020
Successful mount of redo thread 1, with mount id 2938166995
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: alter database mount
Mon May 25 15:37:10 2020
alter database open
Mon May 25 15:37:10 2020
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_lgwr_5557.trc:
ORA-00322: log 1 of thread 1 is not current copy
ORA-00312: online log 1 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo01.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_lgwr_5557.trc:
ORA-00322: log 1 of thread 1 is not current copy
ORA-00312: online log 1 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo01.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_ora_5568.trc:
ORA-00322: log 1 of thread is not current copy
ORA-00312: online log 1 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo01.rdo'
USER (ospid: 5568): terminating the instance due to error 322
Mon May 25 15:37:10 2020
System state dump requested by (instance=1, osid=5568), summary=[abnormal instance termination].
System State dumped to trace file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_diag_5547_20200525153710.trc
Dumping diagnostic data in directory=[cdmp_20200525153710], requested by (instance=1, osid=5568), summary=[abnormal instance termination].
Instance terminated by USER, pid = 5568
/opt/oradata/SCPRDI1/SCPRDI1_redo01.rdo redo日志文件损坏了
处理方法:
1、shutdown immediate;
2、startup mount;
3、alter database clear logfile /opt/oradata/SCPRDI1/SCPRDI1_redo01.rdo';
4、alter database open;
又出现如下报错,日志文件都损坏了。
Mon May 25 15:43:21 2020
alter database open
Mon May 25 15:43:22 2020
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_lgwr_5605.trc:
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo02.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_lgwr_5605.trc:
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo02.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_ora_5621.trc:
ORA-00322: log 1 of thread is not current copy
ORA-00312: online log 2 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo02.rdo'
USER (ospid: 5621): terminating the instance due to error 322
Mon May 25 15:43:22 2020
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_m000_5652.trc:
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo02.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_m000_5652.trc:
ORA-00322: log 3 of thread 1 is not current copy
ORA-00312: online log 3 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo03.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_m000_5652.trc:
ORA-00322: log 4 of thread 1 is not current copy
ORA-00312: online log 4 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo04.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_m000_5652.trc:
ORA-00322: log 5 of thread 1 is not current copy
ORA-00312: online log 5 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo05.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_m000_5652.trc:
ORA-00322: log 6 of thread 1 is not current copy
ORA-00312: online log 6 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo06.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_m000_5652.trc:
ORA-00322: log 7 of thread 1 is not current copy
ORA-00312: online log 7 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo07.rdo'
Errors in file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_m000_5652.trc:
ORA-00322: log 8 of thread 1 is not current copy
ORA-00312: online log 8 thread 1: '/opt/oradata/SCPRDI1/SCPRDI1_redo08.rdo'
Checker run found 14 new persistent data failures
Mon May 25 15:43:22 2020
System state dump requested by (instance=1, osid=5621), summary=[abnormal instance termination].
System State dumped to trace file /oracle/app/diag/rdbms/scprdi1/SCPRDI1/trace/SCPRDI1_diag_5595_20200525154322.trc
Dumping diagnostic data in directory=[cdmp_20200525154322], requested by (instance=1, osid=5621), summary=[abnormal instance termination].
Instance terminated by USER, pid = 5621
将其余redo日志文件clear后,正常open。
alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo02.rdo'
Clearing online log 2 of thread 1 sequence number 2
Mon May 25 15:47:29 2020
Warning: VKTM detected a time drift.
Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.
Completed: alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo02.rdo'
Mon May 25 15:47:34 2020
alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo03.rdo'
Clearing online log 3 of thread 1 sequence number 3
Completed: alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo03.rdo'
Mon May 25 15:47:45 2020
alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo04.rdo'
Thread 1 advanced to log sequence 5 (preparation to clear logfile)
Clearing online log 4 of thread 1 sequence number 4
Completed: alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo04.rdo'
Mon May 25 15:47:57 2020
alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo05.rdo'
Clearing online log 5 of thread 1 sequence number 0
Completed: alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo05.rdo'
Mon May 25 15:48:07 2020
alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo06.rdo'
Clearing online log 6 of thread 1 sequence number 0
Completed: alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo06.rdo'
Mon May 25 15:48:18 2020
alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo07.rdo'
Clearing online log 7 of thread 1 sequence number 0
Completed: alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo07.rdo'
Mon May 25 15:48:32 2020
alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo08.rdo'
Clearing online log 8 of thread 1 sequence number 0
Completed: alter database clear logfile '/opt/oradata/SCPRDI1/SCPRDI1_redo08.rdo'
Mon May 25 15:48:56 2020
alter database open
Mon May 25 15:48:56 2020
Thread 1 opened at log sequence 5
Current log# 1 seq# 5 mem# 0: /opt/oradata/SCPRDI1/SCPRDI1_redo01.rdo
Successful open of redo thread 1
参考文章
Redo丢失的4种情况及处理方法 http://blog.itpub.net/23135684/viewspace-626935/