我想创建一个PL-SQL过程,该过程从一个数据库远程连接和更新各种数据库,并通过创建动态db_link来更新每个数据库上的表,并且在每次更新所有数据库中的表后都应创建并删除该db_link。我们该怎么做?请帮忙。
答案 0 :(得分:0)
警告:关于动态创建和删除数据库链接的安全漏洞,因为表必须为每个远程帐户存储密码。
1-创建表格
A
2-包装规格
Table name: REMOTE_INFO
host_name varchar2(25) primary_key,
username_remote varchar2(30),
password_remote varchar2(30),
host_connection varchar2(30),
table_local varchar2(30),
schema_remote varchar2(30),
table_remote varchar2(30),
condition varchar2(4000)
3件套车身
create or replace package pk_remote
is
/* ====================================================================================================
-- ref: question on
-- https://stackoverflow.com/questions/56339278/creating-and-dropping-dynamically-db-link-each-time-connecting-various-dbs-after
-- 2019-05-30 by alvalongo
==================================================================================================== */
kLINE_FEED constant varchar2(1):=chr(10);
--
procedure pr_copy(p_iHost varchar2,
p_oError out number,
p_oMessage out varchar2
);
End pk_remote;