服务器:AIX 5309
当时那哥们正在执行的语句是:
select distinct t1.loan_no ,--,
t.customer_cname ,
t3.industry_class1_name ,
t3.industry_class1_code,
t3.industry_class2_name,
t3.industry_class2_code,
t3.industry_class3_name,
t3.industry_class3_code,
t3.industry_class4_name,
t3.industry_class4_code,
t.customer_scale "大中小微分类",
t7.second_type,
t7.first_type,
t7.path_code,
t7.path_name,
t2.loan_start_date,
t2.mature_date,
t2.loan_amt "发放金额",
t2.cmis_five_class,
t1.loan_amt "贷款余额",
t4.sec_code,
t4.sec_name,
t4.fir_code,
t4.fir_name,
t.customer_id
-- sum(t1.loan_amt)
from srcb_ods.c_customer_info t,srcb_fsd.cl_loan_acct t1,srcb_fsd.cl_loan t2,
srcb_fsd.country_standard_industry_clas t3,srcb_fsd.com_bank_hierarchy t4,srcb_fsd.prod_map_tbl t6,
(select t5.loan_type_id,connect_by_root t5.loan_type_id as second_type, connect_by_root t5.upper_loan_type_id as first_type,
sys_connect_by_path(t5.loan_type_id, '/') as path_code,sys_connect_by_path(t5.loan_type_name, '/') as path_name
from los.loan_type_info@los t5 start with t5.loan_type_id<>t5.upper_loan_type_id
connect by nocycle prior t5.loan_type_id = t5.upper_loan_type_id) t7
where t.data_date = '20120229'
and t1.fdate='20120229'
and t.customer_id=t1.client_no
and t2.fdate='20120229'
and t1.loan_no=t2.loan_no
and substr(t.industry_id,2)=t3.industry_class4_code
and t2.loan_branch=t4.fir_code
and t4.fiv_code='00001'
and t1.settle_ind='N'
-- and t.customer_scale='01'
and t2.loan_cate='01'
and t2.loan_sub_type=t6.fsd_prod_code
and t6.s_prod_code=t7.loan_type_id
order by t4.sec_code,t4.fir_code,t.customer_id
在网上Google和在MOS上查了一些,都说是因为使用了sys_connect_by_path的原因,注意SQL中的红色部分,单独执行红色SQL是没问题的,但是如果整个SQL语句一起执行的话就会报错。这说明该错误不是那个子SQL造成的,而是与其他语句结合才会出现的错误(Bug)。
注明:不过还发现一个比较奇怪的问题,就是同样是这条语句,我在另一套环境执行则是没问题的。不知道为何,两套环境的数据库补丁集神马都是一样的。
直接附官文: