Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 482
help Avatar asked Dec 28 '22 19:12

help


2 Answers

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.

like image 63
Pablo Santa Cruz Avatar answered May 10 '23 01:05

Pablo Santa Cruz


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.

like image 45
Craig Avatar answered May 10 '23 00:05

Craig