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

Thread: Datetime logging to millisecond level

  1. #1
    Join Date
    Jan 2001
    Posts
    3
    Ok, Oracle DateTime records time down to the second.

    However, in our application we need to query the system time which goes down to millisecond. Then record the date and time down to the millisecond level in some logs.

    Any suggestions on how to do that?

  2. #2
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    I think you have to wait till next release. Oracle 8i doesn't support and I heard that 9i supports.

    [url]http://www.dbasupport.com/forums/showthread.php?threadid=5538[/url]


  3. #3
    Join Date
    Jun 2000
    Location
    Conway,AR,USA
    Posts
    29
    You can try this approach.
    Use the package dbms_utility.get_time

    function get_time return number;
    -- Find out the current time in 100th's of a second.
    -- Output arguments:
    -- get_time
    -- The time is the number of 100th's of a second from some
    -- arbitrary epoch.
    Soumya
    still learning

  4. #4
    Join Date
    Jan 2001
    Posts
    28
    bkanti,
    I am confused, dbms_utility.get_time returns a number, but what does this number signify ? I am sorry, but I couldn't get your explanation exactly, so could you be more specific if you don't mind.
    - Mayur.

  5. #5
    Join Date
    Jun 2000
    Location
    Conway,AR,USA
    Posts
    29
    Let me give you an example
    DECLARE
    start_time NUMBER;
    end_time NUMBER;
    time_elapsed NUMBER;
    ...
    BEGIN
    start_time := dbms_utility.get_time;
    ......
    some transaction ....
    .....
    end_time := dbms_utility.get_time;
    ......
    --THen time taken for the transaction is
    time_elapsed := (end_time - start_time);
    /*This time is measured in 1/100ths of a second . You can use it in combination with SYSDATE , which measures upto 1 sec to get time upto 1/100ths of a second and store the result in a VARCHAR2 field */
    END;
    Soumya
    still learning

  6. #6
    Join Date
    Dec 2000
    Posts
    28
    Hi tmnath,

    The number is an arbitrary number in time. You can get the number before execution and get the same arbitrary number after the execution. Find the difference between these and divide it by 100. So your execution time is that many seconds.

    - ad

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