暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle数据恢复:ORA-00600 6002错误的解决

原创 盖国强 2019-05-08
636

问题描述

在数据库恢复之后,经常会遇到如下ORA-600 6002错误,这属于常见的,可以分析消除的错误之一。

以下是最近在用户数据恢复中遇到的错误:

*** 2012-03-08 13:56:04.178
ksedmp: internal or fatal error
ORA-00600: internal error code, arguments: [6002], [0], [0], [4], [0], [], [], []
----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
57cce5a18       418  package body SYS.DBMS_HA_ALERTS_PRVT
57cce5a18       552  package body SYS.DBMS_HA_ALERTS_PRVT


专家解答

错误现实,在执行SYS.DBMS_HA_ALERTS_PRVT包的内部任务时出现问题。
而 ORA-00600 6002 错误和索引相关,具体内容是指:
当Oracle试图去插入一个索引键值时,首先需要找到合适的位置,并且去进行相关校验,校验内容包括索引列数量、数据大小等,一旦发现不一致,则将出现ORA-600 的 6002错误。

MOS上的解释如下:

Oracle was trying to insert a key and key data into a b*tree index.   
In order to do this, it had to first find the correct leaf block to   do the insert.    
Once the correct leaf block is retrieved, Oracle validates the block  by checking the data size and number of columns in the key.    
If there is a mismatch then ORA-600 [6002] is reported.

其主要的参数含义如下:

Arg [a] Number of bytes in keydata    
Arg [b] Number of bytes in the index layer of the leaf header   
Arg [c] Number of columns in index search key structure   
Arg [d] Number of columns in the index layer fo the leaf header

所以如果遇到这个错误,首先应该找到出现问题的索引对象,可以尝试通过重建索引消除这个错误影响。
如下是跟踪文件中体现的出现错误的块头信息:

Block header dump:  0x00c086ed
 Object id on Block? Y
 seg/obj: 0x22a9  csc: 0x00.1c87691f  itc: 12  flg: E  typ: 2 - INDEX
     brn: 0  bdba: 0xc086e9 ver: 0x01 opc: 0
     inc: 0  exflg: 0
 
 Itl           Xid                  Uba         Flag  Lck        Scn/Fsc
0x01   0x000a.016.00045449  0x0080027f.4951.02  C---    0  scn 0x0000.0b0c478c
0x02   0x0014.00e.000aadce  0x01000b9f.67ea.26  C---    0  scn 0x0000.1c876660
0x03   0x0014.01b.000aada1  0x01000b9f.67ea.17  C---    0  scn 0x0000.1c87653d
0x04   0x000a.002.000e628d  0x00800247.6ebe.29  C---    0  scn 0x0000.1c87691e
0x05   0x0034.00e.00000270  0x010061c8.00c6.11  ----    1  fsc 0x0000.00000000
0x06   0x0009.01d.0001e6dc  0x0080008a.8128.37  --U-    1  fsc 0x0031.1c876923
0x07   0x0008.017.0001d3c2  0x00800080.8857.26  C---    0  scn 0x0000.1c87613a
0x08   0x0002.02b.0001720e  0x00801355.7ebb.1f  C---    0  scn 0x0000.1c87654d
0x09   0x000a.01f.000e6254  0x00800245.6ebe.0e  C---    0  scn 0x0000.1c87683c
0x0a   0x0009.004.0001e89d  0x0080008a.8128.30  C---    0  scn 0x0000.1c876841
0x0b   0x000a.00a.000e6279  0x0080023f.6ebe.08  C---    0  scn 0x0000.1c87666a
0x0c   0x000a.011.000e6252  0x0080022f.6ebe.3e  C---    0  scn 0x0000.1c87613e

我们可以看到出现问题的对象号是22a9,类型正是索引。
通过数据库查询可以找到这个对象名称,通过重建索引即可解决:

QL> select object_name from dba_objects where object_id=to_number('22a9','xxxxx');

OBJECT_NAME
------------------------------------------------------------------------------------------------------------------------
WRI$_ALERT_THRESHOLD_LOG_PK

SQL> alter index WRI$_ALERT_THRESHOLD_LOG_PK rebuild online;

Index altered.

6002错误需要根据对象的不同进行分析,通常是可以通过索引重建解决的。有时候问题会出现在IOT对象上,可以通过备份数据,TRUNCATE再INSERT回插记录解决。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论