首先是掌握如下概念:
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.
下面是实例:
今天在起数据库时发生下面错误
Errors in file /oracle/admin/monster/udump/monster_ora_2512.trc:
ORA-00600: internal error code, arguments: [2662], [2048], [3054358], [2048], [3054392], [4194313], [], []
把4194313转换成DBA就是DBA = 4194313 => 1 0000000000000000001001 => DBA 1, 9
然后用BBED
BBED> map /v dba 1,9
File: /oracle/oradata/monster/system01.dbf (1)
Block: 9 Dba:0x00400009
------------------------------------------------------------
Unlimited Undo Segment Header
BBED> p kcbh
struct kcbh, 20 bytes @0
ub1 type_kcbh @0 0x0e
ub1 frmt_kcbh @1 0xa2
ub1 spare1_kcbh @2 0x00
ub1 spare2_kcbh @3 0x00
ub4 rdba_kcbh @4 0x00400009
ub4 bas_kcbh @8 0x002e9b38
ub2 wrp_kcbh @12 0x0800
ub1 seq_kcbh @14 0x01
ub1 flg_kcbh @15 0x04 (KCBHFCKV)
ub2 chkval_kcbh @16 0x0dd6
ub2 spare3_kcbh @18 0x0000
BBED> p bas_kcbh
ub4 bas_kcbh @8 0x002e9b38
BBED> d
File: /oracle/oradata/monster/system01.dbf (1)
Block: 9 Offsets: 8 to 519 Dba:0x00400009
------------------------------------------------------------------------
389b2e00 00080104 d60d0000 00000000 00000000 00000000 00000000 15000000
根据错误信息
ORA-00600: internal error code, arguments: [2662], [2048], [3054358], [2048], [3054392], [4194313], [], []3054358 =>
3054358 => 2E9B16
BBED> m /x 169b2e00
File: /oracle/oradata/monster/system01.dbf (1)
Block: 9 Offsets: 8 to 519 Dba:0x00400009
------------------------------------------------------------------------
169b2e00 00080104 d60d0000 00000000 00000000 00000000 00000000 15000000
BBED> p bas_kcbh
ub4 bas_kcbh @8 0x002e9b16
BBED> p tailchk
ub4 tailchk @8188 0x9b380e01
BBED> m /x 010e169b
File: /oracle/oradata/monster/system01.dbf (1)
Block: 9 Offsets: 8188 to 8191 Dba:0x00400009
------------------------------------------------------------------------
010e169b
然后
startup mount
recover database until cancel
cancel
alter database open resetlogs;
就成功把数据库起来了。
总结:
解决2662错误常用的是
alter session set events '10015 trace name adjust_scn level 1‘;
但有时会出现ORA-01031: insufficient privileges 错误,
你只能不断地重起DB来到达SCN的同步,但用BBED一次就可手动同步SCN