Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dbms_scheduler call to run every 5 minutes between 6am and 10pm

bencolJul 22 2010 — edited Jul 22 2010
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
This post has been answered by Centinul on Jul 22 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 19 2010
Added on Jul 22 2010
5 comments
31,860 views