下载、安装、激活PLSQL Developer,本例使用 PLSQL Developer 13 (64 bit)。
下载Oracle即时客户端 Instant Client,本例使用11gR2
链接:http://www.oracle.com/technetwork/cn/database/features/instant-client/index-092699-zhs.html
关于即时客户端 Instant Client: https://www.oracle.com/technetwork/cn/topics/instantclient-095449-zhs.html
第一步:监听配置文件
解压下载的Oracle客户端-->instantclient,放置到一个固定的地方(避免被删),在其目录下新建文件夹\network\admin\,已下或称“该文件夹”
方法1: 若本机装有Oracle数据库,将Oracle数据库配置文件(3个.ora文件,路径在\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN)拷贝到该文件夹下,将对应的服务器IP和全局数据库名改掉(参考方法二)。
方法2: 在该文件夹下手动创建3个文件
listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\oracle12c\product\12.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\oracle12c\product\12.2.0\dbhome_1\bin\oraclr12.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle服务器ip)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
tnsnames.ora
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle服务器ip)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = ORCL)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Oracle服务器ip)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = orcl) #Oracle 全局数据库名
)
)
sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
#远程无法连接数据库 在数据库服务器sqlnet.ora中加上这段
SQLNET.ALLOWED_LOGON_VERSION=8
第二步:PLSQL Developer客户端配置
不登录账户直接打开,configure配置—preference首选项—connect连接。
Oracle Home主目录:...\instantclient_11_2 (Oracle即时客户端所在路径)
OCILibrary库:...\instantclient_11_2\oci.dll (Oracle即时客户端主目录中的oci.dll文件)
Apply应用——OK确定,重启,登录可以连接了!