Databases Reference
In-Depth Information
Enable or disable components
The
DBMS_SCHEDULER.ENABLE
enables a Scheduler component, such as a program,
job, window or window group, and
DBMS_SCHEDULER.DISABLE
disables components.
This procedure enables a job belonging to the demo Scheduler. In the previous
section the
TEST_MINUTELY
Scheduler job was defined.
EXEC sys.dbms_scheduler.enable( '"OSCHEDULER"."TEST_MINUTELY"' );
Managing job logs
There are two important tasks to perform with the logs; these tasks are to
monitor
them and
schedule
a
purge
task
on them. All job related activity generated by means
of the
dbms_scheduler
leaves a log behind for forensic purposes in case something
goes wrong with the job or just to make sure the job ran successfully. Once the user
has made sure everything went well and there is nothing else to debug, the log
information becomes a ballast the user should get rid of, otherwise this can easily
flood the database with useless information.
Monitor a Job Execution
The outcome from the job Scheduler can be monitored at the
[DBA
|
USER
|
ALL]_
SCHEDULER_JOB_LOG
views. The views are listed later in this chapter.
SQL> SELECT LOG_ID, LOG_DATE, JOB_NAME, STATUS
2 FROM USER_SCHEDULER_JOB_LOG
3 WHERE LOG_DATE > TRUNC(SYSDATE)
4* ORDER BY LOG_ID
LOG_ID LOG_DATE JOB_NAME STATUS
---------- ------------------------------------ ------------- ----------
17824 30-NOV-08 12.21.42.547453 AM -06:00 TEST_MINUTELY SUCCEEDED
17825 30-NOV-08 12.22.42.538071 AM -06:00 TEST_MINUTELY SUCCEEDED
17826 30-NOV-08 12.23.42.080787 AM -06:00 TEST_MINUTELY SUCCEEDED
Search WWH ::
Custom Search