开发者

How can I track the status of my running job using Oracle's DBMS Scheduler?

开发者 https://www.devze.com 2023-03-10 15:59 出处:网络
Is this possible with oracle\'s scheduler. I just want to track where it currently is executing, when the job is running and get feedback.

Is this possible with oracle's scheduler. I just want to track where it currently is executing, when the job is running and get feedback.

dbms_scheduler.create_job(
    job_name => 'hello_oracle_scheduler',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN DBMS_OUTPUT.PUT_LINE('' ''); DBMS_OUTPUT.PUT_LINE(''开发者_开发问答Hello world of scheduler. Time to execute scheduled jobs!!!''); END;',
    number_of_arguments => 0


You better use a table and insert/updates on it to track your JOBs. DMBS_OUTPUT package makes sense in the weird cases where you have a console.


I would recommend using Pablo / Shannon's approach of a table insert through a proc with pragma autonomous_transaction option. However, another option would be to use UTL_MAIL (or UTL_SMTP if on 9i or less) to send an email to yourself if this is just a quick and dirty need.

0

精彩评论

暂无评论...
验证码 换一张
取 消