Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 
 

dba_scheduler_job_log tips 

Oracle Database Tips by Donald BurlesonJune 1,  2015

 

By Kamran Agayev Agamehdi

The dba_scheduler_job_log view can be used to view log entries for previously executed jobs. This view displays log information for all dbms_scheduler jobs in the database. When creating a job, we define log_history parameter and logs in that view are available for number of days as it specified in log_history parameter (default is 30)

One of the main columns in dba_scheduler_job_log is the STATUS column. This column gives us the status of the operation. Possible values for this column are dependent on the value in the OPERATION column. In most cases, STATUS will be NULL. Only for job run operations will it have a value.

  • STATUS will be NULL when OPERATION is one of the following:
  • CREATE - Job was created
  • UPDATE - One or more job attributes have been modified
  • ENABLE - Job has been enabled
  • DISABLE - Job has been disabled
  • COMPLETED - For repeating jobs only, job has reached its end date or maximum number of runs
  • BROKEN - Job has reached its maximum number of failures

STATUS can be SUCCEEDED (job run completed successfully), FAILED (job run failed), or STOPPED (job run was stopped) when OPERATION is one of the following:

  • run - Regular job run
  • retry_run - Job is being retried because the previous run resulted in an error and RESTARTABLE is set to TRUE
  • recovery_run - Job is being rerun because the database went down, or the job slave crashed and RESTARTABLE is set to TRUE

Let's test the use of dba_scheduler_job_log step-by-step. In below example, we create a table and a job which will run every minute and insert one row in that table.

We will set logging_level of that schedule to logging_full to catch all changes made to that table and view all operations in dba_scheduler_job_log view

 
SQL> create table job_table1 (id number);
Table created.
 
SQL> BEGIN
sys.dbms_scheduler.create_job(
job_name => 'JOB1',
job_type => 'PLSQL_BLOCK',
job_action => 'INSERT INTO job_table1 values(1);',
repeat_interval => 'FREQ=MINUTELY',
start_date => sysdate,
enabled => true);
END;
/
PL/SQL procedure successfully completed.
 
SQL> select * from job_table1;
 
        ID
----------
         1
 
SQL> begin
  DBMS_SCHEDULER.SET_ATTRIBUTE('JOB1','logging_level',DBMS_SCHEDULER.LOGGING_FULL);
  end;
  /
PL/SQL procedure successfully completed.
 
SQL> begin
  2  DBMS_SCHEDULER.DISABLE('JOB1',TRUE);
  3  end;
  4  /
PL/SQL procedure successfully completed.
 
SQL> begin
  2  DBMS_SCHEDULER.ENABLE('JOB1');
  3  END;
  4  /
PL/SQL procedure successfully completed.
 
SQL> drop table job_table1;
Table dropped.
 
Now we can query dba_scheduler_job_log to see the values:
select
   log_id,
   to_char(log_date,'dd/mm/yyyy hh24:mi:ss') log_date,
   substr(job_name, 1,20)                    job_name,
   substr(status, 1,10)                        status,
   additional_info                          operation
from
   dba_scheduler_job_log
where
   job_name='JOB1'
order by
   log_date ;
 
LOG_ID        LOG_DATE             JOB_NAME    STATUS         OPERATION    
------ ----------          ---------   ----------            -----------
450    31/05/2009 17:27:58 JOB1        SUCCEEDED
455    31/05/2009 17:28:57 JOB1        SUCCEEDED
459    31/05/2009 17:29:49 JOB1                       FORCE="TRUE", REASON="manually disabled"
463    31/05/2009 17:30:24 JOB1                       REASON="manually enabled"
467    31/05/2009 17:30:57 JOB1        SUCCEEDED
472    31/05/2009 17:31:57 JOB1        SUCCEEDED
477    31/05/2009 17:32:57 JOB1        FAILED
 

As it seen above, first two minutes, our job ran successfully. After we disabled the job, the information about it was logged in operation column. Then we enabled it, it also logged in operation column. Later, it ran two times successfully.

At the end, we dropped the table, thus our job failed and was logged in the dba_scheduler_job_log view with failed status.




 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.