on using oracle database link theres an error “ORA-12154 TNS Could not resolve the connect identifier specified”

微笑、不失礼 提交于 2019-12-25 08:35:23

问题


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:

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

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

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

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.

Any suggestions?


回答1:


Try:

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

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



来源:https://stackoverflow.com/questions/10417010/on-using-oracle-database-link-theres-an-error-ora-12154-tns-could-not-resolve-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!