zoukankan      html  css  js  c++  java
  • Outer Join Query Over Dblink Can Fail With ORA-904 (Doc ID 730256.1)

    Click to add to Favorites To BottomTo Bottom

    03-May-2013PROBLEM
    Rate this document Email link to this document Open document in new window Printable Page

    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
  • 相关阅读:
    海尔大数据精准营销平台(内部资料)
    马化腾做的PPT:产品设计与用户体验
    网站上线后,第一次完成线上线下整个环节
    灵感不断
    redis命令
    Redis持久化实践及灾难恢复模拟
    [转]创业公司常见的25个法律问题
    用python语言编写网络爬虫
    Python3常用网络编程模块介绍
    Python3数据库模块(sqlite3,SQLite3)
  • 原文地址:https://www.cnblogs.com/kevinsun/p/3772091.html
Copyright © 2011-2022 走看看