10g 和 11g 之间的 Oracle 数据库链接

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2474294/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 20:14:59  来源:igfitidea点击:

Oracle database links between 10g and 11g

databaseoracleoracle10goracle11g

提问by JavaRocky

Does anyone have experience with database links between 10g and 11g?

有没有人对 10g 和 11g 之间的数据库链接有经验?

Is this a supported setup/operation? Is it possible? Are there any problems? Caveats?

这是受支持的设置/操作吗?是否可以?有什么问题吗?注意事项?

回答by Gary Myers

I've been using DB Links from 11g to 10g. No big issues.

我一直在使用从 11g 到 10g 的数据库链接。没什么大问题。

Only caveat is that 11g can use mixed-case passwords and you might want to switch that off if you are trying to connect from a 10g database to an 11g one.

唯一需要注意的是 11g 可以使用大小写混合的密码,如果您尝试从 10g 数据库连接到 11g 数据库,您可能需要关闭它。

回答by Deon Steyn

A view with dblink in the select list can no longer be accessed from another schema via a synonym (used to work in Oracle 10)

选择列表中带有 dblink 的视图不能再通过同义词从另一个模式访问(用于在 Oracle 10 中工作)

The view

风景

create or replace foo_view as
select foo.id@link id --yes, I know this is stupid... legacy code
from foo@link

On other DB user

在其他数据库用户上

create synonym foo_synonym for otherdb.foo_view

select foo_synonym: "ORA-02019 connection description for remote database not found"

select foo_synonym: "ORA-02019 找不到远程数据库的连接描述"

The solution is to remove dblinks from the underlying view's select clause (which shouldn't really be there in the first place):

解决方案是从底层视图的 select 子句中删除 dblinks(首先它不应该真正存在):

create or replace foo_view as
select foo.id id
from foo@lin foo

回答by dba.in.ua

Sometimes there are problems, when a link from 11G to 10.2.0.4.

有时候会出现问题,从11G连接到10.2.0.4的时候。

Oracle Support Doc ID 730423.1: Select With Local Function and Remote Tables Using a Dblink Hangs Due To Enq DX.

Oracle 支持文档 ID 730423.1:由于 Enq DX,使用 Dblink 使用本地函数和远程表进行选择挂起。

回答by Graydon Mah

ORA-01719 can also be thrown if you have an outer join query in 11g that also uses IN or OR and the tables are being referenced through a db_link to 10g.

如果您在 11g 中有一个也使用 IN 或 OR 的外连接查询,并且表正通过 db_link 引用到 10g,则也可能抛出 ORA-01719。

11g to 11g works as does 10g to 10g - just comes up if you db_link from 11g to 10g.

11g 到 11g 和 10g 到 10g 一样工作 - 如果你 db_link 从 11g 到 10g 就会出现。

Specifically, I'm currently seeing this issue using 11.2.0.1 to 10.2.0.3; and 11.2.0.2 to 10.2.0.4. As well as varying O/S releases: Windows and Solaris.

具体来说,我目前正在使用 11.2.0.1 到 10.2.0.3 看到这个问题;和 11.2.0.2 到 10.2.0.4。以及不同的操作系统版本:Windows 和 Solaris。

Run this in the target 10g and 11g databases:

在目标 10g 和 11g 数据库中运行:

create table u1 (c1 number);
create table u2 (c1 number, c2 number);
insert into u1 values (1);
insert into u1 values (2);
insert into u2 values (1,1);
insert into u2 values (1,2);
commit;

Create db_links (DB10, DB11) in your 11g linking database to both the 10g and 11g linked databases.

在 11g 链接数据库中创建 db_links(DB10、DB11)到 10g 和 11g 链接数据库。

Run these queries in your 11g linking database:

在 11g 链接数据库中运行这些查询:

/* this will fail 11g to 10g*/
SELECT *
FROM u1@DB10 a,
(SELECT *
FROM u2@DB10
WHERE c1 IN (1, 2, 3)) b
WHERE a.c1 = b.c1(+);

/* this will work 11g to 11g*/
SELECT *
FROM u1@DB11 a,
(SELECT *
FROM u2@DB11
WHERE c1 IN (1, 2, 3)) b
WHERE a.c1 = b.c1(+);