AWR_linked
AWR_linked
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:
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
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
Yuan Yao
Parsing Time Is Included within SQL Execution
Time
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