How can I track the status of my running job using Oracle's DBMS Scheduler?
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.
精彩评论