在使用oracle数据库链接时,出现错误"ORA-12154 TNS无法解析指定的连接标识符". [英] on using oracle database link theres an error "ORA-12154 TNS Could not resolve the connect identifier specified"

查看:972
本文介绍了在使用oracle数据库链接时,出现错误"ORA-12154 TNS无法解析指定的连接标识符".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用连接标识符在oracle 10.2上定义数据库链接,该链接标识符会在问题标头中引发错误. 我的tnsnames.ora文件中有连接标识符(服务名称). 我可以使用此服务名称与sqlplus连接.没问题. 这是创建sql:

I'm trying to define a database link on oracle 10.2 with connection identifier that throws the error in the question header. I have the connection identifier (service name) in my tnsnames.ora file. I can connect with sqlplus using this service name. no problem. This is the creation sql:

创建数据库链接dev1.REGRESS.RDBMS.DEV.US.ORACLE.COM 连接到由pass1标识的user1 使用'dev1';

create database link dev1.REGRESS.RDBMS.DEV.US.ORACLE.COM connect to user1 identified by pass1 using 'dev1';

使用链接选择: 选择* from t_users @ dev1;

select using the link: select * from t_users@dev1;

我得到:ORA-12154:TNS:无法解析指定的连接标识符

I get: ORA-12154: TNS:could not resolve the connect identifier specified

使用sqlplus连接到oracle到'unidentified'服务(没有问题): sqlplus user1/pass1 @ dev1

connecting to oracle with sqlplus to the 'unidentified' service (with no problem): sqlplus user1/pass1@dev1

我定义了另一个我要唤醒的数据库的链接(环回)-正常.

I defined another link to the same database I'm woking in (loopback) - works OK.

我阅读并尝试了有关该主题的所有内容,但未能解决此问题.

I read and tried anything I could find about the subject but did not solve this.

有什么建议吗?

推荐答案

尝试:

create database link dev1 connect to user1 identified by pass1 using 'dev1';

还请注意,要链接的数据库服务器上必须存在dev1的tnsnames.ora条目.

Also note that a tnsnames.ora entry for dev1 has to exist on the database server that you're linking from.

这篇关于在使用oracle数据库链接时,出现错误"ORA-12154 TNS无法解析指定的连接标识符".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆