0 9

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]

Database AdministrationChapter 8: Monitoring, Tuning and PerformanceOracle AWR overview

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:

CategoryExamples
Wait statisticsTop wait events, wait times
SQL statisticsHigh load SQL statements
System statisticsCPU usage, I/O, memory
Object statisticsSegment access, buffer cache hits
Time model statisticsDB 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:

  1. Choose report format: HTML or TEXT
  2. Enter the number of days to list snapshots
  3. Select the Begin Snapshot ID
  4. Select the End Snapshot ID
  5. Enter the report file name (e.g., awr_report.html)

Method 2: Using Oracle Enterprise Manager (OEM)

  1. Log in to Oracle Enterprise Manager (OEM)
  2. Navigate to: Performance --> AWR --> AWR Report
  3. Select the time period (begin and end snapshots)
  4. Click Generate Report
  5. 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
    )
);

ViewDescription
DBA_HIST_SNAPSHOTLists all available snapshots
DBA_HIST_SYSSTATHistorical system statistics
DBA_HIST_SQL_PLANHistorical SQL execution plans
DBA_HIST_ACTIVE_SESS_HISTORYActive 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.