AWR
AWR
AWR
DOYENSYS
1. Birth of Awr.
2. What is Awr.
3. Features In Awr.
4. Installation of Awr.
5. Running Awr.
• Creating a Report.
• Modifying the Default Setting.
• Creating Extra Snapshot.
• Dropping a Snapshot.
• Creating a Baseline Snapshot.
• Dropping a Baseline Snapshot.
• Comparing the Two Reports.
• Awr VS Stats pack.
• View & Tables in Awr.
• Awr in Enterprise Manager
DOYENSYS
AWR Birth
DOYENSYS
WHAT IS AWR?
DOYENSYS
Metrics Collected By AWR
DOYENSYS
AWR FEATURES
The AWR is used to collect performance statistics including:
DOYENSYS
INSTALLATION OF AWR
DOYENSYS
RUNNING AWR
DOYENSYS
RUNNING A REPORT
To Run AWR there are two preloaded scripts 10g at the location
• @$ORACLE_HOME/rdbms/admin/awrrpt.sql
• @$ORACLE_HOME/rdbms/admin/awrrpti.sql
• These both scripts are similar to the statspack reports gives the
option of HTML or plain text formats to save the output. Both
scripts gives the same output where us awrrpti.sql lets us to
select a single instance.
• When we execute these scripts it prompts us to enter the
format of the report [HTML or TEXT],
• Start snapshot id, End snapshot id and Report filename. The
result can be viewed in a browser or text editor accordingly.
DOYENSYS
Specifying the Report Type
DOYENSYS
Specifying the Number of Days Snapshots to Choose from
DOYENSYS
Specifying the Report Name and Final Result
DOYENSYS
ERROR
When an instance is shutdown between two snapshots it will
return a error like.
DOYENSYS
Modifying The Default Settings
By Default the snapshots are taken every hour and
retained for 7 days .These Default Values can be altered
by
No of days snapshot will be retained
DOYENSYS
The changes in the snapshot settings are updated in the table
DBA_HIST_WR_CONTROL.
DOYENSYS
Creating An Extra Snapshot
DOYENSYS
Dropping Snapshots
• With the help of the command given below we can drop the
snapshots.
DOYENSYS
Procedure to Purge the Reports according to user given no of days
set serveroutput on
declare
v_beginsnap number;
v_endsnap number;
cursor test is
select min(snap_id),max(snap_id)from dba_hist_snapshot where startup_time<sysdate-
&noofdays order by snap_id;
begin
open test;
for i in 1..1 loop
fetch test into v_beginsnap,v_endsnap;
dbms_output.put_line (v_beginsnap||' '||v_endsnap);
end loop;
close test;
DBMS_WORKLOAD_REPOSITORY.drop_snapshot_range (
low_snap_id => v_beginsnap,
high_snap_id => v_endsnap);
END;
/
DOYENSYS
Creating a Baseline Snapshot.
DOYENSYS
Dropping a Baseline Snapshot
• The pair of snapshots associated with a baseline are retained
until the baseline is explicitly deleted
DOYENSYS
• Baseline Information Can be Gathered from the table
DBA_HIST_BASELINE.
DOYENSYS
Comparing The Two Reports
Comparing Baseline Report and Newly Generated Report
DOYENSYS
STEPS TO COMPARE
DOYENSYS
3. Specify the No of Days for the first pair of snapshots.
DOYENSYS
5. Specify the No of Days for the second pair of snapshots.
DOYENSYS
7. Specify the report name
DOYENSYS
COMPARED REPORT and a NORMAL REPORT
DOYENSYS
AWR [vs] STATSPACK
• Statspack does not store history for new metric statistics
introduced in Oracle10g.
The key AWR views, dba_hist_sysmetric_history and
dba_hist_sysmetric_summary. dba_hist_service_stat ,
dba_hist_service_wait_class and dba_hist_service_name , which
store history for performance cumulative statistics tracked for
specific services.
DOYENSYS
• When the Statspack tablespace runs out of space, Statspack
quits working. The snapshot collected by the Statspack should
be purged manually.
DOYENSYS
AWR VIEWS AND TABLES
• V$ACTIVE_SESSION_HISTORY - Displays the active session
history (ASH) sampled every second.
• V$METRIC - Displays metric information.
• V$METRICNAME - Displays the metrics associated with each
metric group.
• V$METRIC_HISTORY - Displays historical metrics.
• V$METRICGROUP - Displays all metrics groups.
• DBA_HIST_ACTIVE_SESS_HISTORY - Displays the history
contents of the active session history.
• DBA_HIST_BASELINE - Displays baseline information.
• DBA_HIST_DATABASE_INSTANCE - Displays database
environment information.
• DBA_HIST_SNAPSHOT - Displays snapshot information.
• DBA_HIST_SQL_PLAN - Displays SQL execution plans.
• DBA_HIST_WR_CONTROL - Displays AWR settings.
DOYENSYS
AWR IN ENTERPRISE MANAGER
• The automated workload repository administration tasks have
been included in Enterprise Manager.
THANK YOU
SANJAY BALA.A
DOYENSYS
DOYENSYS
AWR Frequently Asked Questions
2. What Is AWR.
3. How to confirm the Awr running.
4. How to modify the default settings.
5. How to create a extra snapshot in between the interval.
6. How to generate a Baseline report.
7. How to automatically purge the sysaux tablespace.
8. How to compare the Baseline report with the last taken
report.
DOYENSYS