Oracle数据库6TB数据量的恢复_undo回滚段与redo重做日志损坏后的恢复
Oracle数据库undo回滚段与redo在线重做日志损坏后的恢复
一套3个节点的Oracle 10g RAC,数据量有6TB左右的历史库,存储损坏后Oracle数据库宕机,待存储修复后发现Oracle数据库的归档日志全部丢失,而且备份也是失败的,undo回滚段损坏,需要做recover,当执行recover datafile 2时,发现redo在线重做日志也是损坏的,报错日志如下:
SQL> startup mount
ORACLE instance started.
Total System Global Area 1.0737E+10 bytes
Fixed Size 22304400bytes
Variable Size 2781525360 bytes
Database Buffers 8852126720 bytes
Redo Buffers 14659584 bytes
Database mounted.
Ora-01113:file 2 needs media recovery if it was restored from backup, or END
BACKUP if it was not
ORA-01110: data file 2: '+DGDATA/rac/datafile/undotbs1.260.748463909
SQL> recover datafile 2;ORA-00283: recovery session canceled due to errorsORA-00314: log 6 of thread 1, expected sequence# 15298 doesn't match 15303ORA-00312: online log 6 thread 1: '+DGSYSTEM/rac/onlinelog/group_6.317.748865259'ORA-00314: log 6 of thread 1, expected sequence# 15298 doesn't match 15303ORA-00312: online log 6 thread 1: '+DGSYSTEM/rac/onlinelog/group_6.262.748864979'
通过一系列非常规手段后,终于强行把数据库打开,大致处理过程如下:首先备份并清理损坏的在线重做日志文件,分别在不同阶段加入以下参数,*.undo_management='MANUAL',*._allow_error_simulation=true,*._allow_resetlogs_corruption=true相关参数来强行屏蔽相关报错强制打开数据库,最终出现了ORA-00600[2662]的报错,通过多次尝试后,最终通过ORA-00600[2662]的Arg [d] dependent SCN BASE的计算,使用参数alter session set events '10015 trace name adjust_scn level 20';将SCN向前推进20亿,将数据库强行打开。
然后新建undo表空间,再删除损坏的undo表空间后,数据库正常重启OK,但是后台日志报了大量ORA-00600报错,因此立即全库导出数据并重建,再将备份的redo重做日志文件中的部分数据进行挖掘抽取后插入新库中,本次处理过程及重建过程花了近一周时间,最终完成了本次数据的恢复。