问题描述
ORA -0600报错:
Fri Feb 15 18:44:11 2019 Restarting dead background process CJQ0 Fri Feb 15 18:44:11 2019 CJQ0 started with pid=33, OS id=3992 Errors in file f:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_cjq0_3992.trc (incident=210531): ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], [], [], [], [], [] Errors in file f:\app\administrator\diag\rdbms\orcl\orcl\trace\orcl_cjq0_3992.trc (incident=210532): ORA-00600: internal error code, arguments: [600], [ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], [], [], [], [], [] ], [], [], [], [], [], [], [], [], [], []
专家解答
ORA-600 [kdsgrp1]错误通常在一些强制open数据库操作之后出现,以我过往的经验一般都是索引和表不一致导致的,可以很容易的模拟出ORA-600 [kdsgrp1]错误,如下所示:
测试过程如下:
SQL> create table t as select rownum a,rownum b from dual connect by rownum<=100; Table created. SQL> create index i_t1 on t(a); Index created. SQL> select a,DBMS_ROWID.ROWID_RELATIVE_FNO(a.ROWID) FILE_ID,DBMS_ROWID.ROWID_BLOCK_NUMBER(a.ROWID) BLOCK_ID from t a where a=1; A FILE_ID BLOCK_ID ---------- ---------- ---------- 1 1 34753
此时bbed手动删除a=1的行,bbed操作过程忽略不计。构造出索引与表不一致的情况。
SQL> select /*+full(t)*/ count(*) from t 2 union all 3 select /*+index(t)*/ count(*) from t where a is not null; COUNT(*) ---------- 99 100
此时通过a=1对索引进行访问,回表时发现行并不存在时就会报ORA-600 [kdsgrp1]
SQL> select /*+index(t)*/ * from t where a=1; select /*+index(t)*/ * from t where a=1 * ERROR at line 1: ORA-00600: internal error code, arguments: [kdsgrp1], [], [], [], [], [], [], [], [], [], [], []
trace会显示:
* kdsgrp1-1: ************************************************* row 0x004087c1.0 continuation at 0x004087c1.0 file# 1 block# 34753 slot 0 not found KDSTABN_GET: 0 ..... ntab: 1 curSlot: 0 ..... nrows: 100 kdsgrp - dump CR block dba=0x004087c1 Block header dump: 0x004087c1 Object id on Block? Y seg/obj: 0x39a5 csc: 0x00.10827c itc: 3 flg: - typ: 1 - DATA fsl: 0 fnx: 0x0 ver: 0x01
重建索引(一定要online哦)后报错消失:
SQL> alter index i_t1 rebuild online; Index altered. SQL> select /*+index(t)*/ * from t where a=1; no rows selected
所以你可以通过trace找出报错的对象,重建该对象所有的索引即可。
最后修改时间:2019-03-20 21:16:32
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。