Você está na página 1de 2

Oracle AWR (Automatic Workload Repository) and ADDM (Automatic Database Diagnostic

Monitor) which are available since Oracle 10g are useful features for performance tuning and
troubleshooting.
For developer like me who uses Oracle but is not a Oracle dba both AWR and ADDM are useful
when I need to troubleshoot for performance related issues related to my application. SQL
Tuning Advisor is useful also after I identify the SQL statements which cause the bottleneck.
AWR Report

You can either use OEMDDC, which is the Enterprise Database Control to view the AWR
snapshots, or can generate the AWR reports in text or HTML format.
By default for every database, Oracle automatically generates snapshots of the performance data
once every hour and stores the statistics in the workload repository.
You can manually capture a snapshot if you want.
% sqlplus / as sysdba
SQL> exec dbms_workload_repository.create_snapshot;
You can run awrrpti.sql script to generate the report.
%sqlplus / as sysdba
SQL> @$ORACLE_HOME/rdbms/admin/awrrpt.sql
The report contains useful information like
Wait Events Statistics
SQL Statistics
Instance Activity Statistics
IO Stats
Buffer Pool Statistics
Advisory Statistics
Wait Statistics
Undo Statistics
Latch Statistics
Segment Statistics
Dictionary Cache Statistics
Library Cache Statistics
Memory Statistics
Streams Statistics
Resource Limit Statistics
init.ora Parameters
You can also create baseline snapshots and do your performance tuning based on the baseline.
ADDM(Automatic Database Diagnostic Monitor)
ADDM analyses a number of different database-related problems
Memory-related issues such as shared pool latch contention, log buffer issues, or database buffer
cache related problems
CPU bottlenecks
Disk I/O performance issues
Database configuration problems
Space-related issues, such as tablespaces running out of space
Application and SQL tuning issues such as excessive parsing and excessive locking
The Automatic Database Diagnostic Monitor ( ADDM ) is an advisor which detects problem
area’ s in the database and and which gives recommendations. ADDM uses the statistical data
from the AWR - Automatic Workload Repository - stored in the sysaux tablespace. By default
the statistical data is gathered / written to disk by snapshots every hour and kept in the sysaux
tablespace for 7 days, assuming you haven’ t set the instance parameter statistics_level to basic. (
default = typical ). Please note you can also take AWR Reports which are an equivalent of the
statspack reports from previous releases. (AWR reports gives even more detailed information )
We can however create a snapshot manually
SQL> exec dbms_workload_repository.create_snapshot;
PL/SQL procedure successfully completed.
As well we can change the retention period and the snapshot interval. In the example below we
change the retention period to 5 days ( 5 x 24 x 60 ) and the snapshot interval to 30 minutes.
SQL> exec dbms_workload_repository.modify_snapshot_settings (retention =>
7200,interval => 30);
PL/SQL procedure successfully completed.
Here is an example of how one can take a ADDM report.
SQL> @/app/oracle10g/10.2.0/rdbms/admin/addmrpt.sql;