Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re:RE: dbms_job - running jobs every 15 minutes
One potential problem with DBMS_JOBS as is being discussed here is that Oracle
computes the next_date at the end of the job. They do that so that if a job
runs longer than it's schedule interval the two invocations will not run into
each other. Now as discussed, if the job is scheduled to start at 9:00 AM and
runbs for 5 minutes it's next_date for run #2 will be 9:20, not 9:15, and it
will creep 5 minutes every time.
Dick Goulet
____________________Reply Separator____________________ Author: Freeman Robert - IL <FREEMANR_at_tusc.com> Date: 1/22/2003 7:09 AM
Cron? How 1980's.... :-))
RF
Robert G. Freeman
Technical Management Consultant
TUSC - The Oracle Experts www.tusc.com
904.708.5076 Cell (it's everywhere that I am!)
Author of several books you can find on Amazon.com!
-----Original Message-----
Sent: Wednesday, January 22, 2003 7:19 AM
To: Multiple recipients of list ORACLE-L
I simplified it by using cron instead ... <g>
Raj
QOTD: Any clod can have facts, but having an opinion is an art!
-----Original Message-----
<mailto:Jared.Still_at_radisys.com> ]
Sent: Tuesday, January 21, 2003 7:24 PM
To: Multiple recipients of list ORACLE-L
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;
Seems to me that the time specs could be simplified a bit.
Anyone care to give it a go? :)
Jared
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>RE: dbms_job - running jobs every 15 minutes</TITLE>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=569311115-22012003><FONT face=Arial color=#0000ff size=2>Cron?
How 1980's.... :-))</FONT></SPAN></DIV>
<DIV><SPAN class=569311115-22012003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=569311115-22012003><FONT face=Arial color=#0000ff
size=2>RF</FONT></SPAN></DIV>
<DIV> </DIV>
<P><FONT face=Verdana size=2>Robert G. Freeman</FONT><FONT
face="Times New Roman"><BR></FONT><FONT face=Verdana size=2>Technical Management
Consultant<BR>TUSC - The Oracle Experts www.tusc.com<BR>904.708.5076 Cell (it's
everywhere that I am!)<BR>Author of several books you can find on
Amazon.com!</FONT> </P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Jamadagni, Rajendra
[mailto:Rajendra.Jamadagni_at_espn.com]<BR><B>Sent:</B> Wednesday, January 22,
2003 7:19 AM<BR><B>To:</B> Multiple recipients of list
ORACLE-L<BR><B>Subject:</B> RE: dbms_job - running jobs every 15
minutes<BR><BR></FONT></DIV>
<P><FONT size=2>I simplified it by using cron instead ... <g></FONT>
</P>
<P><FONT size=2>Raj</FONT> <BR><FONT
size=2>______________________________________________________</FONT> <BR><FONT
size=2>Rajendra Jamadagni
MIS, ESPN Inc.</FONT> <BR><FONT
size=2>Rajendra dot Jamadagni at ESPN dot com</FONT> <BR><FONT size=2>Any
opinion expressed here is personal and doesn't reflect that of ESPN Inc.
</FONT><BR><FONT size=2>QOTD: Any clod can have facts, but having an opinion
is an art!</FONT> </P><BR>
<P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From:
Jared.Still_at_radisys.com [<A
href="mailto:Jared.Still_at_radisys.com">mailto:Jared.Still_at_radisys.com</A>]</FON
T>
<BR><FONT size=2>Sent: Tuesday, January 21, 2003 7:24 PM</FONT> <BR><FONT
size=2>To: Multiple recipients of list ORACLE-L</FONT> <BR><FONT
size=2>Subject: dbms_job - running jobs every 15 minutes</FONT> </P><BR>
<P><FONT size=2>Feeling particularly anal the other day, I used the
following </FONT><BR><FONT size=2>specification to</FONT> <BR><FONT size=2>run
statspack at the top of the hour, 15, 30 and 45 minutes after the </FONT><BR><FONT size=2>hour.</FONT> </P> <P><FONT size=2>variable jobno number;</FONT> <BR><FONT size=2>variable instno
number;</FONT> <BR><FONT size=2>begin</FONT> <BR><FONT
size=2> select instance_number into
:instno from v$instance;</FONT> <BR><FONT
size=2> dbms_job.submit(</FONT>
<BR><FONT
size=2>  
;
:jobno</FONT> <BR><FONT
size=2>  
;
, 'statspack.snap;'</FONT> <BR><FONT
size=2>  
;
<BR><FONT size=2> );</FONT> <BR><FONT size=2> commit;</FONT> <BR><FONT size=2>end;</FONT> <BR><FONT size=2>/</FONT> </P> <P><FONT size=2>Seems to me that the time specs could be simplified abit.</FONT> <BR><FONT size=2>Anyone care to give it a go? :)</FONT> <BR><FONT size=2>Jared</FONT> </P></BLOCKQUOTE></BODY></HTML>
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: dgoulet_at_vicr.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 - 10:34:52 CST
![]() |
![]() |