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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: dbms_job - running jobs every 15 minutes

RE: dbms_job - running jobs every 15 minutes

From: Jesse, Rich <Rich.Jesse_at_qtiworld.com>
Date: Wed, 22 Jan 2003 11:44:21 -0800
Message-ID: <F001.00537C98.20030122114421@fatcity.com>


As an aside, if you want something to run twice a day at the same time (in my case 11:50 AM/PM), this seems to work well for an interval:

trunc(sysdate) + (decode(to_char(sysdate,'AM'),'AM',1,2)*12+(11+(50/60)))/24

Enjoy! :)

Rich

Rich Jesse                           System/Database Administrator
Rich.Jesse_at_qtiworld.com              Quad/Tech International, Sussex, WI USA


> -----Original Message-----
> From: Jared.Still_at_radisys.com [mailto:Jared.Still_at_radisys.com]
> Sent: Tuesday, January 21, 2003 6:24 PM
> To: Multiple recipients of list ORACLE-L
> Subject: dbms_job - running jobs every 15 minutes
>
>
> Feeling particularly anal the other day, I used the following
> specification to
> run statspack at the top of the hour, 15, 30 and 45 minutes after the
> hour.
>
> variable jobno number;
> variable instno number;
> begin
> select instance_number into :instno from v$instance;
> dbms_job.submit(
> :jobno
> , 'statspack.snap;'
> -- every 15 minutes at 00,15,30 and 45
> , trunc(sysdate,'hh24') + ( ( 15 + ( 15 *
> floor(to_number(to_char(sysdate,'mi')) / 15))) / ( 24 * 60 ))
> , 'trunc(sysdate,''hh24'') + ( ( 15 + ( 15 *
> floor(to_number(to_char(sysdate,''mi'')) / 15))) / ( 24 * 60 ))'
> );
> commit;
> end;
> /
>
>
> Seems to me that the time specs could be simplified a bit.
>
> Anyone care to give it a go? :)
>
> Jared

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jesse, Rich
  INET: Rich.Jesse_at_qtiworld.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jan 22 2003 - 13:44:21 CST

Original text of this message

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