语句如下
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)
修改隐性参数:
在语句遇到600错误是,一般个人建议对语句进行改造,避免问题,
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。