温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

使用ROWNUM解决 ORA-00600:内部错误代码

发布时间:2020-08-16 02:00:08 来源:ITPUB博客 阅读:240 作者:pingdanorcale 栏目:关系型数据库

开发人员在执行语句执行是报ORA-00600:内部错误代码

语句如下

create   tablesytab01   as
select    a.*  from tab1 c,
( select b.*  from tab2 s,
select a.*,row_number()over( partition  by cl  order by cl_name ) rn
     from tab3 a  wherea.area_no=
'aa'
    ) a
where  trim(s.home_cl)= trim(a.cl)  and rn=
'1'   and
   month=
'201703'
and s.area =
'aa'
)b
where c.user_no = b.user_no

数据库版本如下:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bitProduction

With the Partitioning, Real Application Clusters, Automatic StorageManagement, OLAP,

Data Mining and Real Application Testing options

数据库日志报如下错误:

*** 2017-03-23 17:59:14.729

*** SESSION ID:(2191.15425) 2018-04-23 17:59:14.729

*** CLIENT ID:() 2018-04-23 17:59:14.729

*** SERVICE NAME:(hbdw) 2018-04-23 17:59:14.729

*** MODULE NAME:(PL/SQL Developer) 2018-04-23 17:59:14.729

*** ACTION NAME:(SQL  窗口 - 新建) 2018-04-23 17:59:14.729

Incident 258636 created, dump file:/u01/app/oracle/diag/rdbms/hbdw/hbdw1/incident/incdir_258636/orcl1_ora_11899_i258636.trc

ORA-00600:  内部错误代码, 参数: [rwoirw: check ret val], [], [], [], [], [], [], [], [], [], [],[]

此incdir_258636/orcl1_ora_11899_i258636.trc日志报错如下:

----- Call Stack Trace -----

calling              call     entry                argument values in hex     

location             type     point               (? means dubiousvalue)    

-------------------- -------- ------------------------------------------------

skdstdst()+41        call     kgdsdst()            000000000 ? 000000000 ?

                                                  7FFFFFFEBC30 ? 7FFFFFFEBD08 ?

                                                  7FFFFFFF07B0 ? 000000002 ?

ksedst1()+103        call     skdstdst()           000000000 ? 000000000 ?

                                                  7FFFFFFEBC30 ? 7FFFFFFEBD08 ?

                                                  7FFFFFFF07B0 ? 000000002 ?

ksedst()+39          call     ksedst1()            000000000 ? 000000001 ?

                                                  7FFFFFFEBC30 ? 7FFFFFFEBD08 ?

                                                   7FFFFFFF07B0 ?000000002 ?

dbkedDefDump()+2746  call     ksedst()             000000000 ? 000000001 ?

                                                  7FFFFFFEBC30 ? 7FFFFFFEBD08 ?

                                                  7FFFFFFF07B0 ? 000000002 ?

ksedmp()+41          call     dbkedDefDump()       000000003 ? 000000002 ?

                                                  7FFFFFFEBC30 ? 7FFFFFFEBD08 ?

                                                  7FFFFFFF07B0 ? 000000002 ?

因为由于是语句引起的,分析思路如下:

1. 看看只做查询有没有此问题。

select    a.* from tab1 c,

(select b.* from tab2 s,

( select a.*,row_number()over(partition by cl order by cl_name ) rn

    from tab3 a where a.area_no='aa'

    ) a

where trim(s.home_cl)=trim(a.cl) and rn='1' and

   month='201703'

and s.area ='aa'

)b

where c.user_no = b.user_no

有结果输出,查询正常

2. 从上边的结果可知,应该不是查询引起的问题。

突然想到难道是临时表的数量太多了导致的?然后尝试后面添加rownum< 1000; 手动执行create sql语句结果成功了。

3. 用rownum 解决此问题

想了一下,可能11.2.0.4里面对create tablexxx as select …. From …的限制比较严格(没有经过论证,也可能是个bug),意味着在不知道后面的select … from …的总体数量的情况下或者数量已经超过了oracle的默认值比如1000这样,会提示ORA-00600的错误。按照这个思路我查询出来select … from ..的总数量,在后面加上and rownum<6000;再次执行居然成功了。

  想了想按照测试的边界值理论,一个最大值能有结果,那就尝试下最小值,在条件上加and rownum>-1;(因为有可能select 出来空记录)呢?执行了一下居然成功,语句修改如下:

create  table sytab01  as
select    a.* fromtab1 c,
(select b.* from tab2 s,
( select a.*,row_number()over(partition by cl order by cl_name ) rn
    from tab3 a wherea.area_no=
'aa'
    ) a
where trim(s.home_cl)=trim(a.cl)and rn=
'1'  and
   month=
'201703'
and s.area =
'aa'
)b
where c.user_no = b.user_no

and rownum>-1

4. 关于官方文档对ora-600的描述如下:

Bug 14275161 - ORA-600[rwoirw: check ret val] on CTAS with predicate move around ( 文档  ID 14275161.8)

使用ROWNUM解决 ORA-00600:内部错误代码

修改隐性参数:

在语句遇到600错误是,一般个人建议对语句进行改造,避免问题,

除非有比较多的语句影响到数据库。一般不建议对数据库做手术。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI