12
返回列表 发新帖
楼主: myownstars

[讨论] 10204升级到10205后报错ora-01719

[复制链接]
论坛徽章:
10
2011新春纪念徽章
日期:2011-02-18 11:43:342015年新春福章
日期:2015-03-06 11:58:18懒羊羊
日期:2015-03-04 14:52:11马上有钱
日期:2014-02-18 16:43:092014年新春福章
日期:2014-02-18 16:43:09优秀写手
日期:2013-12-18 09:29:11三菱
日期:2013-08-30 20:37:412013年新春福章
日期:2013-02-25 14:51:24ITPUB十周年纪念徽章
日期:2011-11-01 16:24:51暖羊羊
日期:2015-06-22 15:51:36
11#
 楼主| 发表于 2012-1-12 13:36 | 只看该作者
aaqwsh 发表于 2012-1-12 13:29
"_fix_control='7148689ff' "  seems useless.
It's my test:

不要使用dba_*视图 创建两个普通表再试一下  

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
12#
发表于 2012-1-12 23:09 | 只看该作者
Now I carefully read your SQL. (Sorry I didn't do that earlier.) I tried to run your SQL in message #10 (the one about dba_users and dba_jobs) in Oracle 10.2.0.3, 10.2.0.4, 11.2.0.1, 11.2.0.3. It failed in all versions.

Oracle simply doesn't allow you to have the construct "A(+) or B" in the where-clause. The description for ORA-1719 says it clearly.

Are you sure your original query

select a.xx
         ...
         b.xx
from a, b
where a.class ='D'
and    a.cd in ('A','E')
and ((a.cust_id = b.cust_id(+)) and 'D'='F') or
        ('D'='D') and (a.cust_id = b.cust_id(+)).

works in 10.2.0.4? Can you create a small test case for us to reproduce?

Ignore the _fix_control parameter for now.

Yong Huang

使用道具 举报

回复
论坛徽章:
10
2011新春纪念徽章
日期:2011-02-18 11:43:342015年新春福章
日期:2015-03-06 11:58:18懒羊羊
日期:2015-03-04 14:52:11马上有钱
日期:2014-02-18 16:43:092014年新春福章
日期:2014-02-18 16:43:09优秀写手
日期:2013-12-18 09:29:11三菱
日期:2013-08-30 20:37:412013年新春福章
日期:2013-02-25 14:51:24ITPUB十周年纪念徽章
日期:2011-11-01 16:24:51暖羊羊
日期:2015-06-22 15:51:36
13#
 楼主| 发表于 2012-1-13 09:42 | 只看该作者
here is the test case
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production



SQL> alter session set "_eliminate_common_subexpr"=false;

Session altered.

SQL>
SQL> select d.deptno,e.empno,e.deptno from
dept d, emp e
where d.deptno in(10,20)
and d.deptno = e.deptno(+) and 'D'='D'
or (d.deptno = e.deptno(+) and 'D' = 'F' and d.deptno in(40)); 2 3 4 5
or (d.deptno = e.deptno(+) and 'D' = 'F' and d.deptno in(40))
*
ERROR at line 5:
ORA-01719: outer join operator (+) not allowed in operand of OR or IN


SQL> alter session set "_eliminate_common_subexpr"=true;

Session altered.

SQL> select d.deptno,e.empno,e.deptno from
dept d, emp e
where d.deptno in(10,20)
and d.deptno = e.deptno(+) and 'D'='D'
or (d.deptno = e.deptno(+) and 'D' = 'F' and d.deptno in(40)); 2 3 4 5

DEPTNO EMPNO DEPTNO
---------- ---------- ----------
20 7369 20
20 7566 20
10 7782 10
20 7788 20
10 7839 10
20 7876 20
20 7902 20
10 7934 10

使用道具 举报

回复
论坛徽章:
10
2011新春纪念徽章
日期:2011-02-18 11:43:342015年新春福章
日期:2015-03-06 11:58:18懒羊羊
日期:2015-03-04 14:52:11马上有钱
日期:2014-02-18 16:43:092014年新春福章
日期:2014-02-18 16:43:09优秀写手
日期:2013-12-18 09:29:11三菱
日期:2013-08-30 20:37:412013年新春福章
日期:2013-02-25 14:51:24ITPUB十周年纪念徽章
日期:2011-11-01 16:24:51暖羊羊
日期:2015-06-22 15:51:36
14#
 楼主| 发表于 2012-1-13 09:54 | 只看该作者
SQL> alter session set events='10053 trace name context forever, level 1';

Session altered.

SQL> select d.deptno,e.empno,e.deptno from
dept d, emp e
where d.deptno in(10,20)
and d.deptno = e.deptno(+) and 'D'='D'
or (d.deptno = e.deptno(+) and 'D' = 'D' and d.deptno in(40)); 2 3 4 5

DEPTNO EMPNO DEPTNO
---------- ---------- ----------
20 7369 20
20 7566 20
10 7782 10
20 7788 20
10 7839 10
20 7876 20
20 7902 20
10 7934 10
40


10053 Trace:

--After transformation:

SQL:******* UNPARSED QUERY IS *******
SELECT "D"."DEPTNO" "DEPTNO","E"."EMPNO" "EMPNO","E"."DEPTNO" "DEPTNO" FROM "SCOTT"."DEPT" "D","SCOTT"."EMP" "E"
WHERE 'D'='D' AND "D"."DEPTNO"="E"."DEPTNO"(+)
AND (("D"."DEPTNO"=10 OR "D"."DEPTNO"=20) OR "D"."DEPTNO"=40)

Current SQL statement for this session:
select d.deptno,e.empno,e.deptno from
dept d, emp e
where d.deptno in(10,20)
and d.deptno = e.deptno(+) and 'D'='D'
or (
d.deptno = e.deptno(+) <<======This condition was merged.
and 'D' = 'D' and d.deptno in(40))


使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
15#
发表于 2012-1-14 05:05 | 只看该作者
Thanks for this test. It looks like after version 10.2.0.4, the parameter _eliminate_common_subexpr no longer has any effect. Its TRUE value does not eliminate common subexpressions.

Yong Huang

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表