BIT352 ยท 0 ยท 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 access, buffer cache hits |
| Time model statistics | DB time, parse time |
Purpose of AWR:
- Identify performance bottlenecks
- Compare database performance between two time periods
- Support Oracle 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:
-- Connect as SYSDBA
sqlplus / as sysdba
-- Run the AWR report script
@$ORACLE_HOME/rdbms/admin/awrrpt.sql
Steps during script execution:
- Choose report format: HTML or TEXT
- Enter the number of days to list snapshots
- Select the Begin Snapshot ID
- Select the End Snapshot ID
- Enter the report file name (e.g.,
awr_report.html)
Method 2: Using Oracle Enterprise Manager (OEM)
- Log in to Oracle Enterprise Manager (OEM)
- Navigate to: Performance --> AWR --> AWR Report
- Select the time period (begin and end snapshots)
- Click Generate Report
- View the report directly in the browser
Method 3: Using DBMS_WORKLOAD_REPOSITORY Package
-- Generate AWR report manually using PL/SQL
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 AWR-Related Views:
| View | Description |
|---|---|
DBA_HIST_SNAPSHOT | Lists all available snapshots |
DBA_HIST_SYSSTAT | Historical system statistics |
DBA_HIST_SQL_PLAN | Historical SQL execution plans |
DBA_HIST_ACTIVE_SESS_HISTORY | Active session history |
Summary
AWR is a powerful Oracle performance monitoring tool that stores historical snapshots of database activity. DBAs use AWR reports to analyze performance trends, identify slow SQL queries, and diagnose database issues by comparing two snapshot periods using SQL*Plus scripts, OEM, or the DBMS_WORKLOAD_REPOSITORY package.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.