I would like to set up a call to run a PL/SQL procedure every 5 minutes between 6am and 10pm.
I can do the every 5 minutes part like this:
exec dbms_scheduler.create_job -
(job_name => 'JOB_1' -
,job_type => 'STORED_PROCEDURE' -
,job_action => 'package_a.procedure_b' -
,number_of_arguments => 0 -
,start_date => TRUNC(SYSDATE,'HH') -
,repeat_interval => 'FREQ=MINUTELY;INTERVAL=5' -
,end_date => NULL -
,job_class => 'DEFAULT_JOB_CLASS' -
,enabled => TRUE -
,auto_drop => TRUE -
,comments => 'my comments' -
)
and the [docs |http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/scheduse.htm#sthref3603] tell me about repeat intervals:
But I can't work out the syntax to combine the every 5 minute interval with the 6am-10pm window. I've looked at the create_window_syntax, but can't see how to combine this with the 5 minute repeat.
Thanks,
Ben
SQL>select * from v$version;
BANNER
________________________________________________________________
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production