Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Execution interval is incorrect while using DBMS_JOB.SUBMIT

Re: Execution interval is incorrect while using DBMS_JOB.SUBMIT

From: Eric Parker <eric.parkerthedross_at_virgin.net>
Date: Tue, 17 Aug 2004 17:58:44 +0100
Message-ID: <2oerq3F9kfp7U1@uni-berlin.de>

"Maoz Mussel" <maoz_mussel_at_yahoo.com> wrote in message news:407fd242.0408170747.43fdc0a3_at_posting.google.com...
> Hi,
>
> I've created a job using the following code:
>
> DECLARE
> X NUMBER;
> BEGIN
> SYS.DBMS_JOB.SUBMIT
> ( job => X
> ,what => 'TEST_ONLY.TEST_JOB;'
> ,next_date => to_date('17/08/2004 17:33:00','dd/mm/yyyy
> hh24:mi:ss')
> ,interval => 'TRUNC(SYSDATE+5/1440,''MI'')'
> ,no_parse => TRUE
> );
> END;
>
> ... so I expected it to run first time at 17:33:00, than again and
> again every 5 minutes. But I found that it actually run not exactly
> every 5 minutes, but with a small delay between each two execution,
> i.e. next one was on 17:38:07, then the next on 17:43:15 and so on, so
> after some time this difference have huge impact on execution time and
> intervals (the job itself is very small and completed after no more
> than a second).
> Any ides why it's happened like this? How can I change it to work as I
> expected it to be?
>
> thanks,
> Maoz

Maoz

If you calculate the current time truncated to 5 minute units, then add 3 + 5
minutes to that to give you the next time, you should not see any drift. Something like this for the interval :

TRUNC(SYSDATE) + (TRUNC((SYSDATE - TRUNC(SYSDATE)) * 288) + 1.6)/288 eric

--
Remove the dross to contact me directly
Received on Tue Aug 17 2004 - 11:58:44 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US