分享
 
 
 

数据库链接执行含ROLLUP的SQL的Bug

王朝mssql·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

通过微软的报表服务器访问Oracle,做好一张报表,为了偷懒,直接在数据库建立了一个视图,然后显示就行了。结果测试时报ORA-600 [qks3tinit]。登陆到本机一运行,没问题啊。怀疑是微软报表服务器连接Oracle的接口有问题。但是其他几个类似视图又都没问题。于是检测SQL:

SELECT (CASE

WHEN fjname IS NULL

THEN '全局'

ELSE fjname

END) fjname,

(CASE

WHEN stat_type IS NULL

THEN '总计'

ELSE stat_type

END) stat_type,

(CASE

WHEN cust_type_old IS NULL

THEN '总计'

ELSE cust_type_old

END

) cust_type_old,

cnt, curr_user

FROM (SELECT fjname, stat_type, cust_type_old, COUNT (*) cnt, SUM(CASE state WHEN '正常' THEN 1 ELSE 0 END) curr_user

FROM tmp_tj0507001

WHERE fjname IS NOT NULL

GROUP BY grouping sets(rollup(fjname, stat_type, cust_type_old), rollup(stat_type, cust_type_old)))

ORDER BY fjname, stat_type, cust_type_old;

执行计划:

SELECT STATEMENT, GOAL = HINT: ALL_ROWS Cost=10 Cardinality=15 Bytes=780

SORT ORDER BY Cost=10 Cardinality=15 Bytes=780

VIEW Object owner=YAOYP Cost=8 Cardinality=15 Bytes=780

TEMP TABLE TRANSFORMATION

VIEW Object owner=YAOYP Cost=8 Cardinality=4 Bytes=208

VIEW Object owner=YAOYP Cost=8 Cardinality=4 Bytes=208

UNION-ALL

TABLE ACCESS FULL Object owner=SYS Object name=SYS_TEMP_0FD9D668F_9A864B59 Cost=2 Cardinality=1 Bytes=52

TABLE ACCESS FULL Object owner=SYS Object name=SYS_TEMP_0FD9D6690_9A864B59 Cost=2 Cardinality=1 Bytes=52

TABLE ACCESS FULL Object owner=SYS Object name=SYS_TEMP_0FD9D6691_9A864B59 Cost=2 Cardinality=1 Bytes=52

TABLE ACCESS FULL Object owner=SYS Object name=SYS_TEMP_0FD9D6691_9A864B59 Cost=2 Cardinality=1 Bytes=52

RECURSIVE EXECUTION Object name=SYS_LE_7_0

RECURSIVE EXECUTION Object name=SYS_LE_7_1

RECURSIVE EXECUTION Object name=SYS_LE_7_2

RECURSIVE EXECUTION Object name=SYS_LE_7_3

就看到一个TEMP TABLE TRANSFORMATION,这个比较少见哦。另外一个类似SQL:

SELECT (CASE

WHEN fjname IS NULL

THEN '全局'

ELSE fjname

END) fjname,

(CASE

WHEN cust_type IS NULL

THEN '总计'

ELSE cust_type

END

) cust_type,

curr_user

FROM (SELECT fjname, (CASE WHEN cust_type IS NULL THEN '公免等' ELSE cust_type END) cust_type,

SUM(CASE state WHEN '正常' THEN 1 ELSE 0 END) curr_user

FROM tmp_tj0507001

WHERE fjname IS NOT NULL AND state = '正常'

GROUP BY ROLLUP (fjname, (CASE WHEN cust_type IS NULL THEN '公免等' ELSE cust_type END)))

ORDER BY fjname, cust_type;

执行计划:

SELECT STATEMENT, GOAL = CHOOSE Cost=3021 Cardinality=43 Bytes=1376

SORT ORDER BY Cost=3021 Cardinality=43 Bytes=1376

VIEW Object owner=YAOYP Cost=3020 Cardinality=43 Bytes=1376

SORT GROUP BY ROLLUP Cost=3020 Cardinality=43 Bytes=989

INDEX FAST FULL SCAN Object owner=YAOYP Object name=SYS_IOT_TOP_62350 Cost=367 Cardinality=1132418 Bytes=26045614

没有TEMP TABLE TRANSFORMATION了。看来要避免这个执行路径,想了半天也没办法,开始还怀疑是参数STAR_TRANSFORMATION_ENABLED问题,后来一看是FALSE的。只能到Metalink上找了,结果又是一个Bug,最近简直是一出问题就是Bug,以前怎么就不觉得呢?

文档 ID: 注释:2836690.8

主题: Support Description of Bug 2836690

类型: PATCH

状态: PUBLISHED

内容类型: TEXT/X-HTML

创建日期: 08-AUG-2003

上次修订日期: 14-AUG-2003

Click here for details of sections in this note.

Bug 2836690 ROLLUP over DBLINK may fail with OERI:qks3tinit

This note gives a brief overview of bug 2836690.

Affects:

Product (Component) Oracle Server (RDBMS)

Range of versions believed to be affected Versions >= 9 but < 10G

Versions confirmed as being affected

* 9.2.0.3

Platforms affected Generic (all / most platforms affected)

Fixed:

This issue is fixed in

* 9.2.0.4 (Server Patch Set)

* 10G Production Base Release

Symptoms:

* Internal Error may occur (ORA-600)

* ORA-600 [qks3tinit]

Related To:

* DB-Link / Distributed

* Analytic SQL (Windowing etc..)

Description

ORA-600 [qks3tinit] possible from queries using ROLLUP which reference

remote objects.

The full bug text (if published) can be seen at <Bug:2836690>

This link will not work for UNPUBLISHED bugs.

类似还有一个Bug:

文档 ID: 注释:2419335.8

主题: Support Description of Bug 2419335

类型: PATCH

状态: PUBLISHED

内容类型: TEXT/X-HTML

创建日期: 08-AUG-2003

上次修订日期: 14-AUG-2003

Click here for details of sections in this note.

Bug 2419335 OERI:[qks3tInit] possible from STAR transformation

This note gives a brief overview of bug 2419335.

Affects:

Product (Component) Oracle Server (RDBMS)

Range of versions believed to be affected Versions >= 9.2 but < 10G

Versions confirmed as being affected

* 9.2.0.3

Platforms affected Generic (all / most platforms affected)

Fixed:

This issue is fixed in

* 9.2.0.4 (Server Patch Set)

* 10G Production Base Release

Symptoms:

* Internal Error may occur (ORA-600)

* ORA-600 [qks3tInit]

Related To:

* DB-Link / Distributed

* Star Transformation

Description

ORA-600 [qks3tInit] possible from star transformation query

where all the tables are remote (ie: over a dblink)

Workaround:

Set star_transformation_enabled = false at the remote DB.

The full bug text (if published) can be seen at <Bug:2419335>

This link will not work for UNPUBLISHED bugs.

不过我还是觉得是TEMP TABLE TRANSFORMATION问题,没理由第2个SQL里的ROLLUP就没问题哦。唉,放弃ROLLUP咯。关于上面这个执行路径资料好少,有办法避免么?

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有