当前位置: 代码迷 >> 综合 >> Oracle client 安装后,使用pl/sql登录,提示ORA-12154: TNS: could not resolve the connect identifier specified
  详细解决方案

Oracle client 安装后,使用pl/sql登录,提示ORA-12154: TNS: could not resolve the connect identifier specified

热度:37   发布时间:2023-12-21 15:00:23.0

 今天因为要使用oracle client,使从网上下载了oracle client 11和pl/sql,当我配置完tnsnames.ora文件后,使用pl/sql登录,一直提示ORA-12154: TNS: could not resolve the connect identifier specified这个错误。

 网上查找资料,说是pl/sql需要配置Oracle Home,即打开pl/sql,取消登录,选择Tool->Preferences->Connection,在Oracle Home和OCI中分别输入oracle的目录D:\Program Files\Oracle\Instant Client、D:\Program Files\Oracle\Instant Client\bin\oci.dll,保存后重启pl/sql,还是提示ORA-12154: TNS: could not resolve the connect identifier specified这个错误。

 于是又重新找资料,说是环境变量没有配置,于是就开始配置环境变量,右键计算机->高级系统设置->高级->环境变量,在系统变量中添加ORACLE_HOME D:\Program Files\Oracle\Instant Client,path 中增加%ORACLE_HOME%\bin;重启电脑(不确定不重启电脑行不行),打开pl/sql,找不到我配置的数据库了,于是我就把pl/sql中配置的Oracle Home删除,再重户pl/sql就可以了。


  相关解决方案