Re: preferred method to sleep()?

From: Laurenz Albe <invite_at_spam.to.invalid>
Date: 13 Nov 2008 15:10:14 GMT
Message-ID: <1226589012.128956@proxy.dienste.wien.at>


Mark D Powell <Mark.Powell_at_eds.com> wrote:

>> > I see four methods to sleep:
>>
>> >    * dbms_backup_restore
>> >    * dbms_drs
>> >    * dbms_lock
>> >    * user_lock
>>
>> > Are any of them preferrable, deprecated, recommended, etc?
>>
>> Just from looking at the Oracle 11.1 documentation, I would recommend
>> DBMS_LOCK.SLEEP, since DBMS_LOCK is the only package in your list
>> that is described inhttp://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/toc.htm
>>
>> The other ones are probably internal and not intended for public use,
>> with the drawback that they may change without notice in new releases.

>
> Yes, but dbms_lock.sleep has had a known error in its timing since it
> was introduced and also apparently for versions 8iR2 (8.1.6) through
> 11gR1(11.1.0.6) has a bug which can cause a serious error in the time
> slept for long sleep times.
>
> If you have support the following note may be of interest
>
> Instead of DBMS_LOCK.SLEEP Procedure Use SYS.DBMS_BACKUP_RESTORE.SLEEP
> For Time Interval > 3600
> document #471246.1
>
> For short sleeps where the timing does not have to be exact
> dbms_lock.sleep works OK.

Thanks for the clarification, I did not look on Metalink.

Yours,
Laurenz Albe Received on Thu Nov 13 2008 - 09:10:14 CST

Original text of this message