Oracle DBlink的创建
1.需要用数据库管理员给otcts用户授予创建dblink的权限
grant create database link to with admin option;
commit;
CONNECT TO IDENTIFIED BY
USING '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = )(PORT = 1521)))(CONNECT_DATA =(SID = )))';
SELECT * FROM TABLE_NAME@LINK_NAME;
4.删除
grant create database link to with admin option;
commit;
2、创建DBLink
CREATE PUBLIC DATABASE LINKCONNECT TO IDENTIFIED BY
USING '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = )(PORT = 1521)))(CONNECT_DATA =(SID = )))';
COMMIT;
-- 数据信息
3、用例(调用DBLink的表):SELECT * FROM TABLE_NAME@LINK_NAME;
4.删除
drop PUBLIC DATABASE LINK ;
COMMIT;
推荐阅读:
利用Oracle DBLink进行表同步
Oracle DBLink使用
Oracle通过DBLink访问GreenPlum
ORA-01017/ORA-02063 DBLink建立错误问题分析及解决
Oracle 创建DBLink 报错:ORA-01017、ORA-02063
Oracle中dblink创建的两种方式