标签:height oracle protoc val 存储过程 res where http HERE
---创建目标数据库连接DBLINK
create database link testdblink
connect to xxx identified by "xxx"
using ‘(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = xxx.xxx.x.x)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = emis)))‘;
---创建存储过程
CREATE OR REPLACE PROCEDURE PROC_A IS
begin
merge into A@testdblink b
using A c
on (b.ID = c.ID)
when matched then
update set b.STATE = c.STATE where b.ID = c.ID
when not matched then
insert
(b.STATE,
b.ID)
values
(c.STATE,
c.ID);
commit;
end PROC_A;
--创建DBMS_JOBS定时器,定时执行存储过程
declare jobno number;
begin
dbms_job.submit(jobno,‘PROC_A;‘, sysdate, ‘sysdate+1/24/60‘);
commit;
end;
/
标签:height oracle protoc val 存储过程 res where http HERE
原文地址:https://www.cnblogs.com/haozhenjie819/p/9966062.html