Showing posts with label AWR. Show all posts
Showing posts with label AWR. Show all posts

Monday, March 17, 2014

What are AWR and ADDM and how are they related?

In Oracle 10g, one of the major changes to the database was the AWR and the ADDM.

AWR (Automatic Workload Repository)
Purpose: To collect statistics about the database automatically, without DBA intervention.
Snapshots of the database are taken every hour by default, and statistics derived from these snapshots are saved for 7 days by default.
The statistics are created through a separate background process called MMON (manageability monitor process).

ADDM (Automatic Database Diagnostic Monitor)
Purpose: To analyze the data in the AWR, without DBA intervention. The ADDM will analyze the statistics and save the results in the database. If the parameter STATISTICS_LEVEL is set to TYPICAL or ALL, ADDM is triggered every hour by default, right after a new snapshot has been taken by the AWR.

How to find the AWR snapshots currently available in the database

SET LINES 100 PAGES 999

SELECT SNAP_ID,SNAP_LEVEL, TO_CHAR(BEGIN_INTERVAL_TIME, 'dd.mm.yy hh24:mi:ss') "Starttime"
FROM DBA_HIST_SNAPSHOT 
ORDER BY 1
/

Wednesday, November 6, 2013

How to use the dbms_explan.display_awr function to find the execution plan of a query in the AWR

set linesize 200
set pagesize 0
select * from table 
(dbms_xplan.display_awr( '44snxh96pfuxb',1084138060,null, 'TYPICAL'));
Where
- the first argument is the SQL id
- the second argument is plan hash value (optional)
- the third argument the DB_ID. If not specified, the value from V$DATABASE is used
- the fourth argument is the format string. TYPICAL is the default value.

Source: Oracle Documentation