Thursday, 17 September 2015

AWR Report Analysis

1. Database Details:

After getting an AWR Report This is first and Top part of the report. In this part cross check fordatabase and instance and and database version with the Database having performance issue.This report also show RAC=YES if it's an RAC database.

 https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnsVhPDqGc3amyAUtbIz_9LRlBEr_UtgNMSsDuOCwgEw0GMJs0esMI7r2eMxkgemuKVIn3jYIPW7I0psuqPGCAr0N-T_BbIk_6O41NKHhtS8KvasU3E5luixvc1hyphenhyphenCc60zGRAKLL_K9O_3/s1600/AWR+Report+Fist+Part.JPG

2. Host Configuration:

This will give you name, platform CUP, socket and RAM etc. Important thing to notice is number of cores into the system. In this example there are 12 CUP's in Cores.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMtR6QEyvwunvQqZodLawwxyVWc_M8CYnFbhAB-HAfO9YJZ3O5r8PslfoJmYDQWL3-LhdKGi8kw4bc8u3bafYxzAjykdVuIt9LcKDSyGkqoN_ytBj9uuCoZpSG8hyphenhyphenNmMLz-YRjtYKS6CA4/s1600/AWR+Report+Host+Configuration.JPG

If there is Increase in the sessions then it is problem. If its same then no prob. also the cursors/sec
Please do remember that if the increase the cursors it has got severe effect on resource utilization. Since cursors based on 1 user this is cursor leak
 
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEw_oN7HoC-KWIRnyjTeV_C8zyMqgvjEO9RF9KA_hWFGKbkFEjX200Z-Uol1morgDX0I4WuhoyBN14nIWKTPBlJVqvPV6H8hNbjhy1ENG-b9Fo_yGvdsw1Z4PbV4qPxDGFH3yhfxoNCTfb/s1600/AWR+Report+Snap+Detail.JPG
DB Time= session time spent in database. DB Time= CPU Time + Non IDLE wait time.
3. Load Profile

Here are few important stats for a DBA to look into. Fist is "DB CPU(s)" per second. Before that let's understand how DB CUP's work. Suppose you have 12 cores into the system. So, per wall clock second you have 12 seconds to work on CPU.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8yF61oLXKT9Z_TF3_VzL9E7aCcqClJp1TE55PKKb3jWVuD9dXN_3AaSJFumJ54t7Ca39ijzUuzy0gwjGxzIQucRD4Wz3NFEEZd6IQOEsFh1QIxPWzyNGgtpDBQQD7OeUvTM8SWjsNiBaU/s1600/AWR+Report+Load+Profile.JPG

 So, if "DB CPU(s)" per second in this report > cores in (Host Configuration (#2)).This  means that login of /login on frequently. Also Here DB Time is Number of Active Session

means env is CPU bound and either need more CPU's or need to further check is this happening all the time or just for a fraction of time. As per my experience there are very few cases, when system is CPU bound.

In this case, machine has 12 cores and DB CPU(s) per second is 6.8. So, this is not a CPU bound case.

Next stat to look at are Parses and Hard parses. If the ratio of hard parse to parse is high, this means Database is performing more hard parse. So, needs to look at parameters like cursor_sharing and application level for bind variables etc.

Transaction count will be very high this will help in looking the volume of the load

5. Instance Efficiency Percentages:


In these statistics, you have to look at "% Non-Parse CPU". If this value is near 100% means most of the CPU resources are used into operations other than parsing, which is good for database health.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsy97222D98yAriwOsERWETZE9tkRUYDNCTVpDzLTOv_6C0c0uDUQ_4rpGkXkY9kEMZ6qEhf5nfk-3rLddHffj3VLNLr6CWjz6sewz9jXK27DMqIFjEEb01JP89KAsL1FpX1AQp9gBupET/s1600/AWR+Report+Instance+Efficiency+Percentage.JPG

6. Top 5 Timed Foreground Events:

This is another most important stats to consider while looking at AWR Report for any database performance related issue. This has a list of top 5 foreground wait events.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1-CBD7J9ASJcVh56LCyh0A32uxdlnSikm6J1f2FGzVRWN6cA9ugeps8IIlkNGe25Hmwa8j_EZKCM2qtmmcW5FnvD0RVyYoP8NVZYZ6HR9UxJcx7r0XvLeHgbxRgS1tz6I2ZvpiDvZWCMu/s1600/AWR+Report+Top+5++timed+forgroud+events.JPG

Here, first of all check for wait class if wait class is  User I/O , System I/O,  Others etc this could be fine but if wait class has value "Concurrency" then there could be some serious problem. Next to look at is Time (s) which show how many times DB was waiting in this class and then Avg Wait (ms). If Time(s) are high but  Avg Wait (ms) is low then you can ignore this. If both are high or Avg Wait (ms) is high then this has to further investigate.

In the above screen shot, most of the resource are taken by DB CPU = 64% DB time. Taking resource by DB CUP is a normal situation.

Let's take an example,  In which event is "log file switch (checkpoint incomplete) " which has highwaits, huge Time (s) and large values in Avg Wait (ms) and wait class is configuration. So, here you have to investigate and 
resolve log file switch (checkpoint incomplete).

Host CPU, Instance CPU and Memory Statistics are self explanatory.  Next is RAC Statistics, I did not find any issue in these stats most of the time.

7. Time Model Statistics:

This is a detailed explanations of system resource consumptions. Stats are order by Time (s) and % of DB Time.
 https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiceeDjVwQh3ZxrEVLaurcCePskTFnpCRMeh604ZJZF9J2qgdmK8mXanxQsLCXLWQzI1t3cn01JlWUiv08FSacaSQUHIfpw4fxu8F19zonMYBFCI5qMbRj8pNthvHkKmXIGkId5JU-Wpon-/s1600/AWR+Report+Time+Model+Stats.JPG
A noticeable result Sum of all  % of DB time is > 100%. why is this ?

Because this is cumulative time i.e. In this case SQL execute elapsed time is taking 89% of DB time, which includes it sub parts like parse time elapsed, hard parse elapsed time etc. So, if you find Hard parse time elapsed is taking more %. So investigate further so on and so forth.

DBA has to look for stat which is taking abnormal % of DB time. 

8. Operating System Statistics - Detail:

This is the information related to OS, what is the load status on System shown here.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv291NQ_UIFWjyelp1TJ_ks_t4zM3vWuMisgDRcuOx_LK3g1nf5vKFCIWJtBdm6z2Y4WsSlwk04yGrqRjhwuqdnsaiHtDwhBCQrO3UcLnUx9pK4xF_U-wWB6hol7N-5Bvg0zALWC9nTPIy/s1600/AWR+Report+Operating+system+Statistics.JPG

This report shows, system is 62 and 70% idle at time of report taken, So, there is no resource crunch at system level. But if, you found very high busy, user or sys % and indeed this will led to low idle %. Investigate what is causing this.
 OS Watcher is the tool which can help in this direction.

Next, very crucial part of AWR report for a DBA is SQL Statistics. Which has all sql query details executed during report time interval.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOENVM0T7ElcSz2dZtglYGPVwEYzgWHDzSkWWw00-Geutu2XsG2ZKvAp8ibKYh8nDQf70dLTPSjlS61PKuemtfXJVTSvXk3YAoyZPOKNw_YiPfq1v6oEscdUPSmlklWz1myx3ll1sQGGsR/s1600/SQL+Statistics.JPG







9.SQL Ordered by Elapsed Time:

As explained by name itself, this lists SQL queries ordered by Elapsed time into reported time interval
if there IO value is more than cpu then its issue
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimpQsCAgxsE3Z-4lSVcu_IOR89iLdCO3GfhSm9Wb7IGkIavimUN3yA4RrJRgcxt7c0XxLKP52ScTEClGFkmzKnm2cV6g6gJgxkwjarFwaNMrlQvMJvzrao2nTMnaGt2CYLfn6-qJIVtmk_/s1600/varwwwclientsclient1web2tmpphpChWzua.jpg

In this report, look for query has low executions and high Elapsed time per Exec (s) and this query could be a candidate for troubleshooting or optimizations. In above report, you can see first query has maximum Elapsed time but no execution. So you have to investigate this.

In Important point, if executions is 0, it doesn't means query is not executing, this might be the case when query was still executing and you took AWR report. That's why query completion was not covered in Report.

10. SQL Ordered by CUP Time:

In this report, SQL queries are listed on the basis of CPU taken by the query i.e. queries causing high load on the system. The top few queries could be the candidate query for optimization.


https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJV4HAyUCqd5cJARFSPjgIdU91KU7lPrfle1J8AhtGFvU0J-6EA6TjYtUbos-XSXx6SpC879UgDOjC8DUBZQH9zP_oO5KHPs6oZ7eNGyc9gqvRKyYP9v4gYoM9pp4lmtN_g_BPC3vzcTIB/s1600/SQL+Orderd+by+CPU+TIME.png







From above stat, look for queries using highest CPU Times, If a query shows executions 0, this doesn't means query is not executing. It might be same case as in SQL queries ordered by Elapsed time. The query is still executing and you have taken the snapshot.

However, There are so many other stats in AWR Report which a DBA needs to consider, I have listed only ten of them but these are the most commonly used stats for any performance related information.

No comments:

Post a Comment