Scheduled task interval

-- Query scheduled tasks

select * from user_jobs;

-- Stop JOB
begin dbms_job.broken(jobno,true);end;
begin dbms_job.remove(jobno);commit;end;/ --Start
JOB
begin dbms_job.run(jobno);end; --Modify the
content of JOB operation
begin dbms_job.what(jobno,'your_procedure;');end;
-- Modify the running time of JOB
begin dbms_job.interval(jobno,'interval');end;
-- Modify the next running time of JOB
begin dbms_job.next_date(jobno,nextdate );end;

-- every minute
interval => trunc(sysdate,'mi') + 1/(24*60)
-- every day at 1 o'clock
interval => trunc(sysdate) + 1 + 1/24
-- every Monday at 1 o'clock
interval => trunc(next_day(sysdate,'Monday')) + 1/24
-- 1 o'clock
interval on the 1st of each month => trunc(last_day(sysdate)) + 1 + 1/24 -- 1 o'clock interval
on the first day of each quarter
=> trunc(add_months(sysdate,3),'Q') + 1/24
-- every half year (January 1st July 1st) 1 point
interval => add_months(trunc(sysdate,'yyyy'),6 ) + 1/24
-- every January 1st at 1 o'clock
interval => add_months(trunc(sysdate,'yyyy'),12) + 1/24
-- every day at 8:10 
trunc(sysdate+1)+(8* 60+10)/(24*60)

-- Provided in toad
-- Daily
trunc(sysdate+1)
-- Weekly
trunc(sysdate+7)
-- Monthly
trunc(sysdate+30)
-- Every week
next_day(trunc(sysdate),'Monday' )
-- every day at 6 o'clock
trunc(sysdate+1)+ 6/24
-- half an hour
sysdate+30/(24*60)
-- every hour at the 15th minute
trunc(sysdate,'h') + (60+10) /(24*60)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325274626&siteId=291194637