欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

PL/SQL Developer报错 ORA-12154:tns:could not resolve the connect identifier specified

程序员文章站 2022-11-07 08:46:31
ORA-12154:tns:could not resolve the connect identifier specified ......

pl/sql developer使用预先配置数据库报错 ora-12154:tns:could not resolve the connect identifier specified。

PL/SQL Developer报错 ORA-12154:tns:could not resolve the connect identifier specified

情况描述:我orcle客户端使用的是instantclient_12_2,根路径为x:\program files\instantclient_12_2。安装后没有tnsnames.ora文件 ,这个文件的路径从网上查询得知是:根路径+\network\admin\tnsnames.ora。

于是在根目录下建两级文件夹。然后用notpad建了tnsnames.ora,把搜到的文件内容粘贴进去。(这一步是个坑)

结果登录报错。ora-12154:tns:could not resolve the connect identifier specified。网上有说环境变量path不对的,还有说tns_admin没有配置的,试过之后都不行。

最后解决办法:从同事那要来tnsnames.ora文件替换自己建的文件,改成自己用的数据库链接。神奇的可以用了。

估计是空格或格式问题,时间有限不探究那么多了,记录下来警示指导后来人。