BIT352 ยท 2081 ยท 5 marks
What is Oracle AWR? How AWR report is viewed in oracle?
What is Oracle AWR? How AWR report is viewed in oracle? [5]
Quick answer
AWR (Automatic Workload Repository) is a built-in Oracle Database feature that automatically collects, processes, and maintains performance statistics for problem detection and self-tuning purposes.
Oracle AWR (Automatic Workload Repository)
What is Oracle AWR?
Note: The following answer is based on standard Oracle Database documentation, as no specific curriculum notes were provided.
Key Characteristics of AWR:
- AWR is a repository of historical performance data stored in the SYSAUX tablespace of the Oracle database.
- It collects snapshots of database performance statistics at regular intervals (default: every 60 minutes).
- Snapshots are retained for a default period of 8 days, after which they are automatically purged.
- It is managed by the MMON (Manageability Monitor) background process.
Data Collected by AWR:
| Category | Examples |
|---|---|
| Wait statistics | Top wait events, wait times |
| SQL statistics | High-load SQL statements |
| System statistics | CPU usage, I/O, memory |
| Object statistics | Segment-level access info |
| Time model statistics | DB time, parse time |
Purpose of AWR:
- Identify performance bottlenecks
- Compare database performance between two time periods
- Support the Automatic Database Diagnostic Monitor (ADDM)
- Assist DBAs in capacity planning and tuning
How AWR Report is Viewed in Oracle
AWR reports can be generated and viewed using the following methods:
Method 1: Using SQL*Plus Script
Oracle provides a built-in script to generate the AWR report:
@$ORACLE_HOME/rdbms/admin/awrrpt.sql
Steps:
-
Connect to the database as SYSDBA:
sqlplus / as sysdba -
Run the AWR report script:
@$ORACLE_HOME/rdbms/admin/awrrpt.sql -
The script prompts for:
- Report format: HTML or TEXT
- Number of days: to list available snapshots
- Beginning Snapshot ID
- Ending Snapshot ID
- Report filename
-
The report is saved as an
.htmlor.txtfile and can be opened in a browser.
Method 2: Using Oracle Enterprise Manager (OEM)
- Navigate to: Performance > AWR > AWR Report
- Select the begin and end snapshot
- Click Generate Report
- View the report directly in the browser interface
Method 3: Using DBMS_WORKLOAD_REPOSITORY Package
SELECT output FROM TABLE(
DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML(
l_dbid => &dbid,
l_inst_num => 1,
l_bid => &begin_snap,
l_eid => &end_snap
)
);
Key Sections in an AWR Report:
- Report Summary - DB time, load profile
- Top 5 Timed Events - Major wait events
- SQL Statistics - Top SQL by CPU, elapsed time
- Instance Activity Statistics
- I/O Statistics
- Memory Statistics
Summary
| Feature | Detail |
|---|---|
| Storage location | SYSAUX tablespace |
| Default snapshot interval | 60 minutes |
| Default retention | 8 days |
| Background process | MMON |
| Report script | awrrpt.sql |
AWR is a critical tool for Oracle DBAs to diagnose, monitor, and tune database performance effectively.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.