Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Lazy dbms_job
It is rescheduled because procedure execution times are not known in
advance - it might take longer than 1 second; as soon as all 3 procs
finish ( again, execution time is not known ), job is rescheduled to
run at sysdate + 1/24/60/60.
dbms_job is used because we want the whole thing to run in background.=20
cpu time used is 0.6 sec on 180 sec sleep.=20
and yes, thanks, there are twice as many locks.=20
rm.
On 4/21/05, Terry Sutton <terrysutton_at_usa.net> wrote:
> First, I'm curious why you do the rescheduling within the job. Why don't
> you just set the interval to 1/(60*60*24)? You still aren't going to get=
it
> to run every second, but I know of job which run every 4-5 seconds this w=
ay.
> But the dbms_job facility is not designed to do super-precise scheduling.
>=20
> If you need these procedures to run every second, create a procedure with=
an
> infinite loop, using the dbms_lock.sleep procedure to stop for a second
> between executions of the 3 procedures. Start the procedure and let it r=
un
> constantly. You don't even need to use dbms_job, though that can be used=
to
> ensure the job starts again if should ever stop. You don't need to stop =
the
> procedure, and the sleep procedure shouldn't consume significant resource=
s.
> You will see you enqueue waits increase (sleep creates an enqueue), so if
> you're monitoring wait events, you'll want to note this.
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
-- http://www.freelists.org/webpage/oracle-lReceived on Thu Apr 21 2005 - 13:12:03 CDT
![]() |
![]() |