How to schedule a job in pl/sql?

后端 未结 1 674
[愿得一人]
[愿得一人] 2021-01-16 10:22

I have created one stored procedure with name

traffic_details_temp_send_mail;

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

P

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-16 11:08

    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.

    0 讨论(0)
提交回复
热议问题