Monthly Archives: March 2009

v$osstat anomaly

The v$osstat view shows certain OS-level metics such as number of CPUs, current system load, accumulated IO time, etc. Starting in 10gR2, it also records PHYSICAL_MEMORY_BYTES, which is the total size of physical memory on the server. See the documentation. … Continue reading

Posted in Databases | Leave a comment

cursor: pin S wait on X

I had a little excitement with the cursor: pin S wait on X wait event when a client’s website came grinding to a halt. The first thing I checked was blocking sessions… col username form a12 col event form a25 … Continue reading

Posted in Databases | Leave a comment

Testing disk I/O with the O_DIRECT flag

Sometimes I find the need to test disk IO rates, especially in the context of one of those delightful intra-office debates where the DBAs are blaming the lousy hardware for bad database performance and the sysadmins are blaming the lousy … Continue reading

Posted in Databases | Leave a comment

Calculating the delta between two row values

In Oracle, the standard way to calculate the difference (delta) between two values is using the LAG() analytic function. For example… Suppose you’ve got a table of numeric values– create table t as select rownum id, value from v$sesstat where … Continue reading

Posted in Databases | Leave a comment