Query JOB Oracle status

Published by Patrizia Gardis on

With the article Query JOB Oracle status, we provide a statement to retrieve information about scheduled JOBS in the database.

A JOB is a scheduling of a procedure, a PL/SQL package, or a simple statement that is programmed to start at a specific day and time when we want to execute the software.

So, if we want to start a statement at a certain time, we need to schedule a JOB in the Oracle scheduler.

Once the JOB is scheduled, it will start every time it is requested.

In the event that the JOB fails, it is automatically retried by default for 16 times, until it reaches the BROKEN state, which means the scheduling is interrupted due to too many failures.

Therefore, to check the status of a JOB, we provide the query at the bottom of the page.

We select the JOB number, the user it is scheduled with, and the owning user.

Additionally, we select the date and time of the last and next execution.

Finally, we select the number of failures, the BROKEN state, and the scheduled code or procedure.

Then, we retrieve the information from the DBA_JOBS view and filter the records by JOB number.

 

Query JOB Oracle status:

set lines 200 pages 999
col log_user format a15
col priv_user format a15
col schema_user format a15
col last_run format a15
col next_run format a15
col what format a60
col fails format 999
select job
, log_user
, priv_user
, schema_user
, to_char(last_date, 'hh24:mi dd/mm/yy') last_run
, to_char(next_date, 'hh24:mi dd/mm/yy') next_run
, failures fails
, broken
, substr(what, 1, 60) what
from dba_jobs
where job=&job
order by 4;

 

 

To view my guides on CRS Command click here!
At this LINK, instead, you’ll find the SQL queries.

Stay updated on our activities by joining our community:
Facebook
Youtube
Linkedin

If you have any doubts, feel free to comment on the article.


0 Comments

Leave a Reply

Avatar placeholder