How to configure the interval for Oracle AWR snapshots?
In Oracle databases, the AWR (Automatic Workload Repository) is a feature used to collect and store database performance statistics. AWR snapshots refer to the database performance data collected at regular intervals.
The AWR snapshot interval can be configured by following these steps:
- Firstly, you need to confirm that AWR has been enabled. You can verify this by using the following query:
- Retrieve the value from the V$PARAMETER table where the name is ‘statistics_level’.
- If the returned value is ‘TYPICAL’ or ‘ALL’, it indicates that AWR is enabled. If the returned value is ‘BASIC’, it indicates that AWR is not enabled.
- If AWR is enabled, you can query the current AWR snapshot interval with the following query.
- Select the value from the DBA_HIST_WR_CONTROL where the DBID is equal to the DBID from the V$DATABASE.
- This will return the current AWR snapshot interval in minutes.
- To adjust the AWR snapshot interval, you can use the following command:
- Start
Adjust the settings of the snapshot interval in DBMS workload repository to. - One of them is the new AWR snapshot interval value in minutes.
- Be cautious when adjusting the AWR snapshot interval as it may impact database performance and storage costs.
- After changing the interval of AWR snapshots, you can re-run the query in step 2 to confirm if the new settings have taken effect.
Before making any changes to the AWR snapshot intervals, it is recommended to first discuss and evaluate with the database administrator or performance optimization expert to avoid unnecessary performance and storage costs.