Wednesday, September 18, 2013

DBMS Jobs

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

NLS boot file not found or invalid opmnctl ping – EBS 12.2 ADCFGCLONE FAIL

Error: adcfgclone.pl failed while performing clone of EBS 12.2 instance. This occurred while ohsT2PApply is in progress. INST_TOP/adm...