PLSQL连接远程数据库

如何配置PLSQL连接远程oracle服务

首先电脑安装了oracle的客户端

1.找到你安装oracle的目录下tnsnames.ora这个文档;

例如我的安装目录:

D:\app\oracle\product\11.2.0\dbhome_1\NETWORK\ADMINtnsnames.ora

2.打开tnsnames.ora这个文档

找到下面的代码

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

将其复制到下面
然后按照如下格式修改

ORCL_远程数据库ip地址 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =远程数据库ip地址)(PORT = 远程服务器端口号))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = 远程数据库服务名)
    )
  )

3.比如我连接一个远程数据库 ip=191.168.1.10,端口号=1521,数据库名=ORCL

ORCL_192.168.1.10 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL)
      )
  )

4.保存tnsnames.ora文件,重新打开plsql 选择ORCL_192.168.1.10这个选项 然后输入用户名密码连接就OK了

PLSQL连接远程数据库_第1张图片

你可能感兴趣的:(PLSQL连接远程数据库)