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

Modified:03-May-2013Type:PROBLEM

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)的更多相关文章

  1. SRDC - ORA-1555: Query Duration 0: Checklist of Evidence to Supply (Doc ID 1682704.1)

    SRDC - ORA-1555: Query Duration 0: Checklist of Evidence to Supply (Doc ID 1682704.1) Action Plan 1. ...

  2. LINQ to SQL系列四 使用inner join,outer join

    先看一个最简单的inner join,在读取Student表时inner join Class表取的对应的Class信息: static void Main(string[] args) { usin ...

  3. EntityFramework 使用Linq处理内连接(inner join)、外链接(left/right outer join)、多表查询

    场景:在实际的项目中使用EntityFramework都会遇到使用Ef处理连接查询的问题,这里做一些小例子如何通过Linq语法处理内连接(inner join).外连接(left/right oute ...

  4. hive left outer join的问题

    最近BA用户反馈有两句看似很像的语句返回的结果数不一样,比较奇怪,怀疑是不是Hive的Bug Query 1 返回结果数6071 select count(distinct reviewid) as ...

  5. Linq To SQL LEFT OUTER JOIN (Left Join)

    SQL: SELECT [t0].[ProductName], [t1].[TotalPrice] AS [TotalPrice] FROM [Product] AS [t0] LEFT OUTER ...

  6. sqlalchemy多表联合查询(inner outer join 左右连接)详解

    #按用户名摸糊查询trans_details.query.join(Uses).filter(Users.username.like('%xx%'))#select xxx from trans_de ...

  7. Oracle Partition Outer Join 稠化报表

    partition outer join实现将稀疏数据转为稠密数据,举例: with t as (select deptno, job, sum(sal) sum_sal from emp group ...

  8. SQL Server 2008 R2——使用FULL OUTER JOIN实现多表信息汇总

    =================================版权声明================================= 版权声明:原创文章 谢绝转载  请通过右侧公告中的“联系邮 ...

  9. SQL中inner join、outer join和cross join的区别

    对于SQL中inner join.outer join和cross join的区别简介:现有两张表,Table A 是左边的表.Table B 是右边的表.其各有四条记录,其中有两条记录name是相同 ...

随机推荐

  1. MySQL 存储过程 定时任务

    drop procedure if exists move_track_data; delimiter // create procedure move_track_data() begin ; st ...

  2. asp.net core中Microsoft.AspNet.Session的使用

    1.通过nuget/修改project.json引用 2.引用存储session的媒介,如内存.数据库.redis等 "Microsoft.AspNetCore.Session": ...

  3. Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/ma ven/cli/Maven/java与javac版本不一致问题

    编译的时候 中出现如下异常: Exception in thread "main" Java.lang.UnsupportedClassVersionError: org/apac ...

  4. Leetcode 88 Merge Sorted Array STL

    合并有序数组 时间复杂度O(m+n) 该算法来自各种算法与数据结构书,写得已经烂得不能再烂了,这个应该是最短的代码了吧,不知如何归类 class Solution { public: void mer ...

  5. bzoj 1207: [HNOI2004]打鼹鼠

    1207: [HNOI2004]打鼹鼠 Time Limit: 10 Sec  Memory Limit: 162 MB Description 鼹鼠是一种很喜欢挖洞的动物,但每过一定的时间,它还是喜 ...

  6. Maven之打包时配置文件替换

    在JavaWeb项目中,使用maven打包.在打正式包时,需要手动修改数据库配置为线上环境的地址,这样每次修改起来比较麻烦. 搜索了一些资料后,大部分的做法或原理都是预先使用表达式占位符,然后在打包时 ...

  7. android: 通过内容提供器读取系统联系人

    读取系统联系人 由于我们之前一直使用的都是模拟器,电话簿里面并没有联系人存在,所以现在需要自 己手动添加几个,以便稍后进行读取.打开电话簿程序,界面如图 7.1 所示. 图   7.1 可以看到,目前 ...

  8. 报错:LINQ to Entities 不识别方法

    大致是: var products = db.Products.Select(new ProductVm{Name=SomeMethod() }); 针对IQueryable集合的查询操作会被LINQ ...

  9. arulesSequences包做序列模式的关联分析

    实验数据: 实验文件: ? 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 02 ...

  10. webService发布和调用--Axis2

    一.工具 1.下载 Axis2以及eclipse的Axis2插件.http://axis.apache.org/axis2/java/core/download.cgi 2.axis2-1.7.1-w ...