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
ORA-02085: database link DBLINK_NAME connects to ORACLE
提问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_names
set to true
, and you aren't connecting quite how you think. The connect to
is the user account on the remote database you want to reach, corresponding to the password you give in the identified by
clause. The using
looks like a tnsnames.ora
entry, but one which has connect_data
pointing 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 using
and connect to
clauses, which probably isn't correct.
您可能已经global_names
设置为true
,并且您并没有完全按照您的想法进行连接。该connect to
是你要达到,相当于你在给密码的远程数据库中的用户帐户identified by
条款。在using
貌似tnsnames.ora
项,但其具有一个connect_data
指向的SID ORACLE
; 将该条目添加到您的问题中可能会有所帮助。看起来您目前在 theusing
和connect to
子句中都给出了别名,这可能不正确。
With global_names
on, 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_names
setting 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=false
before 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
在使用该链接的任何查询之前添加。不过,从长远来看,让您的名字保持一致可能不会那么令人困惑。