declare
job_num number;
iCount number;
BEGIN
select count(1)
into iCount
from user_jobs
where what = '存储过程;';
if iCount != 0 then
select job
into job_num
from user_jobs
where what = '存储过程;';
DBMS_JOB.remove(job_num);
end if;
DBMS_JOB.SUBMIT(JOB => job_num,
WHAT => '存储过程;',
NEXT_DATE => sysdate + 1,
INTERVAL => 'TRUNC(sysdate+1)+3/24');
commit;
end;
/
每天凌晨3点运行