0% found this document useful (0 votes)
10 views

AWR_linked

The document provides guidance on how to effectively read and interpret Oracle AWR reports, emphasizing the importance of focusing on key sections rather than the entire report. Key areas to analyze include Load Profile, Top Foreground Events, Wait Classes, Time Model Statistics, and SQL Statistics. The author, Yuan Yao, shares his expertise and experience in database management to help users identify performance issues and optimize their databases.

Uploaded by

chinnasamy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

AWR_linked

The document provides guidance on how to effectively read and interpret Oracle AWR reports, emphasizing the importance of focusing on key sections rather than the entire report. Key areas to analyze include Load Profile, Top Foreground Events, Wait Classes, Time Model Statistics, and SQL Statistics. The author, Yuan Yao, shares his expertise and experience in database management to help users identify performance issues and optimize their databases.

Uploaded by

chinnasamy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

How to Read Oracle AWR Report

Yuan Yao
About Me

• Yuan Yao
• Oracle ACE with over 20 years of experience in
Oracle and MySQL databases
• Former database manager at IBM
• Holder of more than 20 Oracle certifications
• Inventor of two computer patents
• Author of the book MySQL 8.0 Operations and
Optimization (ISBN: 9787302602682)
• Served over 20,000 database clients
• Blog: byte-way.com
• Follow me on X: @YuanOracle

Yuan Yao
Agenda
• Don't Read the Entire AWR Report—Only a Few Key Sections
• Load Profile
• Top 10 Foreground Events by Total Wait Time
• Wait Classes by Total Wait Time
• Time Model Statistics
• SQL Statistics

Yuan Yao
Don't Read the Entire AWR Report—Only a Few Key Sections!

Start from the top of the report, stop at Time Model Statistics section,
answer two key questions:

Where do user sessions spend their time? (User’s perspective)


How does Oracle consume resources? (Database’s perspective)

The answers will direct you to the problematic sections.


Details is in the following tutorial.
Stay tuned!

Yuan Yao
How to Interpret Oracle AWR report
• Don't Read the Entire AWR Report—Only a Few Key Sections
• Load Profile
• Instance Efficiency Percentages (Target 100%)
• Top 10 Foreground Events by Total Wait Time
• Wait Classes by Total Wait Time
• IO Profile
• Time Model Statistics
• SQL Statistics

Yuan Yao
Reverse Engineering Load Profile
Download Script

Yuan Yao
Where do Load Profile Metrics Come From?
Metric Source View Source Statistics
DB Time(s) dba_hist_sys_time_model DB Time
DB CPU(s) dba_hist_sys_time_model DB CPU
Background CPU(s) dba_hist_sys_time_model background cpu time
Redo size dba_hist_sysstat redo size
Logical reads dba_hist_sysstat session logical reads
Block changes dba_hist_sysstat db block changes
Physical reads dba_hist_sysstat physical reads
Physical writes dba_hist_sysstat physical writes
Read IO requests dba_hist_sysstat physical read IO requests
Write IO requests dba_hist_sysstat physical write IO requests
Read IO (MB) dba_hist_sysstat physical read bytes
Write IO (MB) dba_hist_sysstat physical write bytes
IM scan rows dba_hist_sysstat IM scan rows
Session Logical Reads IM dba_hist_sysstat session logical reads - IM
User calls dba_hist_sysstat user calls
Parses dba_hist_sysstat parse count (total)
Hard Parses dba_hist_sysstat parse count (hard)
BYTES_PROCESSED
SQL Work Area (MB) wrh$_pga_target_advice
(PGA_TARGET_FACTOR = 1)
Logons dba_hist_sysstat logons cumulative
User Logons dba_hist_sysstat user logons cumulative
Executes dba_hist_sysstat execute count
Rollbacks dba_hist_sysstat user rollbacks
Transactions dba_hist_sysstat user commits + user rollbacks
Yuan Yao
Where to get descriptions of the statistics

Yuan Yao
DB Time
DB Time tells you how much workload your database is actually handling. It is derived by dividing
"DB Time" by "Elapsed Time”

Yuan Yao
CPU Usage
The combined CPU usage is 9.9 CPUs per second. Given the server’s 80
CPUs, we are not CPU-bound.

Yuan Yao
How to Interpret Oracle AWR report
• Don't Read the Entire AWR Report—Only a Few Key Sections
• Load Profile
• Instance Efficiency Percentages (Target 100%)
• Top 10 Foreground Events by Total Wait Time
• Wait Classes by Total Wait Time
• IO Profile
• Time Model Statistics
• SQL Statistics

Yuan Yao
Reverse Engineering Top Events
Download Scirpt

Yuan Yao
Time Units

• s (seconds): 1 second = 1.0 seconds


• ms (milliseconds): 1 millisecond = 0.001 seconds
• us (microseconds): 1 microsecond = 0.000001 seconds
• ns (nanoseconds): 1 nanosecond = 0.000000001 seconds
Yuan Yao
Reverse Engineering Wait Classes
Download Scirpt

Yuan Yao
Where Does the Extra 22% Come From?

Yuan Yao
Time Model Statistics Section Reveals the 22%

Yuan Yao
Avg Active Sessions

Yuan Yao
Time Model Statistics Section Reveals the 22%

Yuan Yao
Time Model Statistics

Yuan Yao
Reverse Engineering the Time Model
Download Scirpt

Yuan Yao
Interpreting Time Model Statistics

• Offers a view of how the database


spends its time from the user’s
standpoint
• Investigate statistics with prolonged
durations (except for "DB CPU" and "sql
execute elapsed time")
• Evaluate “Time (s)” against elapsed time
• Statistics can overlap
• Certain statistics encompass others
• The sum of “% of DB Time” can exceed
100%.

Yuan Yao
Parsing Time Is Included within SQL Execution
Time

A severe parsing issue!


Yuan Yao
Do SQL and PL/SQL Overlap?

Yuan Yao
Secret Behind the Gap Between SQL
Execution Time and DB Time

Yuan Yao
Secret Behind the Gap Between SQL
Execution Time and DB Time

Yuan Yao
SQL Statistics

Yuan Yao
How Representative Are Captured SQL Statements?
Oracle only captures SQL statements in the shared pool (V$SQL) when
an AWR snapshot is taken.

Yuan Yao
Why the SQL %Total Sum Exceeds 100%?

Yuan Yao
How to Tell If SQL Comes from PL/SQL or an
Application
SQLs from PL/SQL exhibit two characteristics:
• All words in the SQL statements are in uppercase
• Input variables are formatted as :Bn
• Output Variables are formatted as :On

Yuan Yao
SQL Comes from PL/SQL

Yuan Yao
Evaluating SQL Health: %CPU and %IO Metrics
A healthy SQL list

Yuan Yao
Evaluating SQL Health: %CPU and %IO Metrics
An unhealthy SQL list

Yuan Yao
Oracle AWR Case Studies

Yuan Yao
Agenda
To Be Continued, stay tuned!

Yuan Yao
Using AWR and ASH in Tandem

Yuan Yao
Agenda
Start with AWR to spot trends, then use ASH to pinpoint root causes
(macro-to-micro approach)
To Be Continued, stay tuned!

Yuan Yao

You might also like