创建ORACLE数据库链接(DBLINK)

感谢教会我使用数据库链接的同事,现在将这个分享出来,供大家参考,代码如下:

create database link T21_4
  connect to T21_4 identified by 123456
  using '(DESCRIPTION =
       (ADDRESS_LIST =    
        (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.106)(PORT =1521))
       )
       (CONNECT_DATA =
        (SERVICE_NAME = orcldev)
       )
      )';



create database link 数据库链接名称
  connect to 调用远程数据库的用户名 identified by 调用远程数据库的密码
  using '(DESCRIPTION =
       (ADDRESS_LIST =    
        (ADDRESS = (PROTOCOL = TCP)(HOST =服务器IP地址)(PORT =端口号))
       )
       (CONNECT_DATA =
        (SERVICE_NAME = 服务名称)
       )
      )';

一共有6处根据实际情况可改动,我都是用汉字标记的,希望对大家有所帮助。

你可能感兴趣的:(oracle)