/*==============================================================*/
/* dblink: dblk_remote 连接远程数据库 */
/*==============================================================*/
begin
execute immediate 'drop public database link ora332'; -- ora332:自定义的dblink名称
exception when others then
commit;
end;
/
create public database link ora332
connect to adlib_support
identified by H8eTZzC0Qr0w
using '(description =
(address =
(protocol = tcp)
(host = 172.30.33.12) -- 数据库ip(创建时改为自己的)
(port =1521) --数据库端口(创建时改为自己的)
)
(connect_data =
(server = dedicated)
(service_name = orcl) --数据库服务名(创建时改为对应的)
)
)'
;
--查询
select * from ZY_LITERATURE@ora332;