10 steps to analyze awr report in oracle

Upload: modesto-lopez-ramos

Post on 02-Mar-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/26/2019 10 Steps to Analyze AWR Report in Oracle

    1/7

    As you have Generated AWR Report in

    Oracle, Next task is to Analyze AWR

    Report in Oracle. By Reading AWR

    Report you can easily solve issues like

    Slow database, high wait events, Slow

    query and many more. Though It's a

    lengthy report but Analyzing or

    Reading relevant part of AWR Report

    can help to troubleshoot issues in easy

    and fast manner.

    AWR stands forAutomatically

    workload repository, Though there

    could be many types of database

    performance issues, but when whole

    database is slow, then there are two

    possibilities.

    1. Issue with Database Machine. OS Watcher is the best tool to start.

    2. If Database performance issue, Then AWR Report is the place to look

    at.

    In case if a particular query is not performing well, i would suggest to look at execution plan of the

    query, stats of underlying table etc. In this case AWR won't help much.

    Recommendations before getting an AWR Report.

    1. CollectMultiple AWR Reports:It's always good to have two AWR Reports, one forgood time (when database was performing well), second when performance is poor. This way

    Remote DBA can easily compare good and bad report to find out the culprit.

    2. Stick to Particular Time: "Database is performing slow" will not help anymore to resolveperformace issues. We have to have a specific time like Database was slow yesterday at 1 Pm and

    continue till 4Pm. Here, DBA will get a report for these three hours.

    3. Split Large AWR Report into Smaller Reports:Instead of having one report forlong time like one report for 4hrs. it's is better to have four reports each for one hour. This will help

    to isolate the problem.

    In case of RAC env. generate one report for each instance. Once, you have generated AWR report.

    Now, it's time of analyze the report. Since, AWR report is a huge report and area to look into AWR

    is also depends on problem to problem. Here, I am list most common area for a DBA to look into

    which will give a clear picture of the issue.

    Steps to Analyze AWR Report

    1. Database Details:

    After getting an AWR Report This is first and Top part of the report. In this part cross check for

    databaseand instanceand and database versionwith the Database having performance

    issue.This report also show RAC=YESif it's an RAC database.

    2. Host Configuration:

    This will give you name, platform CUP, socketand RAM etc. Important thing to notice is number

    of cores into the system. In this example there are 12 CUP's inCores.

    3. Snap Shot Detail:

    This are the detail about snap shot taken,Snap start timeandend time. Difference between them

    is as "Elapsed". Here is a new term "DB Time"

    DB Time= session time spent in database.

    DB Time= CPU Time + Non IDLE wait time.

    You can find, DB time is very large as comparedto Elapse time, which is not a concern. Check if

    you have taken a report for the time having performance problem. If yes fine, other wise take a

    report for performance problem time.

    Next is CacheSizes, which is just detail about SGA components.

    4. 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.

    As-Oracle.com: 10 Steps to Analyze AWR Report in Oracle http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-i...

    7 12/10/2015 0:43

  • 7/26/2019 10 Steps to Analyze AWR Report in Oracle

    2/7

    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.

    So, if "DB CPU(s)" per second in this report > coresin (Host Configuration (#2)).

    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 Parsesand 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 likecursor_sharing and application level forbindvariables etc.

    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.

    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.

    Here, first of all check forwait classif 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 AvgWait

    (ms). IfTime(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 (checkpointincomplete) " which has high

    waits, huge Time (s)and large valuesin Avg Wait (ms)and wait classis configuration. So, here

    you have to investigate and resolve log file switch (checkpoint incomplete).

    Host CPU, Instance CPU and Memory Statist ics 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.

    As-Oracle.com: 10 Steps to Analyze AWR Report in Oracle http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-i...

    7 12/10/2015 0:43

  • 7/26/2019 10 Steps to Analyze AWR Report in Oracle

    3/7

    Labels: Performance Tuning

    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.

    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 toolwhich 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.

    We will explore few of them, To understand, how to analyzed these reports. Let's start with

    9. SQL Ordered by Elapsed Time:

    As explained by name itself, this lists SQL queries ordered byElapsed timeinto reported time

    interval.

    In this report, look for query has low executions and highElapsed time per Exec (s)and this

    query could be a candidatefor 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 causinghigh load on the system. The top few queries could be the candidate query for optimization.

    From above

    stat, look for queries using highest CPU Times, If a query showsexecutions0, 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 commonlyused stats for any performance related

    information.

    Please share you view about this article, Does it helps you to understand, How to analyze AWR

    Report.

    You might also like:

    Oracle Advanced Compression Licensing

    Manual Upgrade Database from Oracle 10.2.0.4 to Oracle 11.2.0.2

    What is OS Watcher Utility and How to use it for Database Troubleshooting ?

    Linkwithin

    As-Oracle.com: 10 Steps to Analyze AWR Report in Oracle http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-i...

    7 12/10/2015 0:43

  • 7/26/2019 10 Steps to Analyze AWR Report in Oracle

    4/7

    Labels: Performance Tuning

    Profi le Performance Review Website Developers

    Digital picture frame reviews Free web design tutorials

    Replies

    Reply

    Replies

    Reply

    Replies

    Reply

    45 comments:

    Anonymous July 2, 2013 at 10:35 AM

    Nice article, me also working in oracle side as a TechArch.

    Keep n touch

    Thanks

    Vijay

    Bangalore

    [email protected]

    Reply

    umesh sharma July 2, 2013 at 9:29 PM

    Vijay, Thanks for your comments.

    Amit Pal December 30, 2013 at 2:28 AM

    there are 10 stats discussed and all are very clear to me now..hope u will show some

    other stats as well..thanks a lot.

    Regards

    Amit Pal

    Anonymous June 8, 2015 at 1:15 AM

    Hi Umesh,

    Keep up the good work !!!

    Tx

    Anonymous August 20, 2015 at 6:29 AM

    Hi,

    It was really a nice starts for performance tuning. Please share some more explanation

    on the same to dig more to AWR Report.

    Rishiraj Chockraborty September 2, 2013 at 11:37 PM

    Very Good article....thanks for sharing this....

    Reply

    umesh sharma September 4, 2013 at 7:33 AM

    Thanks for your complement.

    Unknown September 12, 2013 at 3:42 AM

    Very nice article.....thanks for sharing...also share some books & tips which have detail information

    and analysis of AWR,ASH & ADDM Report.

    Thanks & Regards

    Vaibhav Jain

    Jr. Oracle [email protected]

    Reply

    umesh sharma September 12, 2013 at 4:30 AM

    Vaibhav, Thanks for your appreciation.

    Reply

    feroz shaik October 28, 2013 at 7:56 AM

    great doc!! Really appreciate it.

    Reply

    feroz shaik October 28, 2013 at 7:57 AM

    Great Doc!! Really appreciate it. Many Thanks.

    Reply

    umesh sharma October 28, 2013 at 9:23 AM

    Thanks Feroz

    Padma December 3, 2013 at 3:29 AM

    Thanks for Sharing the document, i ts good analysis of AWR Report.

    As-Oracle.com: 10 Steps to Analyze AWR Report in Oracle http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-i...

    7 12/10/2015 0:43

  • 7/26/2019 10 Steps to Analyze AWR Report in Oracle

    5/7

    Replies

    Reply

    Replies

    Reply

    Replies

    Reply

    Replies

    Reply

    Replies

    Reply

    Padma December 3, 2013 at 3:29 AM

    Thanks for Sharing the document, i ts good analysis of AWR Report.

    Thanks & Regards,

    Padma

    Jr. Oracle DBA

    [email protected]

    Reply

    Padma December 3, 2013 at 3:31 AM

    Thanks for Document its good analysis for AWR report :)

    Reply

    umesh sharma December 4, 2013 at 1:08 AM

    Thanks friends.

    Reply

    naru lc December 10, 2013 at 2:04 AM

    Nice explanation.. Thank you..

    Reply

    naru lc December 10, 2013 at 2:06 AM

    Nice explanation.. Thanks a lot.

    May I also request you to post similar blog to analyze DB when it is under peak load using ASH?

    Thanks in advance..

    Reply

    umesh sharma December 10, 2013 at 2:09 AM

    Thanks friend.

    Anonymous January 3, 2014 at 3:59 AM

    Really this article helped me alot.Thanks Umesh

    Reply

    umesh sharma January 3, 2014 at 4:07 AM

    Thanks friend.

    Sharv Gupta January 17, 2014 at 11:20 PM

    Thanks a lot Umesh for this useful article.

    Reply

    umesh sharma January 19, 2014 at 8:58 AM

    Thanks dear.

    Gaurav Sharma February 19, 2014 at 10:17 AM

    It is very informative .

    Thanks

    Reply

    Gaurav Sharma February 19, 2014 at 10:19 AM

    It's a very informative and helpful article.

    Reply

    umesh sharma February 20, 2014 at 12:53 AM

    Thanks Gaurav.

    Anonymous March 11, 2014 at 3:22 PM

    Nicely explain all of them...Really appreciated.

    Reply

    umesh sharma March 11, 2014 at 11:01 PM

    Thanks Dear.

    As-Oracle.com: 10 Steps to Analyze AWR Report in Oracle http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-i...

    7 12/10/2015 0:43

  • 7/26/2019 10 Steps to Analyze AWR Report in Oracle

    6/7

    Reply

    Replies

    Reply

    Replies

    Reply

    umesh sharma March 11, 2014 at 11:01 PM

    Thanks Dear.

    Anonymous April 15, 2014 at 4:40 AM

    Dear Umesh ,

    I really appreciate your effort for e xplanation of AWR.

    Many thanks for sharing this article.

    RegardsGoulay

    Oracle DBA

    Reply

    umesh sharma April 15, 2014 at 5:07 AM

    Welcome friend.

    Ravi Suvvari July 6, 2014 at 12:27 AM

    Very informative

    small typo

    10. SQL Ordered by CUP Time needs to be read as 10. SQL Ordered by CPU Time

    Reply

    Ravi Suvvari July 6, 2014 at 12:38 AM

    SQL execute elapsed time is taking 89% of DB should be SQL execute elapsed time is taking 98%

    of DB (looks like typo)

    Reply

    satya svits29 August 30, 2014 at 12:55 PM

    awesome article keep them coming

    Reply

    Anonymous August 31, 2014 at 5:48 AM

    thanks

    Reply

    Venkat September 12, 2014 at 5:49 AM

    Superb article.. helped me in understanding the awr report checks.. Great job..

    Thanks

    Reply

    Anonymous November 25, 2014 at 8:02 AM

    very helpful....thanks for sharing!

    Reply

    Anonymous December 4, 2014 at 12:23 PM

    you need to fix this

    SQL Ordered by CUP Time

    SQL Ordered by CPU Time

    Reply

    Anonymous December 23, 2014 at 2:08 AM

    This report has been taken when user sessions are active for long time. Please tell me what is

    sbtwrite2.

    Top 5 Timed Events Avg %Total

    ~~~~~~~~~~~~~~~~~~ wait Call

    Event Waits Time (s) (ms) Time Wait Class

    ------------------------------ ------------ ----------- ------ ------ ----------

    Backup: sbtwrite2 40,575 801 20 207.2 Administra

    RMAN backup & recovery I/O 69,380 588 8 152.2 System I/O

    CPU time 318 82.3

    Backup: sbtclose2 22 113 5131 29.2 Administra

    control file parallel write 51,693 97 2 25.0 System I/O

    Reply

    Anonymous January 26, 2015 at 3:08 AM

    In the #6 you mention about "Concurrency" as serious problem - could you give any example? What

    does it mean concurency?

    Reply

    Mohamed February 12, 2015 at 5:36 AM

    As in real life, concurrency means to client wants to access to the same object

    simultaneously. Lock is the solution but could be an issue, when it is not released or take

    a lof of time to release the object....

    As-Oracle.com: 10 Steps to Analyze AWR Report in Oracle http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-i...

    7 12/10/2015 0:43

  • 7/26/2019 10 Steps to Analyze AWR Report in Oracle

    7/7

    Reply

    simultaneously. Lock is the solution but could be an issue, when it is not released or take

    a lof of time to release the object....

    vikas jain April 21, 2015 at 2:57 AM

    Very Nice article - appreciated

    Can you please explain:

    #6 you mention about "Concurrency" as serious problem - could you give any example? What does

    it mean concurrency?

    -Vikas

    Reply

    Vincent April 21, 2015 at 11:19 AM

    Thank you.

    In the first part, I don't understand why you use "cores" and not "cpus". And I don't know what

    appends if the cpu_counts parameters is setted less?

    Reply

    Lakshminarayana Hs September 7, 2015 at 6:37 AM

    It is the nice document...It is better if you give recomendation on below issue.

    1."% Non-Parse CPU% is just 50%

    2.recomended value for cursor_sharing

    thanks

    Lakshminarayan

    Reply

    Lakshminarayana Hs September 7, 2015 at 6:37 AM

    It is the nice document...It is better if you give recomendation on below issue.

    1."% Non-Parse CPU% is just 50%

    2.recomended value for cursor_sharing

    thanks

    Lakshminarayan

    Reply

    Anonymous September 14, 2015 at 12:08 PM

    Many Thanks for sharing this, very much informative and useful

    Reply

    Chandra Reddy October 4, 2015 at 6:28 AM

    Superb article for Beginners.

    Reply

    As-Oracle.com: 10 Steps to Analyze AWR Report in Oracle http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-i...