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








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 [email protected]
i,
[email protected] 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)

时间: 2024-10-27 07:59:28

Outer Join Query Over Dblink Can Fail With ORA-904 (Doc ID 730256.1)的相关文章

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

Action Plan 1. Execute srdc_db_undo_1555-1.sql as sysdba and provide the spool output DB_Undo_1555-1.html  以sysdba的身份执行 --srdc_db_undo_1555-1.sql REM srdc_db_undo_1555-1.sql REM collect collect Undo parameters and Segments details. define SRDCNAME='D

Linq To SQL LEFT OUTER JOIN (Left Join)

SQL: SELECT [t0].[ProductName], [t1].[TotalPrice] AS [TotalPrice] FROM [Product] AS [t0] LEFT OUTER JOIN [OrderDetail] AS [t1] ON [t0].[ProductID] = [t1].[ProductID] Linq Query: from p in Products join od in OrderDetails on p.ProductID equals od.Prod

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

先看一个最简单的inner join,在读取Student表时inner join Class表取的对应的Class信息: static void Main(string[] args) { using (var writer = new StreamWriter(WatchSqlPath, false, Encoding.UTF8)) { using (DbAppDataContext db = new DbAppDataContext()) { db.Log = writer; //inne

文摘:OUTER JOIN

原文地址:(https://www.w3resource.com/sql/joins/perform-a-full-outer-join.php) What is Full Outer Join in SQL? In SQL the FULL OUTER JOIN combines the results of both leftand right outer joins and returns all (matched or unmatched) rows from the tables on

left ,right ,cross ,full/left outer join/区别 详解

--创建测试表wwif OBJECT_ID('qq') is not null drop table qqcreate table qq([序号] varchar(5),[内容1] varchar(10),[内容2] varchar(15))insert into qq([序号],[内容1],[内容2])select 'dd','zoumin','yuzulin'union all select 'cc','zm','yz'union allselect 'AA','z1','yz1'union

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

摘自:http://blog.csdn.net/scythe666/article/details/51881235 缺省情况下是inner join,开发中使用的left join和right join属于outer join,另外outer join还包括full join.下面我通过图标让大家认识它们的区别. 现有两张表,Table A 是左边的表.Table B 是右边的表.其各有四条记录,其中有两条记录name是相同的: 1.INNER JOIN 产生的结果是AB的交集 SELECT

SQL 查询条件放在LEFT OUTER JOIN 的ON语句后与放在WHERE中的区别

这两种条件放置的位置不同很容易让人造成混淆,以致经常查询出莫名其妙的结果出来,特别是副本的条件与主表不匹配时,下面以A,B表为例简单说下我的理解. 首先要明白的是: 跟在ON 后面的条件是对参与左联接的数据进行筛选,即在左联接之前起作用. 跟在WHERE后的条件是对左联接得到的结果集进行筛选,即在左联接之后起作用. 我直接把我的结论发出来,建议朋友们自行测试一下,下面是结论: 1) 如果条件是由主表和副表之间的字段构成,那么放在ON后与放在WHERE子条件中所得到的结果是一样,即这种条件可以随便

inner join和outer join

内连接           只连接匹配的行 左外连接        包含左边表的全部行(不管右边的表中是否存在与它们匹配的行),以及右边表中全部匹配的行 A left join B等价于A left outer join B 右外连接        包含右边表的全部行(不管左边的表中是否存在与它们匹配的行),以及左边表中全部匹配的行 A right join B 全外连接        包含左.右两个表的全部行,不管另外一边的表中是否存在与它们匹配的行.A full outer join B 例

SQL SERVER 2012 第四章 连接 JOIN の OUTER JOIN,完全连接FULL JOIN,交叉连接CROSS JOIN

SELECT <SELECT LIST> FROM <the table you want to be the "LEFT" table> <LEFT|RIGHT> [OUTER] JOIN <table you want to be the "RIGHT" table> ON <join condition> 可以看做JOIN之前的表是左表,之后的表是右表. 外部连接本质上是包含的.明确包含的记录取决于使