Oracle数据库和SQLServer数据库中创建DB-Link语法

1.Oracle数据库中DB-Link对象创建语法:

create public database link DB_Link_Name connect to userName identified by password using 
'(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = OTHER_SNAME)
    )
  )';

2.SQLServer数据库中DB-Link对象创建语法:

exec sp_addlinkedserver 'ERP' , '' , 'SQLOLEDB' , '远程服务器名或ip地址'
exec sp_addlinkedsrvlogin 'ERP' , 'false' , null , '用户名' , '密码'
exec sp_serveroption 'ERP','rpc','true';

你可能感兴趣的:(Oracle,SQL,Server)