[20170518]模拟ora-00600[2608]错误2.txt
--//以前模拟过ora-00600[2608]错误.链接http://blog.itpub.net/267265/viewspace-1680801/
--//当时基本按照刘工的帖子重复测试.按照刘工文章介绍:
该ORA-00600[2608]可能由数据文件头中记录的checkpoint scn过小造成,Oracle会将该checkpoint scn与块中的resetlogs scn以及控制
文件中记录的日志文件的Low scn相比较,若文件头中的checkpoint scn远小于对比值,那么就会出现ORA-00600[2608]内部错误。
下面我们通过修改数据文件头中kcvfhckp结构中记录的checkpoint scn到一个较小值,来模拟出发ORA-00600[2608]内部错误:
--//不过当时我为了测试使用bbed解决丢失的归档,链接http://blog.itpub.net/267265/viewspace-1676438/.
--//我数据文件的checkpoint scn不会小于resetlogs scn.而且并不是次次出现,今天重复原来的测试.
1.环境:
SYS@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
--//正常关闭数据库,重启到mount.
SYS@book> startup mount
ORACLE instance started.
Total System Global Area 634732544 bytes
Fixed Size 2255792 bytes
Variable Size 197133392 bytes
Database Buffers 427819008 bytes
Redo Buffers 7524352 bytes
Database mounted.
SYS@book> @ &r/logfile
GROUP# STATUS TYPE MEMBER IS_ GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
------ ---------- ---------- -------------------------------- --- ------ ------- --------- ----------- --------- ------- --- ---------- ------------- ------------------- ------------ -------------------
1 ONLINE /mnt/ramdisk/book/redo01.log NO 1 1 764 52428800 512 1 NO CURRENT 13277712320 2017-05-18 08:56:52 2.814750E+14
2 ONLINE /mnt/ramdisk/book/redo02.log NO 2 1 762 52428800 512 1 YES INACTIVE 13277651683 2017-05-17 20:23:55 13277663643 2017-05-17 22:00:19
3 ONLINE /mnt/ramdisk/book/redo03.log NO 3 1 763 52428800 512 1 YES INACTIVE 13277663643 2017-05-17 22:00:19 13277712320 2017-05-18 08:56:52
4 STANDBY /mnt/ramdisk/book/redostb01.log NO
5 STANDBY /mnt/ramdisk/book/redostb02.log NO
6 STANDBY /mnt/ramdisk/book/redostb03.log NO
7 STANDBY /mnt/ramdisk/book/redostb04.log NO
7 rows selected.
--//最小的scn是group#=2,FIRST_CHANGE#=13277651683.
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 13277716139 2017-05-18 09:46:41 7 925702 ONLINE 953 NO /mnt/ramdisk/book/system01.dbf SYSTEM
2 13277716139 2017-05-18 09:46:41 1834 925702 ONLINE 942 NO /mnt/ramdisk/book/sysaux01.dbf SYSAUX
3 13277716139 2017-05-18 09:46:41 923328 925702 ONLINE 863 NO /mnt/ramdisk/book/undotbs01.dbf UNDOTBS1
4 13277716139 2017-05-18 09:46:41 16143 925702 ONLINE 948 NO /mnt/ramdisk/book/users01.dbf USERS
5 13277716139 2017-05-18 09:46:41 952916 925702 ONLINE 859 NO /mnt/ramdisk/book/example01.dbf EXAMPLE
6 13277716139 2017-05-18 09:46:41 13276257767 925702 ONLINE 333 NO /mnt/ramdisk/book/tea01.dbf TEA
6 rows selected.
--//我修改数据文件6的CHECKPOINT_CHANGE#=13277651680,看看.
2.bbed修改:
select 13277716139,trunc(13277716139/power(2,32)) scn_wrap,mod(13277716139,power(2,32)) scn_base from dual
13277716139 SCN_WRAP SCN_BASE SCN_WRAP16 SCN_BASE16
------------ ------------ ------------ ---------- ----------
13277716139 3 392814251 3 1769deab
select 13277651680,trunc(13277651680/power(2,32)) scn_wrap,mod(13277651680,power(2,32)) scn_base from dual
13277651680 SCN_WRAP SCN_BASE SCN_WRAP16 SCN_BASE16
------------ ------------ ------------ ---------- ----------
13277651680 3 392749792 3 1768e2e0
BBED> p dba 6,1 kcvfh.kcvfhckp.kcvcpscn
struct kcvcpscn, 8 bytes @484
ub4 kscnbas @484 0x1769deab
ub2 kscnwrp @488 0x0003
BBED> assign dba 6,1 kcvfh.kcvfhckp.kcvcpscn.kscnbas=0x1768e2e0
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub4 kscnbas @484 0x1768e2e0
BBED> sum apply dba 6,1
Check value for File 6, Block 1:
current = 0x164f, required = 0x164f
BBED> verify dba 6,1
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/tea01.dbf
BLOCK = 1
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 13277716139 2017-05-18 09:46:41 7 925702 ONLINE 953 NO /mnt/ramdisk/book/system01.dbf SYSTEM
2 13277716139 2017-05-18 09:46:41 1834 925702 ONLINE 942 NO /mnt/ramdisk/book/sysaux01.dbf SYSAUX
3 13277716139 2017-05-18 09:46:41 923328 925702 ONLINE 863 NO /mnt/ramdisk/book/undotbs01.dbf UNDOTBS1
4 13277716139 2017-05-18 09:46:41 16143 925702 ONLINE 948 NO /mnt/ramdisk/book/users01.dbf USERS
5 13277716139 2017-05-18 09:46:41 952916 925702 ONLINE 859 NO /mnt/ramdisk/book/example01.dbf EXAMPLE
6 13277651680 2017-05-18 09:46:41 13276257767 925702 ONLINE 333 NO /mnt/ramdisk/book/tea01.dbf TEA
--//ok,现在已经修改完成.
3.打开看看:
SYS@book> alter database open ;
alter database open
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [3619], [1], [0], [], [], [], [], [], [], [], [], []
SYS@book> recover database ;
ORA-00283: recovery session canceled due to errors
ORA-00600: internal error code, arguments: [2608], [1], [3], [392749792], [3], [392810432], [], [], [], [], [], []
--参数说明:
--第2个参数1,标识log group#当前组(我猜测的)
--第3个参数wrap,第4个参数base scn. 文件头CHECKPOINT_CHANGE#.
--第5个参数wrap,第6个参数base scn. 这个值是log group# =1 ,FIRST_CHANGE#.
SYS@book> select power(2,32)*3+392810432 from dual;
POWER(2,32)*3+392810432
-----------------------
13277712320
4.还原正常:
BBED> assign dba 6,1 kcvfh.kcvfhckp.kcvcpscn.kscnbas=0x1769deab
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
ub4 kscnbas @484 0x1769deab
BBED> sum apply dba 6,1
Check value for File 6, Block 1:
current = 0x335d, required = 0x335d
BBED> verify dba 6,1
DBVERIFY - Verification starting
FILE = /mnt/ramdisk/book/tea01.dbf
BLOCK = 1
SYS@book> alter database open ;
Database altered.
--//说明文件头中的checkpoint scn远小于当前redo 的的scn,就出现问题.