Dung (Donny) Nguyen

Senior Software Engineer

Oracle AWR Report

An Oracle AWR (Automatic Workload Repository) report can help identify performance issues by providing detailed information about the database’s workload, resource usage, and wait events. Below is an example of an AWR report with some common performance issues, and how it can help to identify the root cause.

Sample AWR Report Snippet (Performance Issue)

1. Top SQL by Elapsed Time

SQL ID        | SQL Text                                              | Elapsed Time (s)
-------------------------------------------------------------
xyz123        | SELECT * FROM large_table WHERE condition=...        | 15000
abc456        | INSERT INTO log_table VALUES (....)                   | 10000

Thresholds to Identify Problems:

2. Top Wait Events

Wait Event                          | Total Waits | Total Time (s) | Avg Wait Time (s)
-------------------------------------------------------------
db file sequential read             | 50,000      | 5000            | 0.1
log file sync                       | 15,000      | 3000            | 0.2
buffer busy waits                   | 10,000      | 2000            | 0.2

Thresholds to Identify Problems:

3. Instance Efficiency Metrics

Buffer Cache Hit Ratio: 99.9%
Library Cache Hit Ratio: 99.8%
Disk Read/Write Ratio: 80/20

Thresholds to Identify Problems:

4. Top Background Wait Events

Wait Event                          | Total Waits | Total Time (s) | Avg Wait Time (s)
-------------------------------------------------------------
redo log buffer space               | 20,000      | 1500            | 0.075
control file parallel write         | 5,000       | 2500            | 0.5

Thresholds to Identify Problems:

Summary of Key Thresholds

Metric Ideal Value Problematic Value (Requires Tuning)
SQL Elapsed Time < 1 second (critical queries) > 1 second or > 10% of total DB elapsed time
Buffer Cache Hit Ratio > 95% < 90%
Library Cache Hit Ratio > 95% < 90%
db file sequential read Avg wait < 10 ms Avg wait > 10 ms or Total Time > 5% of DB time
log file sync Avg wait < 1 ms Avg wait > 1 ms or Total Time > 30% of DB time
buffer busy waits Avg wait < 1 ms Avg wait > 1 ms or Total Time > 1% of DB time
redo log buffer space Avg wait < 1 ms Avg wait > 1 ms or frequent waits (>1% of DB time)
Disk Read/Write Ratio Closer to 90/10 (OLTP) Skewed toward > 80% reads (requires tuning queries/memory)

How AWR Thresholds Help Pinpoint Problems

  1. SQL Optimization:
    • Use thresholds for Top SQL to identify and tune slow-running queries consuming excessive DB time.
  2. Wait Event Analysis:
    • Compare wait times against thresholds to pinpoint I/O, concurrency, or memory-related issues.
  3. Instance Efficiency:
    • Use ratios (like buffer cache and library cache hit ratios) to assess memory usage efficiency and tune SGA or SQL execution plans.
  4. Background Waits:
    • Investigate background processes when thresholds are breached to reduce redo log or control file bottlenecks.

By systematically analyzing these metrics against thresholds, DBAs can diagnose and resolve performance issues effectively.