解决方案分为一下几个步骤:
1.instantclient_11_2下创建tnsnames.ora
2.ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 虚拟机IP)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
3.添加一个环境变量,名为TNS_ADMIN,值为tnsnames.ora文件所在路径d:\instantclient_11_2\tnsnames.ora,plsql通过这个找到orcl连接字符串
4.添加一个环境变量NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK
5.打开PLSQL,不用登陆,工具-首选项-ORACLE-连接:
勾选检查连接
Oracle主目录: d:\instantclient_11_2
OCI库: d:\instantclient_11_2\oci.dll
时间: 2024-10-12 17:12:02