Thursday, September 30, 2010

DBMS_SCHEDULER

This is some task i did for the first time in one of my recent projects.
so just an another attempt to share my learning.
To create a scheduled job the syntax is -

begin
sys.dbms_scheduler.create_job(job_name => 'test_job',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN DBMS_STATS.gather_schema_stats(''ABC''); END;',
repeat_interval => 'FREQ=DAILY;BYHOUR=21;BYMINUTE=45;BYSECOND=0',
start_date => sysdate,
job_class => 'DEFAULT_JOB_CLASS',
comments => 'gather stats job',
auto_drop => TRUE,
enabled => TRUE);
END;

No comments:

Post a Comment