ashawr perf kscope

46
Kellyn Pot’Vin Sr. Technical Consultant ASH and AWR Performance Data

Upload: kellyn-potvin-gorman

Post on 20-Aug-2015

471 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Ashawr perf kscope

Kellyn Pot’Vin

Sr. Technical Consultant

ASH and AWR Performance Data

Page 2: Ashawr perf kscope

About Me

Westminster, Colorado Oracle ACE Director, Sr. Technical Specialist at

Enkitec EM12c book is out and starting new books started! Specialize in performance and management of large

enterprise environments. Board of directors for RMOUG, Director of Training

Days, KSCOPE DB Track Lead, Women in Technology Leader

Blog: DBAKevlar.com Twitter: @DBAKevlar

Page 3: Ashawr perf kscope

Brief History

ASH= Active Session History AWR= Automatic Workload Repository Introduced in Oracle 10g Evolution to statspack, requests for

performance reporting improvements. “Always on” approach to performance metrics

with requirement of non-locking collection process.

Requires Management Diagnostics Pack License from Oracle.

Page 4: Ashawr perf kscope
Page 5: Ashawr perf kscope
Page 6: Ashawr perf kscope

AWR Repository

Used not only by the AWR reports● Automatic Database Diagnostic Monitor, (ADDM

Reporting)● SQL Tuning Advisor● Segment Advisor

By default, snapshots every hour. Retention is for 7 days. Both are modifiable, (so MODIFY!)

Snapshots can be taken at any time:EXEC DBMS_WORKLOAD_REPOSITORY.create_snapshot;

Page 7: Ashawr perf kscope

ASH Data

Samples each active database session every second.

Data is held in buffer in memory. Built into the Oracle kernel and accessed

through the v$active_session_history view. In an AWR snapshot, 1 row in 10 from ASH

buffer is placed into the AWR repository. Managed by the MMNL, (Memory Monitor Lite) Should not be used to track occurrence.

Page 8: Ashawr perf kscope

Running AWR from Enterprise Manager

Page 9: Ashawr perf kscope

Running ASH Report from EM

• ASH is always by time, not snapshot.• Set start date and time.• End date and time• Generate report

Page 10: Ashawr perf kscope

HTML Format ASH

Page 11: Ashawr perf kscope

Top User and Background Events

High Level Importance…

Page 12: Ashawr perf kscope

Top Impacting SQL Hmmm…What have we here??

Top SQL

Page 13: Ashawr perf kscope

Top PL/SQL Procedures

What Time was this again??

Top SQL and the Time Game

Page 14: Ashawr perf kscope

Killed the Tuning Advisor that was running against the workload collection.

Killed the stats job that was running. COMMENTED out the stats and tuning

advisors someone thought should run each day and night mulitple times per day.

Yes, processing started to run efficiently again.

Solution

Page 15: Ashawr perf kscope

Running Reports, Command Line

$ORACLE_HOME/rdbms/admin/awrrpt.sql;

$ORACLE_HOME/rdbms/admin/ashrpt.sql;

$ORACLE_HOME/rdbms/admin/awrsqlrpt.sql;

Less Known AWR Reports:

awrinfo.sql General AWR Info

awrddrpt.sql Comparison report between snapshots

awrblmig.sql Migrates pre-11g baseline data into 11g Baseline tables.

awrgrpt.sql RAC Aware AWR Report.

Page 16: Ashawr perf kscope

AWR Info Report

Snapshot Interval Information Basic Info on Instances and Nodes No User or Application Schema info. Space Usage by SYSAUX WRH$ and Non- AWR Objects, ordered by size Snapshot info and if any errors. Advisor Tasks

Page 17: Ashawr perf kscope

AWR Info Report

Page 18: Ashawr perf kscope

ASH Info Report, (cont.)

Page 19: Ashawr perf kscope

AWR and ASH in Real Life

Scenario RAC, 2-nodes, Ver. 10.2.0.5Application Waits Seen in EM Performance Page.Out of the ordinary CPU Resource usage50 minutes of time for evaluation. AWR set to 10 min. interval on snapshots.

Page 20: Ashawr perf kscope

Run AWR for Timeline Shown in Enterprise Manager

Who needs a top five when the top 2 are so impacting?

Page 21: Ashawr perf kscope

Top SQL by Elapsed Time

Page 22: Ashawr perf kscope

AWR Segment Info

Page 23: Ashawr perf kscope

Next Steps Using ASH

Limiting to a defined minute instead of a 1 hour view to give us a clear database timeline.

Top SQL Top Sessions Top Waits Blocking Sessions Top Objects Waits by time during sample intervals.

Page 24: Ashawr perf kscope

Top Modules and Clients

Page 25: Ashawr perf kscope

Top SQL Statements

Page 26: Ashawr perf kscope

Blocking Sessions

The Blocking Session, along with Top Object should be noted.

Page 27: Ashawr perf kscope

Next Step

Kill Blocking Session? Investigate Further?

Investigate SQL_ID’s with AWR SQL

Two SQL_ID’s are in question:

4z1vnc0995bm6

b6vaxgxt4wh8v

Page 28: Ashawr perf kscope

4z1vnc0995bm6- Update

Page 29: Ashawr perf kscope

Update Cont.

Page 30: Ashawr perf kscope

B6vaxgxt4wh8v- Select

Page 31: Ashawr perf kscope

Select Cont.

Page 32: Ashawr perf kscope

Long Story Short….

Subsequent ASH reports showed blocked sessions became blocking sessions.

Update statement and select belong to same code. Update is executed, then large select, no commit until AFTER select is complete.

Request to development to commit before select and tuning recommendation from AWR SQL_ID specific report for select statement.

Page 33: Ashawr perf kscope

Querying ASH Data Directly

More defined reporting No need to pull full report Detail on waits that are of interest Join to non-AWR objects

Simple queries presented…

Page 34: Ashawr perf kscope

V$ACTIVE_SESSION_HISTORY

• More Column Data in 11g than shown.

• Flags column is for future development.

• Broken down into usable sections, easier to query.

Page 35: Ashawr perf kscope

Knowing What’s in the ASH Buffer

• Deters from making assumptions on what data is being queried.

• Know your samples!

Page 36: Ashawr perf kscope

Wait Events Across Nodes

Page 37: Ashawr perf kscope

Query top 10 SQL_ID’s in the last 10 minutes?

Page 38: Ashawr perf kscope

SQL_ID and CPU Usage

Page 39: Ashawr perf kscope

IO Waits by Object from ASH

Page 40: Ashawr perf kscope

SQL Text with ASH

• SQL for most recent five minutes of sample data from ASH

Page 41: Ashawr perf kscope

SQL Results

• SQL_ID, SQL Text, Sample Time that Process was captured in.

Page 42: Ashawr perf kscope

Tyler Muth ASH Mining Query

Page 43: Ashawr perf kscope

ASH Mining Output

Additional Options:•Physical Read Averages•Physical Writes, (Max/Averages)•Redo Info•Logon Info•Hard Parsing, etc.

Page 44: Ashawr perf kscope

Best Practice When Querying ASH Data

Keep it Simple and don’t reinvent the wheel. Samples are an alias for time, not for counts. Understand what is valuable and compare to

packaged reports. Be aware on RAC of node specific data. Take care when querying Obj#, File# and

Block#, (still issues in different versions…) Check the time that is available in buffer, don’t

assume!

Page 45: Ashawr perf kscope

AWR/ASH Links/Blogs

Karl Arao: http://karlarao.wordpress.com Tyler Muth: http://tylermuth.wordpress.com/ Kyle Hailey, John Beresniewicz, Graham Wood:

http://ashmasters.com/ Mine- “For the Love of ASH and AWR”

http://dbakevlar.com/2011/02/for-the-love-of-awr-and-ash/

Page 46: Ashawr perf kscope

Thank you!http://enkitec.com

http://dbakevlar.com

[email protected]

[email protected]

Twitter: @dbakevlar

Linkedin/Facebook: Kellyn Pot’Vin