日期:2014-05-16 浏览次数:20478 次
oracle创建三个定时任务,每个小时调用一次REPORT_HOUR,每天调用一次REPORT_DAY,每个月调用一次REPORT_MONTH
declare job1 number; job2 number; job3 number; begin sys.dbms_job.submit(job => job1, what => 'REPORT_HOUR;', next_date => to_date('01-01-2014 00:00:00', 'dd-mm-yyy hh24:mi:ss'), interval => 'sysdate+1/24'); sys.dbms_job.submit(job => job2, what => 'REPORT_DAY;', next_date => to_date('01-01-2014 00:00:00', 'dd-mm-yyy hh24:mi:ss'), interval => 'sysdate+1'); sys.dbms_job.submit(job => job3, what => 'REPORT_MONTH;', next_date => to_date('01-01-2014 00:00:00', 'dd-mm-yyy hh24:mi:ss'), interval => 'TRUNC(LAST_DAY(SYSDATE)+1)'); end;
select * from dba_jobs
sys.dbms_job.remove(job1);