So you want to run an AWR report, but don’t want to go through Enterprise Manager, or perhaps it’s not installed or accessible.
Other options include logging into the database server to run awrrpt.sql, or using the DBMS_WORKLOAD_REPOSITORY API, but neither are trivial.
If you are using SQLcl, there’s a much easier way using the awr command. Below I will show you a simple example, but there are many more options you can explore using the help awr
command.
SQL> awr create snap
Snapshot taken, ID: 1
SQL> awr create snap
Snapshot taken, ID: 2
SQL> awr list snap
SNAP_ID DBID BEGIN_INTERVAL_TIME END_INTERVAL_TIME
__________ _____________ __________________________________ __________________________________
1 3218404077 08-MAY-25 09.51.10.000000000 AM 12-MAY-25 03.35.02.295000000 PM
2 3218404077 12-MAY-25 03.35.02.295000000 PM 12-MAY-25 03.37.21.536000000 PM
SQL> awr create html
Report written to: awr_ORCLPDB1_2025-05-08-09.51.10_2025-05-12-15.37.21.html
SQL> host ls -l awr_ORCLPDB1_2025-05-08-09.51.10_2025-05-12-15.37.21.html
-rw-r--r--@ 1 patrick staff 200589 May 12 16:45 awr_ORCLPDB1_2025-05-08-09.51.10_2025-05-12-15.37.21.html
SQL> help awr
Creates and retrieves AWR reports for the currently connected instance.
Usage:
awr <create_snapshot> | <create_report> | <list_snapshots>
<create_snapshot> := create snap[shot] (bestfit | lite | typical | all)?
<create_report> := create (html | text)? <begin-snapshot-id>? <end-snapshot-id>?
<list_snapshots> := list snap[shots]
<create_snapshot>
Creates a new snapshot and prints its id.
The optional parameter flush-level of the snapshot are (BESTFIT, LITE, TYPICAL, ALL).
<create_report>
Creates a new AWR report and writes it to a file called "AWR-<DB_Name>-<PDB_Name>-<Current Timestamp>.[html|txt]" in the current working directory.
<begin-snapshot-id>
Beginning snapshot id for the AWR report.
By default, the second last snapshot id is taken if no id has been provided.
<end-snapshot-id>
Ending snapshot id for the AWR report.
By default, the last snapshot id is taken if no id has been provided.
<list_snapshots>
Lists the available snapshots in the database.
More help topics:
AWR EXAMPLES
AWR SYNTAX