oracle新建作业

DECLARE
i_count number;
job_num number;
BEGIN
select count(job) into i_count from user_jobs where upper(what)='存储过程名称;';
if i_count>0 then
select job into job_num from user_jobs where upper(what)='存储过程名称;';
dbms_job.remove(job_num);
end if;
END;
/
commit;
DECLARE X NUMBER;
BEGIN
DBMS_JOB.SUBMIT
( job => X
,what => '存储过程名称;'
,next_date => to_date(to_char(sysdate+1,'yyyy-mm-dd')||' 01:00:00','yyyy-mm-dd hh24:mi:ss')
,interval => 'SYSDATE+1'
,no_parse => TRUE
);
END;
/
commit;

原文地址:https://www.cnblogs.com/shuideqing/p/6690511.html