1.登录PL/SQL连接数据库不显示数据库
Oracle数据库和PL/SQL Developer的安装步骤 省略。
原因是安装的PL/SQL Deleloper只能识别32的oci.dll,PL/SQL Deleloper不区分64位和32位,需要修改oci.dll。
2.解压文件instantclient-basic-nt-11.2.0.2.0
下载地址我的百度云:链接:https://pan.baidu.com/s/1YwykI2cFD5qZ-1ZZf3toEg
提取码:rf91
然后在解压后的C:\instantclient_11_2目录下新建NETWORK\ADMIN目录
在ADMIN目录下新建tnsnames.ora文件 写入以下内容,注意内容中标红字体
:
# tnsnames.ora Network Configuration File: D:\Oracle\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = PC-20181210FQNS)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
创建sqlnet.ora文件
内容是:
# sqlnet.ora Network Configuration File: D:\Oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
3.配置PL/SQL Developer的Oracle Home和OCI Libaray
以非登录模式进入PL/SQL----------工具-----首选项,
Oracle Client目录为(D:\Oracle\product\instantclient_11_2),(注意这个地址是你Oracle的安装目录)
OCI Libaray路径为Oracle Client目录为D:\Oracle\product\instantclient_11_2\oci.dll)。(注意这个地址是你Oracle的安装目录)
点击“确定”,现在配置已完成,退出PL/SQL
4:添加环境变量(系统变量中添加1个)
指定数据库使用的编码。如果不设置成以下值,那么连接上数据库后,你看到的所有中文的内容将会是 乱码,都是一堆问号 。
NLS_LANG:SIMPLIFIED CHINESE_CHINA.ZHS16GBK
确定。
5.重启plsql,输入用户名/密码,登录成功!