1、数据库环境:
Oracle Database 11.2.0.3.0 for Oracle Linux Server release 6.4,RAC,虚拟机
2、巡检时发现某数据库alert.log日志报ORA-00600[13011]错误,报错频繁,虽然未导致数据库宕机,但已影响业务,报错如下:
[oracle@NODE1 trace]$ grep -i ora-00600 alert*.log|grep 13011 | sort -u
ORA-00600: : [13011], [321401], [33682485], [24], [33682485], [3], [], [], [], [], [], [] -- Tue Feb 06 00:07:53 开始报错
ORA-00600: : [13011], [321401], [33682485], [27], [33682485], [3], [], [], [], [], [], []
trace文件中信息:
从这里可以看出是对XXXXXMIN.XXX_XX_XX_XXX_OLD表进行DELEDE操作导致该错误发生
Dump continued from file: /u01/app/oracle/diag/rdbms/racdb/racdb1/trace/racdb1_ora_19795.trc
ORA-00600: [13011], [321401], [33682485], [27], [33682485], [3], [], [], [], [], [], []
========= Dump for incident 49853 (ORA 600 [13011]) ========
*** 2018-02-06 09:37:44.987
dbkedDefDump(): Starting incident default dumps (flags=0x2, level=3, mask=0x0)
----- Current SQL Statement for this session (sql_id=b6nmg0fpy3smf) -----
delete from "XXXXXMIN"."XXX_XX_XX_XXX_OLD" where "AX_ID" = :1
二、问题分析
1、MOS关于ORA 600 [13011]的描述:
Format: ORA-600 [13013] [a] [b] {c} [d] [e] [f] Arg
[a] Passcount Arg
[b] Data Object number Arg
{c} Tablespace Decimal Relative DBA (RDBA) of block containing the row to be updated Arg
[d] Row Slot number Arg
[e] Decimal RDBA of block being updated (Typically same as {c}) Arg
[f] Code
参考《 New and Improved: ORA-600 [13013] "Unable to get a Stable set of Records" (文档 ID 1438920.1)》和《ORA-600 [13013] "Unable to get a Stable set of Records" (文档 ID 28185.1)》文章。该报错是由于对某个表执行DML操作,该表对应的某个索引损坏导致的,解决的办法是找出操作的表和受损的索引,重建索引即可。
2、查找报错对象
根据ORA-00600 [13011], [321401], [33682485], [27], [33682485], [3]报错代码,查找报错对象:
select dbms_utility.data_block_address_file(33682485) rfile,dbms_utility.data_block_address_block(33682485) blocks from dual;
RFILE BLOCKS
---------- ----------
8 128053
select owner, segment_name, segment_type, tablespace_name, a.partition_name from dba_extents a where file_id = 8 and 128053 between block_id and block_id + blocks - 1;
OWNER SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME PARTITION_NAME
------------ ------------------------ ------------------ ---------------- --------------
XXXXXMIN XXX_XX_XX_XXX_OLD TABLE XXX
trace文件中信息:
BH (0xf60ee308) file#: 8 rdba: 0x0201f435 (8/128053) class: 1 ba: 0xf6c96000 --其对象XXXXXMIN.XXX_XX_XX_XXXXX_OLD与查询一致
set: 12 pool: 3 bsz: 8192 bsi: 0 sflg: 1 pwc: 0,25
dbwrid: 0 obj: 321401 objn: 321401 tsn: 8 afn: 8 hint: f
hash: [0x13ef9fd78,0x13ef9fd78] lru: [0xc900efb0,0xaf13f128]
ckptq: [NULL] fileq: [NULL] objq: [0x132d5a950,0x132d5a950] objaq: [0x132d5a940,0x132d5a940]
st: XCURRENT md: NULL fpin: 'kddwh01: kdddel' tch: 1 le: 0xcb0e3ee8
flags: remote_transfered
LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]
buffer tsn: 8 rdba: 0x0201f435 (8/128053) --与查询一致,其对象为XXXXXMIN.XXX_XX_XX_XXXXX_OLD
scn: 0x0001.084d4f80 seq: 0x01 flg: 0x06 tail: 0x4f800601
frmt: 0x02 chkval: 0x538d type: 0x06=trans data
Hex dump of block: st=0, typ_found=1
3、分析异常表
analyze table xxxxxmin.xxx_xx_xx_xxxxx_old validate structure cascade;
ERROR at line 1:
ORA-01499: table/index cross reference failure - see trace file –-根据文档 1499.1查找trace文件
OERR: ORA-1499 table/Index Cross Reference Failure - see trace file [ID 1499.1]
Error ORA-1499 is produced by statement "ANALIZE TABLE|CLUSTER VALIDATE STRUCTURE CASCADE" to report an inconsistency between a table or a cluster and its index where an index key value is not found in the index or vice versa.
The content of the trace file has:
: tsn: rdba:
description:
"row not found in index"
"Table/Index row count mismatch"
"row mismatch in index dba"
"Table row count/Bitmap index bit count mismatch"
"kdavls: kdcchk returns %d when checking cluster dba 0x%08lx objn %d\n"
tsn: Tablespace Number where the INDEX is stored.
rdba: Relative data block address of the INDEX segment header.
根据文档 1499.1查找trace文件未找到相应的报错。看来与文档描述的情况不同,需进一步分析。
4、根据ROWID分析
通过前面的分析知道ORA-600 [13013]该报错是由于表与索引之间的逻辑数据不一致导致。查询明确关联的索引: