10204升級到10205後同一sql報告ora-01719
ORACLE: 10205
上週將該資料庫從10204升級到10205,之後就有一條sql一直報告ora-01719
該sql結構如下
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(+)).
沒有升級前,該sql一直相安無事,升級後就一直執行不成功
登陸資料庫檢視,allow (+) in OR clause 明明已經存在了
SQL> select optimizer_feature_enable, description from v$session_fix_control where session_id = userenv('sid') and bugno = 6610822;
OPTIMIZER_FEATURE_ENABLE
-------------------------
DESCRIPTION
----------------------------------------------------------------
10.2.0.5
allow (+) in OR clause
且_eliminate_common_subexpr一直為true,從未改動過;
何以升級了反而出錯哪
我嘗試在會話級別將optimizer_feature_enable設定為10.2.0.4,然後執行sql,依舊報錯
表b的cust_id為not null
發了SR給ORACLE,收到回覆如下
In Oracle 10.2.0.4 and before, there is a bug in "common subexpression elimination" function. The bug number is 5346187. It can lead wrong transformation.
It was fixed on 10.2.0.5.
If setting the hidden parameter "_eliminate_common_subexpr" to false to disable the "common subexpression elimination", the ORA-1719 error will be report.
Please refer Bug 5346187, Note 5346187.8 and the last test case.
We recommend you to contact your developer to modify the SQL statement.
For example,
Using "unoin all" instead of "OR" operator.
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
8 rows selected.
也就是說這種sql語法本身就是一個bug才會讓其編譯透過的,10205修復了這個bug;
報告ora-1719才是正常行為,且一旦該bug修復,無法透過_fix_control='7148689:off'
修復,唯一的方法是修改sql
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15480802/viewspace-714744/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 10203升級到10205後個別SQL效能下降SQL
- oracle 10201 升級到10204 for windowsOracleWindows
- ORACLE10201手動升級到10204Oracle
- 9.2.0.4 升級到10.2.0.5升級後 Oracle Ultra Search 元件NO SCRIPTOracle元件
- pip 升級後runpy.py報錯
- Mac os 升級到11.0版本後 啟動擴充套件報錯Mac套件
- 【Python】升級python後pip報錯Python
- python3升級後的報錯Python
- Mac升級到high sierra後cocoapods失效Mac
- ORACLE EXADATA升級—從11.2.3.1.0到11.2.3.3.0–(9)升級後的檢查Oracle
- Fedora升級到4.3.4核心後virtualbox執行/sbin/rcvboxdrvsetup報Badargumentsetup
- 資料倉儲環境下謹慎升級10205補丁
- spring升級到3.1.1 hibernate升級到4備忘Spring
- Oracle9i 升級到10g 後,大多數SQL變慢的問題OracleSQL
- mongodb單機從3.2升級到4.0.4升級MongoDB
- 10201升級到10204的ORA-01092問題的解決
- 升級到 Pulsar3.0 後深入瞭解 JWT 鑑權JWT
- 升級Spring Cloud到Finchley後的一點坑SpringCloud
- activemq升級報錯MQ
- oracle 10 rac 升級 10.2.0.1升級到10.2.0.5Oracle
- centos 5.6核心升級到 linux-3.2.23 報錯!CentOSLinux
- 升級check SQL01SQL
- CentOS升級MySQL到5.5CentOSMySql
- yum升級php到5.3PHP
- oracle 升級到 11.2.0.2Oracle
- MySQL 5.7 升級到 8.0MySql
- 資料庫升級後goldengate報錯,ORA-04045資料庫Go
- Linux環境下CRS升級到10.2.0.4.2 Database升級到10.2.0.4.3LinuxDatabase
- MacOS升級到Monterey後python SSL握手失敗問題MacPython
- iOS一定要升級到最新的背後真相大揭秘iOS
- Windows 系統安裝Oracle升級到9.2.0.8 後,exp問題WindowsOracle
- ArchLinux/Manjaro升級到6.9核心後的問題解決LinuxJAR
- ABP Framework 手動升級指南:從6.0.1升級到7.0.0Framework
- oracle資料庫升級11.2.0.3升級到11.2.0.4Oracle資料庫
- 【版本升級】PerfDog新增多維度測試報告對比功能、iOS電量測試功能升級測試報告iOS
- 單機升級11.2.0.4到12.1.0.2的實戰__catupgrd.sqlSQL
- Linux升級核心後報No volume groups found錯誤Linux
- Mac 升級 PHP 到 7.4 版本MacPHP