執行SQL語句遇到3113錯誤

empo007發表於2007-07-06
最近在一家客戶那裡做資料庫健康檢查,聽使用者說有條SQL語句執行時總是報3113錯誤,經METALINK診斷,確認是BUG 2475995[@more@]

語句為:

select case a.pk_corp when '1014' then '010501'
when '1100' then '292101'
when '1002' then '011401' end as unit_code,
b.code,a.stocks_num,a.stocks_sum from
htnc.Nc_sim_secstockbalance a,
htnc.nc_sim_securities b,
(select pk_corp,pk_securities,max(trade_date) as trade_date
from htnc.Nc_sim_secstockbalance
where pk_corp in ('1014','1100','1002')
and state=0
group by pk_corp,pk_securities) c
where a.pk_securities = c.pk_securities
and a.pk_securities = b.pk_securities
and a.pk_corp = c.pk_corp
and a.trade_date = c.trade_date
and a.pk_corp in ('1014','1100','1002')
and a.state = 0
order by a.pk_corp,b.code

執行該語句後出現的錯誤為:

ORA-03113: end-of-file on communication channel

警告日誌中出現的錯誤為:

ksedmp: internal or fatal error
ORA-07445: exception encountered: core dump [] [] [] [] [] []

解決辦法:

1、應用PATCH

2、Put a "no_merge" hint for the view or disable star transformation

修改上面的語句為:

select /*+ NO_MERGE(c) */ case a.pk_corp when '1014' then '010501'
when '1100' then '292101'
when '1002' then '011401' end as unit_code,
b.code,a.stocks_num,a.stocks_sum from
htnc.Nc_sim_secstockbalance a,
htnc.nc_sim_securities b,
(select pk_corp,pk_securities,max(trade_date) as trade_date
from htnc.Nc_sim_secstockbalance
where pk_corp in ('1014','1100','1002')
and state=0
group by pk_corp,pk_securities) c
where a.pk_securities = c.pk_securities
and a.pk_securities = b.pk_securities
and a.pk_corp = c.pk_corp
and a.trade_date = c.trade_date
and a.pk_corp in ('1014','1100','1002')
and a.state = 0
order by a.pk_corp,b.code

再執行,問題解決

如何disable star transformation:

alter system set star_transformation_enabled=false scope=spfile;

重新啟動資料庫後生效。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/85922/viewspace-924448/,如需轉載,請註明出處,否則將追究法律責任。

相關文章