DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: similar as dbms_lock.sleep

  1. #1
    Join Date
    May 2005
    Posts
    2

    similar as dbms_lock.sleep

    can you tell me what is a function similar as dbms_lock.sleep exict from Oracle 9i.
    because i want take more exactly time in fraction of second.
    and dbms_lock.sleep(second in NUMBER), but i know that similar function exists from Oracle 9i but there time in INTERVAL.
    please help me, what is the name of that function?

  2. #2
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,684
    Hi.

    The DBMS_LOCK.sleep() function accepts fractions of a second also, like:

    SQL> SET TIMING ON
    SQL> EXEC DBMS_LOCK.sleep(0.01);

    PL/SQL procedure successfully completed.

    Elapsed: 00:00:00.03
    SQL>

    Remember, there is some time overhead associated with calling the procedure etc.

    Cheers

    Tim...
    Tim...
    OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
    OCA PL/SQL Developer
    Oracle ACE Director
    My website: oracle-base.com
    My blog: oracle-base.com/blog

  3. #3
    Join Date
    May 2005
    Posts
    2
    it's good, but not enoughf.

    i want more exactly, smallest units of seconds.

    somebody sayed me that from Oracle 9i similar function exists, but i don't know it's name.

    and in dbms_lock.sleep(seconds in NUMBER);

    and in those (unnamed function) seconds should be in INTERVAL.

    what is the name such function?

  4. #4
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,684
    Hi.

    I've never heard of such a fuunction, that's not to say it doesn't exist.

    The other thing to remember is that it is rare to any sleep operation to be totally accurate because of the delays associated with calling a procedure, setting a timer of some description, noticing the time is right to wake up and then actually waking up the process.

    As such I doubt you will every get an accurate short duration pause in a language such as PL/SQL.

    It's only my opinion, but I'm happy to be proved wrong.

    Cheers

    Tim...
    Tim...
    OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
    OCA PL/SQL Developer
    Oracle ACE Director
    My website: oracle-base.com
    My blog: oracle-base.com/blog

  5. #5
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,684
    Hi.

    I've just had a scan through the documentation and metalink and I can't see any functions or procedures that do what you are saying.

    The TIMESTAMP datatype is present in 9i which allows you to deal with times to 9 decimal places of a second, but this has nothing to do with any form of sleep, pause or wait function.

    If you ever find such a thing please post it. I don't need it, but it's nice to know ;-)

    Cheers

    Tim...
    Tim...
    OCP DBA 7.3, 8, 8i, 9i, 10g, 11g
    OCA PL/SQL Developer
    Oracle ACE Director
    My website: oracle-base.com
    My blog: oracle-base.com/blog

  6. #6
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by Shine
    i want more exactly, smallest units of seconds.
    I too would be surprised if you would get results repeatable to better than a few hundreth's or even tenth's of a second.

    My reaction is that if you need timing to "high" precision, you're using the wrong technology - DBMS aren't really designed for that.
    "The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman

  7. #7
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Try sys.dbms_system.ksdddt function.

    This function will return 1000th of a second along with date.

    Tamil

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width