Re: Time Series Format of Operating System Statistics

  • From: Niall Litchfield <niall.litchfield@xxxxxxxxx>
  • To: karlarao@xxxxxxxxx
  • Date: Sat, 30 Jan 2010 13:18:21 +0000

select
   to_char(s.end_interval_time,'DD-MON-YYYY HH24:MI') SNAP_TIME,
   os.stat_name,
   os.value,
   lag(os.value,1) over (PARTITION BY os.STAT_NAME order by os.snap_id)
prev,
   case
   when os.stat_name = 'LOAD'                 then os.value
   when os.stat_name = 'PHYSICAL_MEMORY_BYTES' then os.value
   else os.value - lag(os.value,1) over (PARTITION BY os.STAT_NAME order by
os.snap_id)
   end value
from
  dba_hist_snapshot s,
  dba_hist_osstat os
where
s.snap_id = os.snap_id
order by os.snap_id,os.stat_name
;

seems to give what you want to me. I'd probably not query the "fixed" values
myself.

cheers

Niall



On Sat, Jan 30, 2010 at 7:01 AM, Karl Arao <karlarao@xxxxxxxxx> wrote:

> If you have another way of writing the query... just reply here together
> with the output ...
>
>
> - Karl Arao
> karlarao.wordpress.com
>
>


-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info

Other related posts: