How to Export Oracle Database AWR Reports (awrrpt.sql and awrrpti.sql)
An Oracle Automatic Workload Repository (AWR) report summarizes instance load profiles, foreground and background wait events, Top SQL statements, tablespace/datafile I/O latency, memory advisories, and RAC Global Cache interconnect statistics across two snapshots. Exporting in HTML format (.html) is recommended so all structured tables remain intact for automated analysis.
Before You Begin
- Generating AWR reports requires an Oracle Diagnostics Pack license on Enterprise Edition and a session with
SYSDBAorADVISOR/SELECT_CATALOG_ROLEprivileges. - Choosing the snapshot window: Pick a focused 15–60 minute window covering the incident or peak load rather than a multi-day span that averages out spikes. The start and end snapshots must not straddle an instance restart.
- 12c / 19c Multitenant (CDB / PDB): For instance-wide CPU, I/O, redo, and RAC interconnect analysis, run the report from
CDB$ROOT.
Export an Instance AWR Report via SQL*Plus
- Sign in to the database host as the
oracleuser, change to a writable output directory such as/tmp, and launch SQL*Plus:su - oracle cd /tmp sqlplus / as sysdba - Run the standard AWR report script:
SQL> @?/rdbms/admin/awrrpt.sql - Respond to the interactive prompts:
report_type: Enterhtml(default).num_days: Enter the number of days of snapshots to list (for example,1or2).begin_snapandend_snap: Enter the beginning and endingSnap Idvalues for the target window.report_name: Press Enter to accept the default filename (such asawrrpt_1_3917_3918.html).
- Type
exitto leave SQL*Plus and download the generated.htmlfile from/tmp.
Oracle RAC Multi-Instance Tip
On Oracle RAC clusters experiencing interconnect latency, gc blocks lost, or node skew, use awrrpti.sql to export matching snapshot windows for each RAC instance from a single session:
SQL> @?/rdbms/admin/awrrpti.sql
Specify each Instance Number in turn (for example, Instance 1 and Instance 2 over the same snapshot range) so both nodes can be inspected side by side.