ORA-12154: TNS:could not resolve the connect identifier specified 解决方案

来源:互联网 发布:网络管理比较好的书 编辑:程序博客网 时间:2024/06/08 16:55

今天用 PL/SQL Developer v8.0.4 连接 Oracel 11g R2 (Windows x64) 时,总是提示“ORA-12154: TNS:could not resolve the connect identifier specified”的错误信息,问题到最后总算是解决了,解决办法如下:

1. 从 oracle 官方网站下载 32 位的客户端(instantclient-basic-win32-11.2.0.1.0.zip),然后解压,我本机解压后的目录为:C:\oracle\instantclient_11_2

2. 然后在 pl/sql 中配置一下 oci 文件路径(tools-->preferences...-->Oracle-->Connection-->OCI Libray(empty is autodetect) 将该值改为刚才解压后文件夹中的 coi.dll 的全路径,如:C:\oracle\instantclient_11_2\oci.dll)

3. 配置系统环境变量,以防乱码:

TNS_ADMIN=C:/oracle/product/11.2.0/dbhome_1/NETWORK/ADMINNLS_LANG=AMERICAN_AMERICA.AL32UTF8