Do AWR Reports Show the Whole Picture?
AWR report is a great source of aggregated information on top activities happening in our databases. I use data collected in AWR quite often, and obviously the easiest way of getting the data out from the AWR is by running the AWR report. In most cases that's not an issue, but there are certain scenarios when it hides the information one is looking for, just because of how it's designed. If I'm trying to collect information about top queries by physical reads, I would normally look at the "SQL ordered by Reads" section and this is what I'd see: I have the top SQLs by physical reads - just what I've been looking for (except the fact that AWR report covers only one of my RAC nodes). But wait a second, what if there are queries that don't use bind variables? This might be a problem as each query would have it's own SQL_ID and probably they wouldn't make it into the TOP10 just because each of them is treated separately. Nothing to worry about - AWR also collects FORCE_MATCHING_SIGNATURE values (read this blog post to understand why I know they would help) and we can use them to identify and group "similar" statements, we just need a custom script to do that. Here I use my custom script to report TOP 20 SQL_IDs by physical reads in last 7 days (and I'm reporting data from both RAC nodes in the same list) - you can see the few TOP SQLs are the same as reported in AWR report, but because I'm reporting database-wide statistics instead of instance-wide as AWR does, I have other SQLs on the list too. I've also included 2 additional columns:
- DIFF_PLANS - number of different PLAN_HASH_VALUE values reported for this SQL_ID, and if only one is found - it shows the actual PLAN_HASH_VALUE
- DIFF_FMS - number of different FORCE_MATCHING_SIGNATURE values reported for this SQL_ID, and if only one is found - it shows the actual FORCE_MATCHING_SIGNATURE
Share this
You May Also Like
These Related Stories
News and upates from Microsoft Azure, pt II
News and upates from Microsoft Azure, pt II
Sep 26, 2018
8
min read
Online Data Migration from SQL Server to Cloud Spanner Using Striim
Online Data Migration from SQL Server to Cloud Spanner Using Striim
Jun 9, 2022
17
min read
Apache Beam pipelines with Scala: part 3 - dynamic processing
Apache Beam pipelines with Scala: part 3 - dynamic processing
Dec 12, 2017
5
min read
No Comments Yet
Let us know what you think