ORA-02085: 数据库链接 DBLINK_NAME 连接到 ORACLE

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9988954/
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-10 04:06:44  来源:igfitidea点击:

ORA-02085: database link DBLINK_NAME connects to ORACLE

oracledblink

提问by MAHESH A SONI

I m having a database by name 'HBHAWANI' on my domain server name 'HBHAWANI' (version Oracle 8i). Whenever I try to create a dblink here it gives the error :

我在域名服务器名称“HBHAWANI”(Oracle 8i 版)上有一个名称为“HBHAWANI”的数据库。每当我尝试在此处创建 dblink 时,都会出现错误:

Link  : "DBLINK_DOMAINSERVERTOUPASS_PP"  
Error : ORA-02085: database link DBLINK_DOMAINSERVERTOUPASS_PP connects to ORACLE  

Script for DBLink is:

DBLink 的脚本是:

CREATE PUBLIC DATABASE LINK DBLINK_DOMAINSERVERTOUPASS_PP  
CONNECT TO UPASS.HBHAWANI  
IDENTIFIED BY <PWD>  
USING 'UPASS.HBHAWANI';  

I have tried so much but occurring same error. Kindly provide a suggestion on this.

我已经尝试了很多,但发生了同样的错误。请就此提出建议。

回答by Alex Poole

You probably have global_namesset to true, and you aren't connecting quite how you think. The connect tois the user account on the remote database you want to reach, corresponding to the password you give in the identified byclause. The usinglooks like a tnsnames.oraentry, but one which has connect_datapointing to a SID of ORACLE; it may be helpful to add that entry to your question. It looks like you're currently giving the alias name in both the usingand connect toclauses, which probably isn't correct.

您可能已经global_names设置为true,并且您并没有完全按照您的想法进行连接。该connect to是你要达到,相当于你在给密码的远程数据库中的用户帐户identified by条款。在using貌似tnsnames.ora项,但其具有一个connect_data指向的SID ORACLE; 将该条目添加到您的问题中可能会有所帮助。看起来您目前在 theusingconnect to子句中都给出了别名,这可能不正确。

With global_nameson, the database link name has to match the remote database name - it's actual name, not the alias you've given to it. This means your database link namewill have to be ORACLE, which might be a little confusing.

随着global_names上,数据库链接名称必须匹配远程数据库的名字-它的实际名称,而不是你给它的别名。这意味着您的数据库链接名称必须是ORACLE,这可能有点令人困惑。

You could also turn off the global_namessetting at the database level, but that may not be allowed or desirable. If this is a rarely-used link you could also add alter session set global_names=falsebefore any queries that use the link. It may be less confusing in the long term to have your names consistent though.

您也可以关闭global_names数据库级别的设置,但这可能是不允许或不可取的。如果这是一个很少使用的链接,您还可以alter session set global_names=false在使用该链接的任何查询之前添加。不过,从长远来看,让您的名字保持一致可能不会那么令人困惑。