Thursday, February 16, 2012

Job schedule compile invalid objects

REQUIRE SYS PRIVILIGES TO EXECUTE UTL_RECOMP

BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'compile_invalid',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN UTL_RECOMP.recomp_serial(''LDBO''); END;',
start_date => '08-FEB-12 11:35.00.00 PM ASIA/CALCUTTA',
repeat_interval => 'freq=DAILY',
end_date => NULL,
enabled => TRUE,
comments => 'JOB to compile invalid objects');
END;
/



BEGIN
DBMS_SCHEDULER.drop_JOB (job_name => 'compile_invalid');
END;
/

exec DBMS_SCHEDULER.run_job ('compile_invalid');


select * from dba_scheduler_jobs;
select job_name,job_action,start_date,repeat_interval,end_date,run_count,failure_count from dba_scheduler_jobs where job_name='ANALYZE';

SELECT * FROM dba_scheduler_running_jobs;

No comments:

Post a Comment

Followers