an overview of awr , ash and addmpresentations/... · •ensure you have enough sysaux tablespace...

30
An overview of AWR , ASH and ADDM Scott Black 2/23/2011 DBA SIG

Upload: others

Post on 24-Oct-2019

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

An overview of AWR , ASH and ADDM

Scott Black2/23/2011DBA SIG

Page 2: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Learning About AWR

Real-World Performance Day with Tom Kyte

The Independent Oracle Users Groups presents “A Day of Real-World Performance” featuring Tom Kyte; coming to a city near you. Tom, author of the popular AskTom Blog, will be joined at this unique performance master class by

Andrew Holdsworth, head of Oracle’s Real World Performance group

Graham Wood, performance architect at Oracle and the father of ASH and AWR

Page 3: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Learning AWR -UTOUG

Performance Diagnosis with Custom ASH and AWR Reporting - Daniel Fink

RDBMS Forensics using ASH and AWR - Tim Gorman

Page 4: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Thanks For Coming

Questions?

Page 5: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

AWR –Automatic Work Repository

Enhanced STATSPACK

Reports can be generated from sqlplus or browers

Data is stored from various performance views including V$SYSSTAT, V$SESSTAT and V$ACTIVE_SESSION_HISTORY

Data from AWR is used by Undo, Segment, advisors and ADDM

New features are added in major and even minor version changes

Page 6: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Populating The AWR

ASH – Active Session History

Circular area of SGA memory that holds session wait information

MMON – New 10g background process that stores the ASH information in the AWR

AWR and ADDM talk with your Sales Rep about AWR license!

Page 7: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

ASH - Performance Graph

Page 8: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

ASH – Find Performance Problems

Page 9: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Sql Drill Down

Page 10: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Configuring AWR Snapshots

11.2 Default is snap every hour and retain for 7 days

Use either OEM or DBMS_WORKLOAD_REPOSITORY to change

BEGIN DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings(

retention => 43200,

interval => 30)

END;

Change to 30 minute snaps and keep for 30 days

Ensure you have enough space for the SYSAUX tablespace to store all the data!

STATISTICS_LEVEL should be set to typical or all

Page 11: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Access AWR via OEM

Page 12: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Configuring AWR Snapshots

STATISTICS_LEVEL should be set to typical or all or some stats could be missing

Setting the interval to zero turns of snapshot collection

View current snapshot settings in OEM or DBA_HIST_WR_CONTROL view

Page 13: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Manual AWR Snapshot

Need create a snap shot now

EXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot;

BEGIN DBMS_WORKLOAD_REPOSITORY.drop_snapshot_range ( low_snap_id => 22, high_snap_id => 32); END; /

Page 14: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

AWR Baselines 11g

Two snapshots that by default are retain forever that allows for performance comparison against another baseline.

3 Major types of baselines – Fixed, Moving Window, Templates

Page 15: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

AWR Fixed Baseline

Found in 10g but more flexible in 11gUse dates or snap ids for start and end periodsCan automatically retire baselines

DBMS_WORKLOAD_REPOSITORY.create_baseline(

start_snap_id => 2490,

end_snap_id => 2491,

baseline_name => 'test1_bl',

expiration => 60);

DBMS_WORKLOAD_REPOSITORY.create_baseline(

start_time => TO_DATE('09-JUL-2010 17:00', 'DD-MON-YYYY HH24:MI'),

end_time => TO_DATE('09-JUL-2010 18:00', 'DD-MON-YYYY HH24:MI'),

baseline_name => 'test2_bl',

expiration => NULL);

Page 16: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

AWR Moving Window Baselines

The last X number of days from today is the start and end of the baseline

If you want a baseline that is longer then the retention increase your retention!

SQL> SELECT moving_window_size

2 FROM dba_hist_baseline

3 WHERE baseline_type = 'MOVING_WINDOW';

MOVING_WINDOW_SIZE

------------------

7

SQL>

BEGIN DBMS_WORKLOAD_REPOSITORY.modify_snapshot_settings(

retention => 43200); -- Minutes (= 30 Days).

END; /

BEGIN DBMS_WORKLOAD_REPOSITORY.modify_baseline_window_size(

window_size => 20);

END; /

Page 17: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

AWR Template Baselines

Allows for creating baselines in the future

Can be a one time creation or a repeating baseline

BEGIN DBMS_WORKLOAD_REPOSITORY.create_baseline_template(

start_time => TO_DATE('01-DEC-2010 00:00', 'DD-MON-YYYY HH24:MI'),

end_time => TO_DATE('01-DEC-2010 05:00', 'DD-MON-YYYY HH24:MI'), baseline_name => '01_dec_010_00_05_bl', template_name => '01_dec_010_00_05_tp', expiration => 100);

END; /

Page 18: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

AWR Template Baselines

BEGIN DBMS_WORKLOAD_REPOSITORY.create_baseline_template(

day_of_week => 'MONDAY', -- Or ALL for everyday

hour_in_day => 0,

duration => 5,

start_time => SYSDATE,

end_time => ADD_MONTHS(SYSDATE, 6),

baseline_name_prefix => 'monday_morning_bl_',

template_name => 'monday_morning_tp',

expiration => NULL);

END;

/

BEGIN DBMS_WORKLOAD_REPOSITORY.drop_baseline_template

(template_name => '01_dec_008_00_05_tp');

END; /

Page 19: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Using Baselines For Alerting

Different time of day may call for different warning and critical thresholdsDuring the day system is OLTP. Lots of quick queries and low response timesAt night batch processes run causing large I/O waitsUse moving system window to set the thresholds so alerts are meaningful

Page 20: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving
Page 21: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

ADDM

Automatic diagnostic manager that uses AWR to find performance problemsAnalysis runs every time a AWR snapshot is takenMust have stats set to typical or allThe results are stored in the AWRResults may include hardware, database, schema and application changesFor I/O analysis ADDM needs to know how fast the storage is

EXECUTE DBMS_ADVISOR.set_default_task_parameter('ADDM', 'DBIO_EXPECTED', 8000);

FINDING 1: 59% impact (944 seconds)-----------------------------------The buffer cache was undersized causing significant additional read I/O. RECOMMENDATION 1: DB Configuration, 59% benefit (944 seconds) ACTION: Increase SGA target size by increasing the value of parameter "sga_target" by 28 M. SYMPTOMS THAT LED TO THE FINDING: Wait class "User I/O" was consuming significant database time. (83% impact [1336 seconds])

Page 22: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Running ADDM Report

From Sql Plus

rdbms/admin/addmrpt.sql

From OEM

Page 23: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Drill Down

Page 24: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Running AWR ReportFrom OEM

Page 25: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Running AWR Report via SqlPlus

@$ORACLE_HOME/rdbms/admin/awrrpt.sql

Page 26: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Real AWR Power, Compare Two Baselines

Use the system moving window or a saved baseline to compare bad performance to a known good performance period

Page 27: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Comparing AWR Reports

Page 28: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Comparing AWR Reports

Page 29: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Summary

•Upgrade to 11g!•Ensure you have enough SYSAUX tablespace for retention period•Stats are set to typical or all•Look at the system moving window•Dynamic Thresholds•Save baselines for at know good performance periods•Use AWR Compare

Page 30: An overview of AWR , ASH and ADDMPresentations/... · •Ensure you have enough SYSAUX tablespace for retention period •Stats are set to typical or all •Look at the system moving

Thanks For Coming

Questions?