Professional Documents
Culture Documents
You can obtain more information regarding the AWR and how to setup and configure it with Automatic
Workload Respository (AWR).doc
The purpose of ADDM is to reduce a key database metric called DB Time which is the total time (in
microseconds) the database spends actually processing users requests. DB time includes the total amount of
time spent on actual database calls (at the user level) and ignores time spent on background process. ADDM
will only report on processes that contribute excessive DB time.
Configuring ADDM
To active the AWR change the system parameter statistics_level to one of three values
To change the snapshot interval and how many days the snapshots are kept you use the package
dbms_workload_repository or Enterprise Manager
Snapshot configuration
exec dbms_workload_repository.modify_snapshot_settings ( interval => 60, retention =>
43200);
Change snapshotting
values
interval = minutes
retention = seconds
Display values select * from dba_hist_wr_control;
Snapshot Management
Create a snapshot exec dbms_workload_repository.create_snapshot;
exec dbms_workload_repository.drop_snapshot_range (low_snap_id=>1077,
Delete snapshots
high_snap_id=>1078);
Display snapshots select snap_id, begin_interval_time, end_interval_time from dba_hist_snapshot order by 1;
ADDM views
There are a number of views that should used when involving the ADDM
ADDM Report
To run ADDM report you can use the following operating system scripts or use Enterprise Manager.
Automatic Database Diagnostic Monitor (ADDM)
the script will ask for begin snapshot and end snapshot plus if you want the report in text or
addmrpt.sql
html
ADDM baselines
The main purpose of a baseline is to preserve typical runtime statistics in the AWR repository, allowing you to
run the AWR snapshot reports on the preserved baseline snapshots at any time and compare them to recent
snapshots in the AWR.
exec dbms_workload_repository.create_baseline (
start_snap_id=> 1007,
Create baseline end_snap_id=> 1009,
baseline_name=>'EOM baseline'
);
Remove baseline exec dbms_workload_repository.drop_baseline ( baseline_name => 'EOM baseline');
Display baselines select baseline_id, baseline_name, start_snap_id, end_snap_id from dba_hist_baseline;
Server Alerts
Server generated alerts are controlled by the MMON (manageability monitor) which is assisted by the MMNL
(manageability monitor light). The metrics are gathered and thresholds checked once every minute. There are
two thresholds warning and critical. There are over 100 alerts, MMON compares the metrics to the configured
threshold and will write a message to the ALERT_QUE (in the AWR - sysaux tablespace). Processes can
subscribe (only if you need to write your own alert handler) to this queue (and other queues) you pass on
information from one process to another. The Enterprise manager daemon will action the ALERT_QUE and can
places alerts messages in the GUI or can even send an email, you can also write your own alert handler.
Remember the metrics are collected from the SYSAUX tablespace not the v$ views. There is no connection to
the alert log and the server alert system.
Set_threshold fields
------------------------------------------------------------------------------------------
Metrics_id - the name of the metric
Change threshold
Warning_operator - the comparison operator to compare values
Warning_value - warning threshold
Critical_operator - comparison operator for comparing current value to the warning
threshold
Critical_value - critical threshold
Observation_period - timer period at which metrics are computed against the
threshold
Consecutive_occurences - how many times the value exceeds the threshold before an
alert is raised
Instance_name - the instance that the threshold is applied
Object_type - object type i.e tablespace, session, service, etc
Object_name - name of the object
Get Threshold set serveroutput on
DECLARE
vWarnOp NUMBER(10);
vWarnVal VARCHAR2(100);
vCritOp NUMBER(10);
vCritVal VARCHAR2(100);
vObsvPer NUMBER(5);
vConOcur NUMBER(5);
BEGIN
dbms_server_alert.get_threshold(dbms_server_alert.tablespace_pct_full,
vWarnOp, vWarnVal, vCritOp, vCritVal, vObsvPer, vConOcur, NULL,
dbms_server_alert.object_type_tablespace, 'TEST');
dbms_output.put_line('WarnOp: ' || TO_CHAR(vWarnOp));
dbms_output.put_line('WarnVal: ' || vWarnVal);
dbms_output.put_line('CritOp: ' || TO_CHAR(vCritOp));
dbms_output.put_line('CritVal: ' || vCritVal);
dbms_output.put_line('Observation: ' || vObsvper);
dbms_output.put_line('Occurences: ' || vConOcur);
END;
Automatic Database Diagnostic Monitor (ADDM)
/
select dbms_server_alert.expand_message(null, 6, null, null, null, null, null) alert_msg
from dual;