1. 需要安装 Oracle Instant Client
官网:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
下载解压至任意目录即可,例如 C:\app\instantclient\
2. 创建文件tnsnames.ora,内容如下
myDB =
(DESCRIPTION =
(ADDRESS_LIST =
(
ADDRESS =
(PROTOCOL = TCP)
(HOST = localhost)
(PORT = 1521)
)
)
(
CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
其中myDB的名字可以任意写一下,修改一下对应的HOST, PORT, SERVICE_NAME,然后保存到Oracle Instant Client根目录下,即C:\app\instantclient\tnsnames.ora
3. 打开PL/SQL Developer,第一次可以点取消登陆,打开“工具” -> “首选项” -> "Oracle连接",设置如下
Oracle主目录名:C:\app\instantclient\
OCI库:C:\app\instantclient\oci.dll
4. 增加环境变量 TNS_ADMIN,值为C:\app\instantclient\
5. 关闭PL/SQL Developer,重新打开时选择数据库为myDB,填入远程Oracle的用户名和密码即可。