PL/SQL安装好后,登录后爆出这样的错误:
ORA-12154: TNS:could not resolve the connect identifier specified
描述:
1:oracle 10g 安装在虚拟机上;
2:本地安装的oracle客户端,与plsql
处理办法:
1:将虚拟机上的
C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN
下的tnsnames.ora文件拷贝至E:\instantclient-basic-win32-11.2.0.1.0(随意)
2:打开tnsnames.ora文件
检查host=是不是虚拟机地址。(加粗),不是则修改
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.146.130)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
3:增加环境变量:
变量名为:TNS_ADMIN
变量值为:E:\instantclient-basic-win32-11.2.0.1.0(该处是tnsnames.ora路径)
4:重启PL/sql .登录,书写sql语句,检查是否搞定