How to enable/disable a scheduled job?
Using the package DBMS_SCHEDULER one can enable/disable jobs.To disable job: This disables the job from running
SQL> exec dbms_scheduler.disable('GATHER_STATS_JOB'); PL/SQL procedure successfully completed.
check job status
SQL> select job_name, enabled from DBA_SCHEDULER_JOBS WHERE job_name ='GATHER_STATS_JOB'; JOB_NAME ENABL --------------- ------ GATHER_STATS_JOB FALSE
To enable job:
SQL> exec dbms_scheduler.enable(‘GATHER_STATS_JOB’); PL/SQL procedure successfully completed.
check job status
SQL> select job_name, enabled from DBA_SCHEDULER_JOBS WHERE job_name = ‘GATHER_STATS_JOB’; JOB_NAME ENABL --------------- ----- GATHER_STATS_JOB TRUE
You can run the job manually via DBMS_SCHEDULER
BEGIN DBMS_SCHEDULER.RUN_JOB( job_name => 'GATHER_STATS_JOB' ); END; /
Job Run Detailed History
select owner,job_name,status,error#,run_duration,actual_start_date from dba_scheduler_job_run_details where job_name like '%GATHER%' order by actual_start_date;
No comments:
Post a Comment