oracle定时器DBMS_JOB
oracle定时器DBMS_JOB
declare
jobno number;
begin
dbms_job.submit(
jobno,
what => 'Clear_WELLDIAGRAM;', --pro_clear_log为存储过程的名称
next_date=>to_date('21-01-2022 13:30:00','dd-mm-yyyyhh24:mi:ss'),--参数指识何时将运行这个工作
Interval => 'TRUNC(sysdate,''mi'') + 300 / (24*60)' --定义时间间隔 5个小时
);
commit;
end;
CREATE OR REPLACE PROCEDURE Clear_WELLDIAGRAM
is
begin
Delete from well_diagram WHERE ts<sysdate-2;
commit;
end;