From:Steve Adams
Date:15-Sep-2000 10:16
Subject:   CPU used by this session and involuntary context switches

With timed_statistics = TRUE, Oracle uses calls to gettimeofday() to measure the duration of waits on BSD based systems, or the return value of the times() system call on System V based systems. However, as you point out, that would not be a good way to measure CPU usage. Fortunately, Oracle is also able to use the times() system call instead to interrogate the operating system CPU usage statistics directly. Similarly, if timed_os_statistics is set to a non-zero number of seconds, then Oracle will use an operating system specific call such as pstat() to gather a range of other operating system statistics at the interval specified by the parameter. So Oracle does not need to be aware of involuntary context switches and similar operating system events. It just gets the statistics it needs directly from the operating system.

I've 2 questions. Basically, operating system process states are waiting in waiting queue - ready in ready queue - running on CPU. My questions are:

If a process running on a CPU is switched from running to the ready queue by being interrupted or pre-empted etc., is CPU used by this session still incremented although it is not running. If it is not incremented, how does Oracle understand OS process state changes. Is there a manipulation OS system calls such as terminate and stay resident programs?

Oracle can understand some OS wait events in waiting queue of OS such as IO read/write and equivalent is db file sequential read etc. Which OS wait events does Oracle understand such as swap, timer interrupt etc.?