Locate Server Workload from Statspack for days in Past
Change a.statistic# to respective value
Stats for Working Hours
select to_char(trunc(b.snap_time),'DD-MM-YYYY') ,statistic#,name, sum(value) from STATS$SYSSTAT A, stats$snapshot B where a.snap_id=b.snap_id and trunc(b.snap_time) > trunc(sysdate -30) and to_char(b.SNAP_TIME,'HH24') > 8 and to_char(b.SNAP_TIME,'HH24') <18 and a.statistic#=54 group by trunc(b.snap_time) ,statistic#,name order by trunc(b.snap_time)
Locate kind of stats you want to pull from statspack
(select * from STATS$SYSSTAT where name like '%XXX%' ) 9 session logical reads Physical Reads 54 Physical Reads 56 Physical reads direct 58 physical read bytes 39 physical read total bytes 42 physical write total bytes 66 physical write bytes 66 physical writes CPU Related 355 OS Wait-cpu (latency) time 328 parse time cpu 8 recursive cpu usage Rollback Related - 176 transaction tables consistent read rollbacks 180 rollbacks only - consistent read gets 181 cleanouts and rollbacks - consistent read gets 187 transaction rollbacks 5 user rollbacks 239 IMU CR rollbacks 186 rollback changes - undo records applied
Sample Report built using SQL in post Stats_Report
Stats for Entire Day
select to_char(trunc(b.snap_time),'DD-MM-YYYY') ,statistic#,name, sum(value) from STATS$SYSSTAT A, stats$snapshot B where a.snap_id=b.snap_id and trunc(b.snap_time) > trunc(sysdate -30) and a.statistic#=54 group by trunc(b.snap_time) ,statistic#,name order by trunc(b.snap_time)
Leave a Reply
You must be logged in to post a comment.