oracle scheduled task
/** Create a synchronized scheduled task JOB_PRO_OA_ORGANIZATION_V represents the stored procedure name (note: there is a semicolon after it) Timing frequency trunc(sysdate)+25/24 means to execute at 1 am every day sysdate+1/24/60 means to execute every minute sysdate+5/1440 means to execute every five minutes **/ declare job_num number; begin dbms_job.submit(job_num,'JOB_PRO_OA_ORGANIZATION_V;',SYSDATE,'trunc(sysdate)+25/24'); commit; end;
Query which jobs are available
select * from all_jobs
Now I want to modify the timing execution frequency
begin dbms_job.interval(5,'trunc(sysdate)+25/24'); --dbms_job.remove(7); commit; end;
Attribute Details and Usage of Scheduled Tasks
DBMS_JOB.SUBMIT(:jobno,//job号 'your_procedure;',//The procedure to be executed trunc(sysdate)+1/24,//Next execution time 'trunc(sysdate)+1/24+1'//Every time interval ); 删除job:dbms_job.remove(jobno); 修改job:dbms_job.what(jobno,what); Modify the next execution time: dbms_job.next_date(job,next_date); Modify the interval time: dbms_job.interval(job,interval); 停止job:dbms.broken(job,broken,nextdate); Start job: dbms_job.run(jobno); example: VARIABLE jobno number; begin DBMS_JOB.SUBMIT(:jobno, 'Procdemo;', SYSDATE, ’SYSDATE + 1/720’); commit; end;