[20170512]ora-00600[2662]错误3.txt
--//前一阵子的测试:链接http://blog.itpub.net/267265/viewspace-2137424/
--//本想测试修改一些重要的信息块,结果提升了scn的结果,但是如果异常关闭,就没有这样的结果.
--//前几看http://www.itpub.net/thread-2087326-1-1.html
--//很奇怪看到的scn号减少的,理论讲出现这个错误,如果不断重启scn号每次加1,差距不大可以追上.
ORA-00600: 内部错误代码, 参数: [2662], [0], [20556827], [0], [20564324], [12583040], [], [], [], [], [], []
ORA-00600: 内部错误代码, 参数: [2662], [0], [20556826], [0], [20564324], [12583040], [], [], [], [], [], []
ORA-01092: ORACLE 实例终止。强制断开连接
ORA-00600: 内部错误代码, 参数: [2662], [0], [20556824], [0], [20564324], [12583040], [], [], [], [], [], []
--//但是看到是减少的,很奇怪.我自己模拟这样的情况,是否最后可以正常启动.
--//再次说明,绝不要在生产系统做这样的测试!!
1.环境:
SCOTT@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
--//另外说明一下在system文件块头中保存一个bootstrap$的段头地址。
BBED> p kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
> @ &r/dfb16 0x00400208
RFILE# BLOCK# TEXT
---------- ---------- ------------------------------------------------------------
1 520 alter system dump datafile 1 block 520 ;
--//oracle 通过system文件头读取kcvfhrdb,定位sys.bootstrap$信息,加载数据字典。
--//修改这个块dba=1,521块的scn大于块头,看看启动会发生什么?
2.通过bbed观察记录dba=1,521块的scn。
--//正常关闭数据库.
p dba 1,521 kcbh.bas_kcbh
p dba 1,521 ktbbh.ktbbhitl[0].ktbitbas
p dba 1,521 ktbbh.ktbbhcsc.kscnbas
BBED> p dba 1,521 kcbh.bas_kcbh
ub4 bas_kcbh @8 0x000001d7
BBED> p dba 1,521 ktbbh.ktbbhitl[0].ktbitbas
ub4 ktbitbas @64 0x000001d7
BBED> p dba 1,521 ktbbh.ktbbhcsc.kscnbas
ub4 kscnbas @28 0x00000173
SYS@book> SELECT file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE# , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name FROM v$datafile_header;
FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME CREATION_CHANGE# RESETLOGS_CHANGE# STATUS CHECKPOINT_COUNT FUZ NAME TABLESPACE_NAME
----- ------------------ ------------------- ---------------- ----------------- ------- ---------------- --- -------------------------------------------------- ------------------------------
1 13276968090 2017-05-12 10:25:45 7 925702 ONLINE 870 NO /mnt/ramdisk/book/system01.dbf SYSTEM
2 13276968090 2017-05-12 10:25:45 1834 925702 ONLINE 859 NO /mnt/ramdisk/book/sysaux01.dbf SYSAUX
3 13276968090 2017-05-12 10:25:45 923328 925702 ONLINE 780 NO /mnt/ramdisk/book/undotbs01.dbf UNDOTBS1
4 13276968090 2017-05-12 10:25:45 16143 925702 ONLINE 865 NO /mnt/ramdisk/book/users01.dbf USERS
5 13276968090 2017-05-12 10:25:45 952916 925702 ONLINE 776 NO /mnt/ramdisk/book/example01.dbf EXAMPLE
6 13276968090 2017-05-12 10:25:45 13276257767 925702 ONLINE 247 NO /mnt/ramdisk/book/tea01.dbf TEA
6 rows selected.
--//假设现在要修改块scn=13276968100.比文件头大10.
select 13276968100,trunc(13276968100/power(2,32)) scn_wrap,mod(13276968100,power(2,32)) scn_base from dual
13276968100 SCN_WRAP SCN_BASE SCN_WRAP16 SCN_BASE16
------------ ------------ ------------ ---------- ----------
13276968100 3 392066212 3 175e74a4
--//执行如下:(注测试库的scn wrap=3 ,也要修改)
assign dba 1,521 kcbh.bas_kcbh=392066212
assign dba 1,521 kcbh.wrp_kcbh=3
--//注意tailchk也要跟着修改,因为这部分包括{(bas_kcbh(低2字节))+(type_kcbh)+(seq_kcbh)}
BBED> p dba 1,521 tailchk
ub4 tailchk @8188 0x01d70601
BBED> assign dba 1,521 tailchk=0x074a40601
ub4 tailchk @8188 0x74a40601
--//补充说明一下,使用assign命令修改tailchk,如果第1个大于0x8,不能这样修改。例子:
BBED> assign dba 1,521 tailchk=0x8c000601
BBED-00207: invalid offset specifier (8c000601)
--//要执行如下,注意cpu类型,大小头问题。
BBED> modify /x 0x008c 8190
File: /mnt/ramdisk/book/system01.dbf (1)
Block: 521 Offsets: 8190 to 8191 Dba:0x00400209
--------------------------------------------------------------------------------------------------
008c
<64 bytes per line>
BBED> p dba 1,521 tailchk
ub4 tailchk @8188 0x8c000601
---//
BBED> sum apply dba 1,521
Check value for File 1, Block 521:
current = 0x45a7, required = 0x45a7
BBED> verify dba 1,521
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/system01.dbf
BLOCK = 521
--OK.现在dba=1,521 scn =13276968100 .
3.测试:
SYS@book> alter database open ;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-00704: bootstrap process failure
ORA-00600: internal error code, arguments: [2662], [3], [392066208], [3], [392066212], [4194825], [], [], [], [], [], []
Process ID: 9198
Session ID: 232 Serial number: 3
--//重新启动数据库到mount:
SYS@book> SELECT file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE# , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name FROM v$datafile_header where file#=1;
FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME CREATION_CHANGE# RESETLOGS_CHANGE# STATUS CHECKPOINT_COUNT FUZ NAME TABLESPACE_NAME
----- ------------------ ------------------- ---------------- ----------------- ------- ---------------- --- -------------------------------------------------- ------------------------------
1 13276968094 2017-05-12 10:32:15 7 925702 ONLINE 871 YES /mnt/ramdisk/book/system01.dbf SYSTEM
--//对比前面的scn 从13276968090 => 13276968094,增加4.
SYS@book> alter database open ;
Database altered.
--//这次open就正常了,没有报错..
SYS@book> select power(2,32)*3+392066208 from dual ;
POWER(2,32)*3+392066208
-----------------------
13276968096
SYS@book> @ &r/dfb10 4194825
RFILE# BLOCK#
------------ ------------
1 521
TEXT
----------------------------------------
alter system dump datafile 1 block 521 ;
--//也再次说明差距不大,重启几次就可以避开这个错误.再次想起以前的一次测试http://blog.itpub.net/267265/viewspace-2137424/.
--//那次我修改dba 1,225 就是undo$ 的数据块。结果提升了这个数据库的scn号.