The Oracle (tm) Users' Co-Operative FAQ

What is the time unit used in the v$ views ?


Author's name: Jonathan Lewis

Author's Email: Jonathan@jlcomp.demon.co.uk

Date written: 15th Dec 2002

Oracle version(s): 7 - 9

What is the time unit used in the v$ views ?

Back to index of questions


In general the answer is hundredths of a second.

However, there are a few exceptions (and possibly a few platform-specific oddities).

In Oracle 9, the view v$enqueue_stat has been introduced to expose the number of enqueues (locks) that have been requested. The view includes the number of requests, waits, successful acquisitions, and failures. It also includes the time spent waiting - measured in milliseconds. (Humour point - according to some coder in Oracle Corp, there are 1024 milliseconds in a second; check the length of a one-second wait in the dbms_lock.sleep procedure, if you don't believe me).

In late versions of Oracle 8.1, Oracle started recording time in v$session_wait, v$session_event, and v$system_event (or at least the underlying X$ objects) in micro seconds. However, the micro second time is not always exposed - some views have a column time_waited_micro, some only have the time_waited where the value is rounded to the hundredth.

This does lead to some oddities in trace files, where you may find the elapsed time of an action recorded to the micro second, but the corresponding CPU time rounded to the hundredth, with the effect that the CPU time will sometimes be much larger than the elapsed time.


Further reading: FAQ: Is there a way to suspend a task, or make it sleep, for a period of time ?


Back to top

Back to index of questions