How to schedule a job in pl/sql?

旧巷老猫 提交于 2019-12-09 03:26:26

问题


I have created one stored procedure with name

traffic_details_temp_send_mail;

How to make this procedure to run everyday at 10AM?

Please help with block of code.

Thanks in advance.


回答1:


you can create a scheduler job:

begin
    dbms_scheduler.create_job(job_name        => 'TRAFFIC_DETAILS_JOB',
                              job_type        => 'STORED_PROCEDURE',
                              job_action      => 'traffic_details_temp_send_mail',
                              start_date      => systimestamp,
                              end_date        => null,
                              repeat_interval => 'freq=daily; byhour=10; byminute=0; bysecond=0;',
                              enabled         => true,
                              auto_drop       => false,
                              comments        => 'your description here.');
end;
/

then you can see the details in the scheduler job views (user_scheduler_jobs etc). see here for information on scehduler jobs.



来源:https://stackoverflow.com/questions/15384952/how-to-schedule-a-job-in-pl-sql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!