1.查看dblink
select owner,object_name from dba_objects where object_type='DATABASE LINK';
或者
select * from dba_db_links;
2.创建dblink
前提:
grant create public database link,create database link to myAccount;
create public database link dblinkname connect to username
identified by password
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = database_ip)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME =servicename)
)
)';
如果在create之后不加public,则创建的dblink就不是公共的,就只有创建者可以使用了.
补充:如何确定数据库的servicename:
show parameter[s] service_names;
select name,value from v$parameter where name='service_names'
4.删除
drop public database link dblinkname;
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。