您好,登錄后才能下訂單哦!
開發(fā)人員在執(zhí)行語(yǔ)句執(zhí)行是報(bào)ORA-00600:內(nèi)部錯(cuò)誤代碼
語(yǔ)句如下
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
數(shù)據(jù)庫(kù)版本如下:
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
數(shù)據(jù)庫(kù)日志報(bào)如下錯(cuò)誤:
*** 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: 內(nèi)部錯(cuò)誤代碼, 參數(shù): [rwoirw: check ret val], [], [], [], [], [], [], [], [], [], [],[]
此incdir_258636/orcl1_ora_11899_i258636.trc日志報(bào)錯(cuò)如下:
----- 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 ?
因?yàn)橛捎谑钦Z(yǔ)句引起的,分析思路如下:
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
有結(jié)果輸出,查詢正常
2. 從上邊的結(jié)果可知,應(yīng)該不是查詢引起的問題。
突然想到難道是臨時(shí)表的數(shù)量太多了導(dǎo)致的?然后嘗試后面添加rownum< 1000; 手動(dòng)執(zhí)行create sql語(yǔ)句結(jié)果成功了。
3. 用rownum 解決此問題
想了一下,可能11.2.0.4里面對(duì)create tablexxx as select …. From …的限制比較嚴(yán)格(沒有經(jīng)過論證,也可能是個(gè)bug),意味著在不知道后面的select … from …的總體數(shù)量的情況下或者數(shù)量已經(jīng)超過了oracle的默認(rèn)值比如1000這樣,會(huì)提示ORA-00600的錯(cuò)誤。按照這個(gè)思路我查詢出來select … from ..的總數(shù)量,在后面加上and rownum<6000;再次執(zhí)行居然成功了。
想了想按照測(cè)試的邊界值理論,一個(gè)最大值能有結(jié)果,那就嘗試下最小值,在條件上加and rownum>-1;(因?yàn)橛锌赡躶elect 出來空記錄)呢?執(zhí)行了一下居然成功,語(yǔ)句修改如下:
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. 關(guān)于官方文檔對(duì)ora-600的描述如下:
Bug 14275161 - ORA-600[rwoirw: check ret val] on CTAS with predicate move around ( 文檔 ID 14275161.8)
修改隱性參數(shù):
在語(yǔ)句遇到600錯(cuò)誤是,一般個(gè)人建議對(duì)語(yǔ)句進(jìn)行改造,避免問題,
除非有比較多的語(yǔ)句影響到數(shù)據(jù)庫(kù)。一般不建議對(duì)數(shù)據(jù)庫(kù)做手術(shù)。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。