Step-by-Step Guide to Recreating the Automatic Workload Repository (AWR) in Oracle Database
The Automatic Workload Repository (AWR) captures performance statistics for Oracle databases at regular intervals. If AWR data becomes corrupt, incomplete, or needs to be reset, it may be necessary to recreate the AWR repository.
Note: In a multitenant environment (CDB/PDB), these steps should be performed at the container level.
Step 1: Check and Disable AWR Snapshot Creation
Check Current Snapshot Interval
Before making any changes, check the current snapshot interval:
Disable AWR Snapshot Creation
This prevents new snapshots from being created while AWR is being dropped.
Step 2: Restart Database in Restricted Mode (Not required if heavy transaction not happening in database)
This ensures no transactions occur while dropping AWR objects.
Step 3: Drop and Recreate AWR Objects
Run the AWR Drop Script
Note: In Oracle 12.2+, running this script in restricted mode might result in
ORA-00600: [opiodr]
errors. If this happens, proceed manually.
Verify AWR Objects Are Dropped
Run this query to check if any AWR objects still exist:
Manually Drop Remaining Objects (if needed)
If any objects remain after running catnoawr.sql
, manually drop them:
Step 4: Recreate AWR Objects
Purge Recycle Bin (if needed)
Run AWR Installation Scripts
If you encounter the following errors:
ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "SYS.DBMS_SWRF_INTERNAL" has been invalidated
Then proceed to Step 5.
Step 5: Check and Recompile Invalid Objects
Run the following queries to check for invalid objects:
Check for Invalid Components
Check for Invalid Objects
Manually Compile Objects (if needed)
If objects appear valid but errors persist, re-run:
Step 6: Restart Database in Normal Mode
Step 7: Re-enable AWR Snapshot Creation
Reset the snapshot interval to its original value (example: 60 minutes):
Step 8: Verify AWR Snapshots and Generate Reports
Manually Create Snapshots
Generate an AWR Report
This confirms that AWR is functioning properly.
Step 9: Handling Issues During AWR Recreation
If you still experience issues, open a Service Request (SR) with Oracle Support.
Common Issue:
IfWRMS$_SNAPSHOT
is missing, manually create it:
Post a Comment
Post a Comment