Re: schedule a job every 15 mins *but* only during the office hours

  • From: malcolm arnold <malcolmarnold@xxxxxxxxx>
  • To: t_adolph@xxxxxxxxxxx
  • Date: Wed, 26 Oct 2005 15:24:17 +0100

> Hi all,
>
> I'm trying to setup snapshots to run every 15 minutes during working hours,
> else hourly.  I'm ignoring weekends for now,...
>

That's a funny one.

Your case statement is being evaluated as a parameter to
dbms_job.submit, instead of being evaluated by the server after the
job runs.

You want:
interval => 'case
           when (to_char(sysdate,''hh24'') between 8 and 20) then
            ''trunc(sysdate,''''MI'''') + 15/1440' -- 15 mins
           else
            ''trunc(sysdate,''''HH24'''') + 1/24''
         end'

(Note all the extra apostrophies...)

Malcolm.
--
//www.freelists.org/webpage/oracle-l


Other related posts: