Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Collaborate 2019 - How to Understand an AWR Report


Published on

AWR report session at Collaborate 2019

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Collaborate 2019 - How to Understand an AWR Report

  1. 1. Session ID: Prepared by: Remember to complete your evaluation for this session within the app! 171 Listen to your database. How to understand an Oracle AWR report. 4/8/2019 Alfredo Krieg Senior Cloud Performance Architect Viscosity North America @alfredokrieg
  2. 2. Leverage what Makes Viscosity Different Our Mission: •We Enable Business Transformation at a Time when Companies must Change to Survive
  3. 3. Viscosity is a team of experts specializing in Oracle Cloud and Engineered Systems. We are lot more than just Oracle SharePlex Platinum Partner MongoDB Consulting Partner Neo4J Consulting Partner Kyriba - Treasury Management
  4. 4. We’ve written 22 books on Data, Cloud, and Oracle… Industry Experts o Viscosity founders hold 27+ years each in the Oracle space o Authors of 22 books in the Oracle space o 5 ACE Directors, only 36 in the United States. 1 Oracle ACE. o Direct connections to Oracle support and Product Managers support o Expertise in Engineered Systems, ZFS, ODA, Oracle 11g, 12c, 18c, RAC/ASM, Data Guard, Performance Tuning & Oracle Licensing o Hire only best of the best
  5. 5. 6 Viscosity Pillars And Delivery Models Database InfrastructureAppsData Data Integration IAAS / PAAS Data Warehousing Analytics GoldenGate SAAS / PAAS CX ERP SCM HCM PAAS Web Applications Mobility EBS / JDE / PS IAAS Public Cloud Bare Metal Cloud AWS Azure Bluemix Engineered Systems Exa- ZFS @Customer X86 / Sparc Workshops Assessments Proof of Concepts Training Turnkey Projects Managed Services
  6. 6. Performance Health Checks How’s it running? Apps SaaS/PaaS, Mobility, Application Development DBA Services Remote and On-site On-Call Support Managed Services ZERO DOWNTIME Migrations Professional Services Where you need it most Staff Aug Workforce Capacity on Demand Oracle License Management Get the most out of your Oracle investment 7
  7. 7. 8
  8. 8. 9
  9. 9. 1
  10. 10. 1
  11. 11. Alfredo Krieg • Oracle ACE • Senior Cloud Performance Architect at Viscosity North America • Database Performance Tuning, Exadata, OEM and EBS • Oracle Technologies since 2004 • Blog • @alfredokrieg
  12. 12. Disclaimer • The opinions expressed in this presentation are solely mine, and not that of my employer. • This is the method I use and could be other more efficient methods.
  13. 13. Agenda • What is time? • Why we use time? • Time consumed VS time waited • Is the DB system CPU-bound or I/O-bound? • Where we should focus? • What is a bottleneck? • Identify TOP SQL
  14. 14. What it covers? • Is my personal method • It won’t cover how to tune SQL or DB parameters • It won’t cover system statistics • It covers how to quickly find a bottleneck • How to find the TOP SQL responsible of the bottleneck
  15. 15. What is time? • By looking at – The indefinite continued progress of existence and events in the past, present, and future regarded as a whole. – The continued progress of existence as affecting people and things. – The length of time taken to run a race or complete an event or journey. – British The moment at which the opening hours of a pub end. – Baseball American Football A moment at which play stops temporarily within a game. Photo by Jon Tyson on Unsplash
  16. 16. What is time? • Alfredo’s definition: “Is a measure in which an Oracle database process performs the requested work” Photo by Lukas Blazek on Unsplash
  17. 17. Why we use time? • Most human beings care about time • We have machines that measure time • Easy way to compare performance • Oracle’s instrumentation is time based
  18. 18. Elapsed Time vs DB TIME • Elapsed time is the amount of time (start-end) of the report
  19. 19. What is DB TIME? • 'DB Time' is the amount of elapsed time (in microseconds) spent performing Database user-level calls not including the elapsed time spent on instance background processes such as PMON. SELECT Round(NVL((e.value - s.value),-1)/60/1000000,2)||' minutes' "DB Time" FROM DBA_HIST_SYS_TIME_MODEL s, DBA_HIST_SYS_TIME_MODEL e WHERE s.snap_id = &AWRStartSnapID AND e.snap_id = &AWREndSnapID AND e.dbid = s.dbid AND e.instance_number = s.instance_number AND s.stat_name = 'DB time' AND e.stat_id = s.stat_id; How Does Oracle Calculate the "DB time" & "Elapsed" Time Presented in AWR Report (Doc ID 1934757.1)
  20. 20. Time consumed VS time waited • User’s sessions and background processes spend time in the database • They have 2 status ACTIVE and INACTIVE • If ACTIVE they can be consuming time on CPU or WAITING Sessions ACTIVE INACTIVE CPU WAITING DB_TIME
  21. 21. Time consumed VS time waited • V$SESSION – STATUS • ACTIVE - Executing SQL • INACTIVE – KILLED – SNIPED – Inactive waiting on client • CACHED – Oracle X/Open Transaction Processing interface – STATE • NOT WAITING (CPU OR WAIT EVENT) • WAITING (Typically not performing work) – TYPE • USER • BACKGROUND
  22. 22. Time consumed VS time waited • SELECT SID,EVENT FROM V$SESSION WHERE STATUS='ACTIVE' AND STATE='WAITING' AND TYPE='USER'; SID EVENT ---------- ---------------------------------------------------------------- 18 jobq slave wait 472 jobq slave wait 476 Streams AQ: waiting for messages in the queue 585 Streams AQ: waiting for messages in the queue
  23. 23. Time consumed VS time waited • SELECT SID,EVENT FROM V$SESSION WHERE STATUS='ACTIVE' AND STATE!='WAITING' AND TYPE='USER'; SID EVENT ---------- ---------------------------------------------------------------- 2 direct path read 14 cell smart table scan 22 cell smart table scan 30 cell smart table scan 91 cell smart table scan 92 SQL*Net message to client 192 cell smart table scan 276 cell smart table scan
  24. 24. Reading the AWR report
  25. 25. Reading the AWR report
  26. 26. Where we should focus? • Time Model Statistics is the answer • Based on Oracle’s Instrumentation • Calculates the time spent by each session and categorizes it in buckets “Time model statistics use time to identify quantitative effects about specific actions performed on the database, such as logon operations and parsing. The most important time model statistic is database time, or DB time. This statistic represents the total time spent in database calls and is an indicator of the total instance workload. DB time is measured cumulatively from the time of instance startup and is calculated by aggregating the CPU and wait times of all sessions not waiting on idle wait events (non-idle user sessions).”
  27. 27. DB1
  28. 28. DB1 Sessions ACTIVE INACTIVE CPU WAITING 63,019 sec 38,245 sec 60% 40% CPU Bound system
  29. 29. DB1 Top SQL
  30. 30. DBT1
  31. 31. DBT1 Sessions ACTIVE INACTIVE CPU WAITING 13,604 sec 1,087 sec 8% 92% I/O Bound system?
  32. 32. What is a bottleneck? • Is the slowest operation is the set of operations • In Oracle set of operations are called wait events • Oracle’s instrumentation categorizes wait events into wait classes • We make use of the wait interface (set of views) to access this data • V$session_wait is the most useful
  33. 33. Can CPU be a bottleneck? • Yes • No easy way to reduce it apart of: – Reduce the workload – Buy more CPU power • Kernel code execution burns CPU – Even an I/O request
  34. 34. DBT1 I/O Bound system!!
  35. 35. DBT1 Top SQL
  36. 36. Summary • From general to particular • From DB Time to Top SQL DB_TIME CPU or I/O Top SQL
  37. 37. Exadata SMART IO
  38. 38. Exadata SMART IO
  39. 39. ASH? • Alfredo, will this method also work with an ASH report?...... Kind of.. CPU 40% Others 50.37% (28.23%+15.54%+4.67%+1.93%) Don’t know the DB Time!!
  40. 40. Session ID: Remember to complete your evaluation for this session within the app! 171