Purging Logs
On occasion, it may be necessary to manually
purge the scheduler logs prior to any regularly
scheduled automatic purge.
This can be accomplished using the
purge_log procedure.
log_history
IN PLS_INTEGER DEFAULT 0,
which_log
IN VARCHAR2
DEFAULT 'JOB_AND_WINDOW_LOG',
job_name
IN VARCHAR2
DEFAULT NULL)
The parameters and usages associated with this
procedure are listed below:
-
log_history
- This determines the age of the logs that
should be kept. Valid values range between
zero and 999 with the default being zero.
-
which_log
- This indicates which log or logs should be
purged. The possible parameters are
job_log,
window_log
and
job_and_window_log,
with the latter being the default value.
-
job_name
- This limits the purge operation of a
specific job, job class or comma separated
list. By default, this parameter is set to
NULL, which indicates logs for all jobs
should be purged.
The following example shows how the procedure
can be used:
BEGIN
DBMS_SCHEDULER.purge_log (
log_history => 5,
which_log
=> 'JOB_AND_WINDOW_LOG',
job_name
=> 'my_text_job');
DBMS_SCHEDULER.purge_log (
log_history => 15,
which_log
=> 'JOB_LOG',
job_name
=> 'my_text_job_class');
DBMS_SCHEDULER.purge_log (
log_history => 0,
which_log
=> 'WINDOW_LOG',
job_name
=> 'my_text_job');
END;
/
To purge all entries for both the job and window
logs, simply call the procedure with no
parameters.
SQL> EXECUTE
DBMS_SCHEDULER.purge_log;
The
auto_purge procedure uses
the
log_history
values defined at the scheduler, job class and
job
log_history level to
determine which logs should be purged. This
procedure runs as part of the scheduled purge
process, but it can also be run manually.
SQL> EXECUTE
DBMS_SCHEDULER.auto_purge;
Depending on the circumstances, it is possible
to manage the purging of logs manually as well
as automatically.
Moving on to the management of resources,
it was mentioned previously that windows are
involved in the link between the scheduler and
the resource manager.
In the following section, the link
between these two functional areas will be
examined.
 |
Fo r more details on Oracle utilities, see the book "Advanced
Oracle Utilities" by Bert Scalzo, Donald K. Burleson, and Steve Callan.
You can buy it direct from the publisher for 30% off directly from
Rampant TechPress.
|