Oracle的redo log在各场景下的恢复(5)

Total System Global Area 3207790592 bytes
 Fixed Size 2119072 bytes
 Variable Size 381586016 bytes
 Database Buffers 2818572288 bytes
 Redo Buffers 5513216 bytes
 Database mounted.
 ORA-00316: log 2 of thread 1, type 0 in header is not log file
 ORA-00312: online log 2 thread 1: '/kttest1-1_data1/emsdev/redo02.dbf'


 SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
 ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- ---------
 1 1 4 104857600 1 YES INACTIVE 1.2792E+13 04-JUN-14
 3 1 5 104857600 1 YES INACTIVE 1.2792E+13 04-JUN-14
 2 1 6 104857600 1 NO CURRENT 1.2792E+13 04-JUN-14


 SQL> conn /as sysdba
 Connected.
 SQL> shutdown immediate
 ORA-01109: database not open


 Database dismounted.
 ORACLE instance shut down.

在pfile文件中加入两个参数:
*._allow_resetlogs_corruption=true
 *._allow_error_simulation=true

SQL> startup
 ORACLE instance started.

Total System Global Area 3207790592 bytes
 Fixed Size 2119072 bytes
 Variable Size 381586016 bytes
 Database Buffers 2818572288 bytes
 Redo Buffers 5513216 bytes
 Database mounted.
 ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


 SQL> recover database until cancel;
 ORA-00279: change 12792226298118 generated at 06/04/2014 14:21:06 needed for
 thread 1
 ORA-00289: suggestion : /kttest1-1_data1/emsdev/arch/1_6_849351843.arch
 ORA-00280: change 12792226298118 for thread 1 is in sequence #6


 Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
 auto
 ORA-00308: cannot open archived log
 '/kttest1-1_data1/emsdev/arch/1_6_849351843.arch'
 ORA-27037: unable to obtain file status
 SVR4 Error: 2: No such file or directory
 Additional information: 3


 ORA-00308: cannot open archived log
 '/kttest1-1_data1/emsdev/arch/1_6_849351843.arch'
 ORA-27037: unable to obtain file status
 SVR4 Error: 2: No such file or directory
 Additional information: 3


 ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
 ORA-01194: file 1 needs more recovery to be consistent
 ORA-01110: data file 1: '/kttest1-1_data1/emsdev/system01.dbf'


 SQL> alter database open resetlogs;
 alter database open resetlogs
 *
 ERROR at line 1:
 ORA-01092: ORACLE instance terminated. Disconnection forced
 Process ID: 16850
 Session ID: 166 Serial number: 3


检查alert.log发现如下报错:
Errors in file /oracle/emsdev/diag/rdbms/emsdev1/emsdev1/trace/emsdev1_ora_16850.trc (incident=107308):
 ORA-00600: internal error code, arguments: [2662], [2978], [1813690638], [2978], [1813691502], [4194432], [], [], [], [], [], []
 Incident details in: /oracle/emsdev/diag/rdbms/emsdev1/emsdev1/incident/incdir_107308/emsdev1_ora_16850_i107308.trc
 Wed Jun 04 14:38:11 2014
 Errors in file /oracle/emsdev/diag/rdbms/emsdev1/emsdev1/trace/emsdev1_ora_16850.trc:
 ORA-00600: internal error code, arguments: [2662], [2978], [1813690638], [2978], [1813691502], [4194432], [], [], [], [], [], []
 Error 600 happened during db open, shutting down database
 USER (ospid: 16850): terminating the instance due to error 600
 Instance terminated by USER, pid = 16850
 ORA-1092 signalled during: alter database open resetlogs...
 ORA-1092 : opiodr aborting process unknown ospid (16850_1)
 Wed Jun 04 14:38:15 2014
 ORA-1092 : opitsk aborting process


 /* 如出现ora-00600 [2662]报错,需要推进scn。推进方法如下:

ORA-600 [2662] [a] [b] [c] [d] [e]

Arg [a] Current SCN WRAP
 Arg [b] Current SCN BASE
 Arg [c] dependent SCN WRAP
 Arg [d] dependent SCN BASE
 Arg [e] Where present this is the DBA where the dependent SCN came from.

算法计算规则如下:Arg [c]*4得出一个数值,假设为V_Wrap,
如果Arg [d]=0,则V_Wrap值为需要的level
 Arg [d] < 1073741824,V_Wrap+1为需要的level
 Arg [d] < 2147483648,V_Wrap+2为需要的level
 Arg [d] < 3221225472,V_Wrap+3为需要的level

数据库处于mount状态下,执行:alter session set events '10015 trace name adjust_scn level 1';

再alter database open;

可以检查v$datafile与v$datafile_header的substr(checkpoint_change#,1,14)大小相同 */


按以上方法计算出需要推进的scn大小为11914


 session 1:
 SQL> conn /as sysdba
 Connected to an idle instance.
 SQL> startup mount
 ORACLE instance started.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/a18f509956a427c366160a3189765dc3.html