13.1.17

DBA_SCHEDULER_JOB_RUN_DETAILS and PURGE_LOG

How to purge DBA_SCHEDULER_JOB_RUN_DETAILS?


Manually deleting from DBA_SCHEDULER_JOB_RUN_DETAILS is not recommended by oracle.DBA_SCHEDULER_JOB_RUN_DETAILS is a view that is using two master tables (scheduler$_job_run_details and scheduler$_event_log) and display the information about jobs history.

As there is one procedure named PURGE_LOG and Oracle have Scheduler for this procedure. It will purges all rows in the job log that are older than 30 days.This is the default behavior of this procedure. You can change this to any number of days you want by setting the attribute "SET_SCHEDULER_ATTRIBUTE". e.g.

exec DBMS_SCHEDULER.SET_SCHEDULER_ATTRIBUTE('log_history','15');

It will purge all logs older than 15days and it will maintain the history of 15days.

But If you want manually purge these logs, you can use below solution:-

exec DBMS_SCHEDULER.PURGE_LOG(log_history => 15, which_log => 'JOB_LOG');

It will purge all entries from the jog log that are older than fifteen days.

Keep posting :)

No comments:

Post a Comment

Really Thanks