首页 > 数据库技术 > 详细

Outer Join Query Over Dblink Can Fail With ORA-904 (Doc ID 730256.1)

时间:2014-06-13 13:35:38      阅读:474      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣 bubuko.com,布布扣 bubuko.com,布布扣To Bottom bubuko.com,布布扣

03-May-2013bubuko.com,布布扣PROBLEMbubuko.com,布布扣
bubuko.com,布布扣bubuko.com,布布扣 bubuko.com,布布扣bubuko.com,布布扣 bubuko.com,布布扣bubuko.com,布布扣 bubuko.com,布布扣bubuko.com,布布扣
bubuko.com,布布扣

In this Document

  Symptoms
  Changes
  Cause
  Solution
  References

 

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.1.0.7 [Release 10.2 to 11.1]
Information in this document applies to any platform.

SYMPTOMS


Following query over dblink having Local database 9iR2 and remote 10gR2 works..

select *
from ctps3.institutions@ctps3 i,
ctps3.state_types@ctps3 s,ods.institutions oi
where s.stt_state_type_id (+) = i.stt_state_type_id
and oi.ctps_insttn_id = i.inst_insttn_id
and i.inst_modifd_dt = trunc(sysdate)
and (nvl (oi.inst_state_txt, ‘x‘) <> nvl (s.stt_state_type_nm, ‘x‘))
and (nvl (oi.inst_phone_txt, 17) <> nvl (i.inst_phone_txt, 17));

The same query fails when both local and remote databases are 10g R2, with following errors:

ERROR at line 2:
ORA-00904: "OI"."INST_STATE_TXT": invalid identifier
ORA-02063: preceding line from CTPS3


 

CHANGES

 

 

CAUSE

Outer join query over dblink can fail with ORA-904, as referenced in:

BUG 6620988 QUERY OVER DBLINK FAILS WITH ORA-904 SELECTING DATE

Predicates are not checked to verify if they belong to same network node when we attempt to colocate the remote tables. This results in wrongly generating remote query and ORA-904

REDISCOVERY INFORMATION:
1. ORA-904
2. DB link
3. OJ predicates across network nodes
4. predicates wrongly pushed network nodes

 

SOLUTION

-- To implement the solution, please execute the following steps::

Use the workaround of disabling colocated joins via event 10176 and force a hard parse to happen
(ie by flushing the shared pool), ie:

SQL> alter session set events ‘10176 trace name context forever‘;
SQL> alter system flush shared_pool;

or

For a permanent fix, request a One-Off Backport of 6620988 for the appropiate platform.

 

REFERENCES

BUG:6620988 - QUERY OVER DBLINK FAILS WITH ORA-904 SELECTING DATE

Outer Join Query Over Dblink Can Fail With ORA-904 (Doc ID 730256.1),布布扣,bubuko.com

Outer Join Query Over Dblink Can Fail With ORA-904 (Doc ID 730256.1)

原文:http://www.cnblogs.com/kevinsun/p/3772091.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!