下载下来的instantclient-basic-nt-11.2.0.4.0.zip文件解压缩D:Program Filesinstantclient_11_2(可以选择自己的目录)
(1) 增加TNS_ADMIN环境变量
TNS_ADMIN=D:Program Filesinstantclient_11_2
(2) 把TNS_ADMIN加入到Path变量
(3) 把tnsnames.ora文件放到TNS_ADMIN目录(D:Program Filesinstantclient_11_2)中。
tnsnames.ora
将instantclient解压到磁盘,然后手工增加系统环境变量
path=C:instantclient-basic-nt-11.2.0.2.0
ORACLE_HOME=C:instantclient-basic-nt-11.2.0.2.0
TNS_ADMIN=C:instantclient-basic-nt-11.2.0.2.0
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
# tnsnames.ora Network Configuration File: F:appAdministratorproduct11.2.0dbhome_1NETWORKADMIN nsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl2)
)
)
在plsql首选项中,配置配置oracle主目录为:
E:Javainstantclient_11_2
E:Javainstantclient_11_2oci.dll
重启plsql
;