1.下载对于oracle数据库对于版本的instantclient_11_2
oracle11g下载地址:https://www.oracle.com/technetwork/topics/winx64soft-089540.html
2.将文件解压出来D:\Documents\plsqldoc\instantclient_11_2
3.在D:\Documents\plsqldoc\instantclient_11_2下新建tnsnames.ora 文件。路径D:\Documents\plsqldoc\instantclient_11_2\tnsnames.ora
4.新建 tnsnames.ora 文件里面加入
-----------------------------分割线----------------------------------------------
# tnsnames.ora Network Configuration File: D:\Documents\plsqldoc\instantclient_11_2\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = IPHOME )(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
-----------------------------分割线----------------------------------------------
5.IPHOME数据库所在的地址,本机填localhost
6.之后在 计算机——属性——高级系统设置——高级——环境变量——系统变量,中新建
变量名:TNS_ADMIN
变量值:D:\Documents\plsqldoc\instantclient_11_2
变量值写填自己 tnsnames.ora 文件所在的路径
7.修改PLSQL查询结果乱码(???)
变量名:NLS_LANG
变量值:SIMPLIFIED CHINESE_CHINA.ZHS16GBK
8.系统变量 —— Path中加入D:\Documents\plsqldoc\instantclient_11_2
instantclient_11_2对于自己电脑所在的路径
9.PLSQL中——工具——首选项——连接
ORCALE中目录:D:\Documents\plsqldoc\instantclient_11_2
OCI库:D:\Documents\plsqldoc\instantclient_11_2\oci.dll