DBMS_LOCK.SLEEP is now deprecated, the new SLEEP is DBMS_SESSION.SLEEP

We need sleep function many a times in our code, may be for application logic or even sometimes for monitoring purpose. We always had this available with sleep() function that resides within DBMS_LOCK ==> DBMS_LOCK.SLEEP

This was always a big security risk as granting access to DBMS_LOCK will make a way to get access to other functions/procedures within which is not always necessary.

So from 18C, Oracle comes with SLEEP function within a publicly granted package ==> DBMS_SESSION.SLEEP.


From 18C DBMS_LOCK.SLEEP is deprecated, but it is still present for backwards compatibility.

I would suggest, whoever is planning to upgrade their databases to 19C in near future, should upgrade their PL/SQL codes to use DBMS_SESSION.SLEEP instead of DBMS_LOCK.SLEEP. Also one should make sure to revoke any grants to the DBMS_LOCK package where they were intended to give access to only SLEEP procedure.



Hope u will find this post very useful. 🙂





Categories: Uncategorized

10 replies

  1. Like!! I blog quite often and I genuinely thank you for your information. The article has truly peaked my interest.

  2. Hello! Someone inside my Myspace group shared this site around so I
    came to look it over. I’m definitely enjoying the details.
    I’m book-marking and are tweeting this to my
    followers! Outstanding blog and outstanding design.

  3. I love looking through an article that will make people think. Also, many thanks for allowing for me to comment!

  4. Wonderful site. Lots of helpful information here.

    I am sending it to several buddies ans additionally sharing in delicious.
    And of course, thank you for your sweat!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s