一、下载Instant Client
百度盘下载链接: https://pan.baidu.com/s/1ziTGVUW-6141skNl_PK69w 密码: 4bpd
#先安装Instant Client,PL/SQL依赖instantclient;
#下载Instant Client (轻量级的客户端),作为本地Oracle环境
#但要注意第三方工具如:PL/SQL Developer的版本,32位的要对应32位的OracleInstant Client,不要因为系统是[64位](https://www.baidu.com/s?wd=64%E4%BD%8D&tn=24004469_oem_dg&rsv_dl=gh_pl_sl_csd)的就下载64位的,这个要注意。
#官网下载地址:
https://www.oracle.com/cn/database/technology/instant-client.html
#我这里下载的是:
https://download.oracle.com/otn/nt/instantclient/10205/instantclient-basic-win64-10.2.0.5.zip,也就是百度盘链接中的压缩包
二、配置环境变量
#将下载的C:\instantclient_10_2解压拷贝到 C:\instantclient_10_2;
#在“环境变量”的“系统变量”中增加
ORACLE_HOME = C:\instantclient_10_2
# tnsnames.ora所在目录位置
TNS_ADMIN = C:\instantclient_10_2\network\admin
NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK
三、新建tnsnames.ora文件
# windows系统注意文件扩展名,不要以txt结尾,否则无法连接到数据库
# 在C:\instantclient_10_2 创建目录network\admin ,在该目录下新建一个tnsnames.ora文件,增加自己数据库的别名配置;
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.28)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
四、PL/SQL配置
百度盘下载链接: https://pan.baidu.com/s/1r0AfDXG1vY2QBF9FBenbcQ 密码: who5
#下载一个PL/SQL,安装时默认一直下一步就可以,先不登录,先进入配置界面,configure -> preferences
image.png
点击apply,重新启动PL/SQL
设置软件语言,点击apply生效
image.png
遇到问题:
ORA-12154: TNS: 无法解析指定的连接标识符
解决:
#/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/network/admin
#服务端tnsnames.ora文件 :
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.229.222)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.229.222)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
# C:\instantclient_10_2\network\admin
# 客户端 tnsnames.ora文件:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.28)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
# 两个配置文件别名最好一致,我的是因为别名不一致始终抛上面的错误;
# 注意客户端配置文件中的IP(公网IP),而服务器对应的IP是私网IP;
网友评论