AWR (Automatic Workload Repository) Evaluate

Evaluating an AWR (Automatic Workload Repository) report in Oracle 19c involves analyzing the database's performance data over a specific period. The report captures metrics that provide insights into the database's activity and resource consumption, helping DBAs identify performance issues such as CPU bottlenecks, wait events, SQL inefficiencies, or I/O problems.

Here is a step-by-step guide on how to evaluate an AWR report:


1. Report Header: Basic Information

This section contains important details about the report, including:


2. Load Profile

This section summarizes the workload on the system, showing how many resources are being consumed per second and per transaction.

Key metrics to focus on:


3. Instance Efficiency Percentages

This section provides a snapshot of how efficiently Oracle is using its resources, focusing on cache and buffer utilization.


4. Top 5 Timed Foreground Events

This section highlights the main performance bottlenecks in the database, listing the top events that contributed to DB Time.

Focus on:


5. Time Model Statistics

This section breaks down where the database spends its time.


6. SQL Statistics (SQL ordered by ...)

Several sections provide performance details about individual SQL statements.

Focus on:


7. Instance Activity Stats

This section gives detailed statistics about database operations such as I/O, transactions, and sessions.


8. Operating System Statistics

This section shows how the underlying operating system is performing, which can be useful for diagnosing system-level bottlenecks.

Key metrics:


9. Wait Events (Detailed Section)

This section expands on the "Top 5 Timed Foreground Events" by providing a more detailed view of the wait events that occurred during the AWR snapshot.


10. I/O Statistics

This section provides a breakdown of the I/O load and performance for different tablespaces and data files.


11. Recommendations

Based on the findings in the AWR report, you can make recommendations such as:


Conclusion

Evaluating an AWR report involves focusing on key performance indicators such as CPU utilization, wait events, SQL performance, and I/O statistics. By systematically going through these sections, DBAs can identify bottlenecks and determine where tuning efforts should be focused to improve Oracle database performance.


Changing the AWR snapshot interval

Changing the AWR (Automatic Workload Repository) snapshot interval in Oracle affects how frequently snapshots are taken, which in turn impacts how detailed the performance data is. By default, Oracle takes snapshots every hour, but you can adjust this interval based on your requirements.

Changing the AWR Snapshot Interval

To change the AWR snapshot interval, you need to modify the AWR_SNAPSHOT_INTERVAL parameter. This parameter is set in the DBMS_WORKLOAD_REPOSITORY package, and it controls how frequently AWR snapshots are created.

Here’s how you can change the AWR snapshot interval:

Log in to SQL*Plus as SYSDBA:
bash
Copy code
sqlplus / as sysdba


Change the Snapshot Interval:
Use the following PL/SQL block to modify the snapshot interval. The interval is specified in minutes.
sql
Copy code


BEGIN

   DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings(

      interval => <new_interval_in_minutes>,

      retention => <new_retention_period_in_days>

   );

END;

/


Example: To set the snapshot interval to 30 minutes and the retention period to 10 days, use:
sql
Copy code


BEGIN

   DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings(

      interval => 30,

      retention => 10

   );

END;

/


Verify the Changes:
To check the current snapshot settings, you can query the DBA_HIST_WR_CONTROL view:
sql
Copy code
SELECT SNAP_INTERVAL, RETENTION FROM DBA_HIST_WR_CONTROL;

Notes:

Summary

Changing the AWR snapshot interval allows you to control how often performance snapshots are taken, providing more or less detailed performance data based on your needs. Use the DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings procedure to adjust the interval and retention settings. Be mindful of the impact on database performance when setting very short intervals.