语法说明:
即 :
(ADDRESS_LIST=(ADDRESS =(PROTOCOL = TCP)(HOST = 被连接库的IP地址)(PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = 数据库服务名))
)';
create public database link <DBLink名称>
connect to <被连接库的用户名> identified by <被连接库的密码>
using '<Oracle客户端工具建立的指向被连接库服务名>';
即 :
create public database link DBLink名称
connect to <被连接库的用户名> IDENTIFIED BY <被连接库的密码>
using '( DESCRIPTION =(ADDRESS_LIST=(ADDRESS =(PROTOCOL = TCP)(HOST = 被连接库的IP地址)(PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = 数据库服务名))
)';
工作使用例子:
--Create database link
create database link xxx
connect to xxx identified by xxx
using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 2261)))(CONNECT_DATA =(SERVICE_NAME = xxx)))';