Re: awr history

  • From: "Daniel W. Fink" <daniel.fink@xxxxxxxxxxxxxx>
  • To: Brandon.Allen@xxxxxxxxxxx
  • Date: Thu, 13 Jan 2011 12:09:05 -0700

I will add one more caveat - remember that values reset after instance restarts. So if you are depending on calculating the deltas (the only option available in statspack), you need to test for an instance restart and adjust your logic appropriately. I have a script (http://www.optimaldba.com/scripts/CustomStatspack/optstat_statistic_matrix_weekly.sql) that has that logic in the factored subqueries at the beginning.


On 1/13/2011 12:00 PM, Allen, Brandon wrote:

These are nice scripts, but just one caution on a problem I just noticed with them -- if your snap_ids skip numbers in their sequence then the stats for those intervals will be omitted because the query relies on logic like this: "AND s1.snap_id = s0.snap_id + 1"

Another way of doing this without the limitation above is to use the LAG function -- here is an example:

select a.snap_id, a.snap_time, round((b.value-lag(b.value) over (order by a.snap_time)) / (86400*(a.snap_time-lag(a.snap_time) over (order by a.snap_id)))) as "Rds/sec" from stats$snapshot a, stats$sysstat b where a.snap_id = b.snap_id and b.name = 'physical reads' and a.snap_time > sysdate-1 order by 1;

Regards,

Brandon

*From:*oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] *On Behalf Of *Kellyn Pedersen

Karl must have missed this email, but I'll promote his scripts for him... I've had way too much fun with them not to! :)

The AWR gen script, (awr_genwl.sql) was a source of great fun, that only after a few, minor tweaks and a table creation, I was retaining high level AWR data by dbid in a repository. How nice it was to create many pretty, colorful graphs for non-technical managers when they were quick to say, "It was the databases fault!" :D

http://karlarao.wordpress.com/scripts-resources/



------------------------------------------------------------------------
Privileged/Confidential Information may be contained in this message or attachments hereto. Please advise immediately if you or your employer do not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of this company shall be understood as neither given nor endorsed by it.



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.872 / Virus Database: 271.1.1/3376 - Release Date: 01/12/11 
12:34:00

Other related posts: