Taming the AWR Tsunami

Similar documents
Using Automatic Workload Repository for Database Tuning: Tips for Expert DBAs. Kurt Engeleiter Product Manager

OracleMan Consulting

PERFORMANCE TUNING TRAINING IN BANGALORE

Oracle Database 11g: Performance Tuning DBA Release 2

Oracle Database 11g: Performance Tuning DBA Release 2

Oracle Database 12c Performance Management and Tuning

EZY Intellect Pte. Ltd., #1 Changi North Street 1, Singapore

Oracle 10g Self-Management Framework Internals: Exploring the Automatic Workload Repository. Open World September 2005

Oracle Database 11g : Performance Tuning DBA Release2

Oracle Database 12c: Performance Management and Tuning

Oralogic Education Systems

Learning Objectives : This chapter provides an introduction to performance tuning scenarios and its tools.

Katharina Römer Principal Sales Consultant STCC Stuttgart ORACLE Deutschland GmbH

<Insert Picture Here> DBA Best Practices: A Primer on Managing Oracle Databases

11gR2 Performance. Tuning Cookbook. Oracle Database. 1 enterprise J. performance from Oracle Database applications. achieve better

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Oracle Exam 1z0-054 Oracle Database 11g: Performance Tuning Version: 5.0 [ Total Questions: 192 ]

Oracle 1Z0-054 Exam Questions and Answers (PDF) Oracle 1Z0-054 Exam Questions 1Z0-054 BrainDumps

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

Identify and Eliminate Oracle Database Bottlenecks

Anthony AWR report INTERPRETATION PART I

Oracle EXAM - 1Z Oracle Database 11g: Performance Tuning. Buy Full Product.

In the Oracle Database 12c: Performance Management and

End-to-end Management with Grid Control. John Abrahams Technology Sales Consultant Oracle Nederland B.V.

<Insert Picture Here> DBA s New Best Friend: Advanced SQL Tuning Features of Oracle Database 11g

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

1Z Oracle Database Performance and Tuning Essentials 2015 Exam Summary Syllabus Questions

Oracle 1Z Oracle Database 11g Performance Tuning.

2010 (c)2013 OraPub, Inc. This presentation was given by Craig Shallahamer at the NoCOUG conference on 15-AUG-2013.

Oracle 1Z0-417 Exam Questions and Answers (PDF) Oracle 1Z0-417 Exam Questions 1Z0-417 BrainDumps

Automatic Workload Repository: Soup to Nuts. Graham Wood Doug Burns

Essential (free) Tools for DBA!

Toad for Oracle Suite 2017 Functional Matrix

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

Custom Performance Reporting Changes in Oracle 10g. Brian Doyle BEZ Systems VP, Product Service

Oracle Database 12c: Administration Workshop Ed 2

Advanced Oracle Troubleshooting Live Session. Randolf Geist

Oracle Database 11g: SQL Tuning Workshop

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

Oracle Performance Tuning. Overview of performance tuning strategies

Oracle Database 12c: Administration Workshop Ed 2 NEW

OpenWorld 2018 SQL Tuning Tips for Cloud Administrators

Tuna Helper Proven Process for SQL Tuning. Dean Richards Senior DBA, Confio Software

RAC Performance Monitoring and Diagnosis using Oracle Enterprise Manager. Kai Yu Senior System Engineer Dell Oracle Solutions Engineering

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Tuning slow queries after an upgrade

Oracle Database 12c: Administration Workshop Ed 2

Introduction. Assessment Test. Chapter 1 Introduction to Performance Tuning 1. Chapter 2 Sources of Tuning Information 33

Oracle Database 10g The Self-Managing Database

Using Oracle STATSPACK to assist with Application Performance Tuning

Oracle Tuning. Ashok Kapur Hawkeye Technology, Inc.

Oracle Database 12c: Administration Workshop Duration: 5 Days Method: Instructor-Led

Session id: The Self-Managing Database: Guided Application and SQL Tuning

Oracle Database 11g: Self-Managing Database - The Next Generation

Course Outline: Oracle Database 11g: Administration II. Learning Method: Instructor-led Classroom Learning. Duration: 5.

Oracle Database 10g: New Features for Administrators Release 2

Resource Mapping A Wait Time Based Methodology for Database Performance Analysis

Addressing a Performance issue The drilldown approach. Laurent Léturgez

Taming Banner 7 on Oracle 10g

IT100: Oracle Administration

Exam Name: Oracle Database 11g: Performance Tuning

Oracle 11g Optimizer Statistics Inderpal S. Johal. Inderpal S. Johal, Data Softech Inc.

DB2 is a complex system, with a major impact upon your processing environment. There are substantial performance and instrumentation changes in

Demystifying SQL Tuning: Tips and Techniques for SQL Experts

Oracle Database 11g: SQL Fundamentals I

1z0-064.exam.57q. Number: 1z0-064 Passing Score: 800 Time Limit: 120 min File Version: 1. Oracle 1z0-064

<Insert Picture Here>

Oracle 1Z Upgrade Oracle9i/10g OCA to Oracle Database 11g OCP. Download Full Version :

Oracle Database Performance Tuning

Copyright 2013, Oracle and/or its affiliates. All rights reserved.

CHAPTER. Overview of STATSPACK

(10393) Database Performance Tuning Hands-On Lab

Oracle Database 12c Administration Workshop

1Z Upgrade to Oracle Database 12cm Exam Summary Syllabus Questions

Performance Monitoring

Internals of Active Dataguard. Saibabu Devabhaktuni

AMON User's Guide. Author: Andrej Simon Creation date: 11-Mar-2009 Last changed: 11-Aug-2010 AMON Version: 0.32

Performance Problems

1 Dulcian, Inc., 2001 All rights reserved. Oracle9i Data Warehouse Review. Agenda

1z0-062.exam.215q 1z0-062 Oracle Database 12c: Installation and Administration

Understanding and Leveraging the Oracle9i Advisories. Azeem Mohamed Product Marketing Manager Quest Software

IT-Tage Dezember 2016 Frankfurt am Main Maritim Hotel

Oracle Database 12c R2: Administration Workshop Ed 3 NEW

Vijay Mahawar

Oracle Database 11g: Administration Workshop II

Oracle Database 12c R2: Administration Workshop Ed 3

Addressing a performance issue: the drilldown approach

Advanced Oracle SQL Tuning v3.0 by Tanel Poder

Course Contents of ORACLE 9i

Long- term and Cross- database Performance Analysis for DBAs

How Can I Tune it if I Can t Change the Code

Database Performance Analysis Techniques Using Metric Extensions and SPA

Oracle Database 11g: Real Application Testing & Manageability Overview

Moving Databases to Oracle Cloud: Performance Best Practices

Common Performance Monitoring Mistakes

Optimizing Database I/O

Demystifying WORKLOAD System Statistics Gathering

Qlik Sense Performance Benchmark

Oracle DBA Course Content

DOAG Conference Edition. Marco Mischke, Experts for database solutions.

Transcription:

Taming the AWR Tsunami Roger Cornejo roger.d.cornejo@gsk.com Raleigh/Durham, NC November 6, 2013

Roger Cornejo Speaker Background Computer Science degree (Rutgers Univ.) Working with Oracle over 28 years (since V4) Building/supporting large database applications 1000 s of tuning opportunities Professional presentations: Benchmarking Data Integration Performance Tuning Bag-of-Tricks 2

Outline Taming the AWR Tsunami AWR Introduction How to Use AWR Data Tuning Methodology In Practice (examples) Exploring AWR data (deeper dive) Advanced topics Questions Zip file to be posted eastcoastoracle.org 3

AWR Introduction: Can I use AWR? ; Licensing requirements Diagnostics Pack 11g parameter to determine if licensed show parameter control_management_pack_access 10g tracked externally Is AWR running on this DB? 10g: Scheduled job: select * from dba_scheduler_jobs where job_name = 'GATHER_STATS_JOB'; Note: Could be running, but not licensed => don t use it if not licensed 11g: 3 standard processes in the auto task window -- Gather stats, segment space advisor and sql tuning advisor. select * from dba_autotask_operation; 4

AWR Introduction: Why use AWR? Identify Root Cause of performance problems Quantify the root cause quickly AWR Overcomes issues with timing of monitoring Investigate past performance issues instead of limiting ourselves to present moment monitoring (V$ views) AWR is Superior to StatsPack AWR has stats on session Has other stats not in StatPack 5

AWR Introduction: What s in AWR? Automated Workload Repository Gathers and persists performance metrics DBA_HIST Views: 78 in 10g 111 in 11g Sessions: SQL, waits, blockers, Workload metrics (e.g. IO; Memory; CPU; ) Object Statistics (e.g. Library Cache; File; Temp; Undo; Latches; Segments; Tablespace; ) Standard Tools: AWR, ASH, ADDM, Reports AWR report consists of dozens of sections; can contain a 100 screens of data or more How do we make sense of all this information? 6

How to Use AWR Data: Methodical Tuning Approach 7

How to Use AWR Data: Methodical Tuning Approach Identify What application issue? [Talk to the user] Error? Time? Duration? Instance? User? Module? Don t solve the wrong problem! Quantify [using AWR tools and data] Gather information from AWR that applies to ID d problem Analyze [your experience along with ADDM Report] Analyzing SQL by examining: execution plan; table cardinality (size / # rows); waits; root cause known / hypothesized Tune [Implement Tuning solutions] Test/Evaluate Monitor over time using AWR Data 8

Taming the AWR Tsunami: Case Studies 9

Case Study 1: Long Running Process Alert e-mail Identify Problem: Long Running Process Alert e-mail Instance: UKPRD662 Connect Username: GWDMPR61 Other: connect time, SQL Id s, session id s reported 10

Case Study 1: Long Running Process Alert e-mail Quantify get the snap_id s from AWR dba_hist_snapshot snap_id from start of the interval snap_id from the end of the interval Note and use these snap_id s: to subset the AWR data in subsequent analysis 11

Case Study 1: Long Running Process Alert e-mail Quantify - SQL AWR - Expensive SQL for a snap_id.sql 12

Case Study 1: Long Running Process Alert e-mail Analyze: Query from DBA_HIST_SQLTEXT 13

Case Study 1: Long Running Process Alert e-mail Analyze: Execution Plan from DBA_HIST_SQL_PLAN dbms_xplan.display_awr( &SQLID ) 14

Case Study 1: Long Running Process Alert e-mail Analyze / Tune 15

Case Study 1: Long Running Process Alert e-mail Test/Evaluate Tuned version ran in 3 ½ minutes 16

Case Study 1: Long Running Process Alert e-mail Monitor over time 17

Taming the AWR Tsunami: Case Studies 18

Case Study 2: Client Application slow - times out Identify Problem: Client Application slow and times out, usually with large dataset Client error: "Requested operation failed connection timed out". Instance: USPRD775 Connect Username: DESIGNER Time and Interval: random / not specific 19

Case Study 2: Client Application slow - times out Quantify Load (from standard AWR Report) Load appears to be low So let s look at what SQL is taking the longest time: 20

Case Study 2: Client Application slow - times out Quantify Slow SQL (from standard AWR Report) Sql_id: dqhvxwd29jsqg Time per execution: 92 sec 21

Case Study 2: Client Application slow - times out Analyze AWR - sqlid profile.sql Execution Plan: Full scan of index on 10 Gb table Aggregate Events: Most waits on db file scattered read Same index 22

Case Study 2: Client Application slow - times out Analyze Load is low; plenty of capacity on machine/db Vendor correlated Slow Sql with the application function Tune on vendor to-do list for next version Test/Evaluate N/A Monitor over time Monitor via DBA_HIST_SQLSTAT 23

Taming the AWR Tsunami: Case Studies 24

Case Study 3: Batch Jobs for Sales Force App. Identify Problem: Daily job takes several hours to execute; delays other job processing Interval: runs between 1:30 AM and 5:30 AM (approximately; kicked off by prior job) Instance: USPRD661 Connect Username: CRM_CH Code/Module: PrmMy0014Calc.exe; runs from 4 separate sessions simultaneously Table: Bpldata and others (user does not have SQL) Basic flow: fetches the data using select queries; performs a calculation; updates the tables with the calculated values. 25

Case Study 3: Batch Jobs for Sales Force App. Quantify Load (from standard AWR Report) Load seems to be ok / low 26

Case Study 3: Batch Jobs for Sales Force App. Quantify Load using AAS Average Active Sessions.sql This confirms that the load is not a problem. So now I want to know some more details about the load to see if that can help me focus in on the root cause. 27

Case Study 3: Batch Jobs for Sales Force App. Quantify Load details (from standard ASH Report) 73% db activity this module 85% of db activity is select 28

Case Study 3: Batch Jobs for Sales Force App. Quantify Waits (from standard AWR Report) 29

Case Study 3: Batch Jobs for Sales Force App. Quantify SQL (from standard ASH report) 30

Case Study 3: Batch Jobs for Sales Force App. Analyze Load is low (never more that 50%) Minor log file related waits App does not make use of bind variables Big issue is I/O on 14 gig table BPLDATA Vendor indicated fragmentation and row chaining High row chaining reads confirmed by looking in dba_hist_sysstat.stat_name = 'table fetch continued row Standard ADDM Report: DBA_HIST_SGA_TARGET_ADVICE 31

Case Study 3: Batch Jobs for Sales Force App. Tune Increase log file size Re-organize or cluster BPLDATA Test/Evaluate (in progress w/ application team) Monitor over time DBA_HIST_SYSTEM_EVENT Event: log file synch 32

Method Recap Taming the AWR Tsunami 1] Identify Problem 2] Quantify using AWR 3] Analysis 4] Tune 5] Test/Evaluate 6] Monitor 33

Tools Recap Taming the AWR Tsunami Quantify Load: Operating System Stats of Standard AWR Average Active Sessions script ASH report Quantify Wait events - standard AWR Report Quantify SQL ASH and AWR Report custom script querying DBA_HIST_SQLSTAT Custom Quantifying of row chaining reads from DBA_HIST_SYSSTAT table fetch continued row statistic Analysis - ADDM report Monitor over time with some custom scripts 34

Exploring AWR Data Taming the AWR Tsunami 35

Exploring AWR Data: Metrics vs Statistics Metric Value in that period e.g.: DBA_HIST_ SYSMETRIC_SUMMARY Statistic Cumulative value e.g.: DBA_HIST_ SYSTEM_EVENT & SYSSTAT Use analytic functions: LAG compute deltas values ROW_NUMBER e.g. Top-n Events script RATIO_TO_REPORT % of total 36

Exploring AWR Data: Comparison of Views V$ Views StatsPack Views AWR Views V$_SYNONYM_NAME STATS$_SYNONYM_NAME DBA_HIST_SYNONYM_NAME V$SESSION DBA_HIST_ACTIVE_SESS_HISTORY V$SESSION_EVENT DBA_HIST_ACTIVE_SESS_HISTORY V$DATAFILE DBA_HIST_DATAFILE V$DB_CACHE_ADVICE STATS$DB_CACHE_ADVICE DBA_HIST_DB_CACHE_ADVICE V$FILESTAT STATS$FILESTATXS DBA_HIST_FILESTATXS V$LATCH_PARENT STATS$LATCH_PARENT DBA_HIST_LATCH_PARENT V$LIBRARYCACHE STATS$LIBRARYCACHE DBA_HIST_LIBRARYCACHE V$LOG DBA_HIST_LOG V$OSSTAT STATS$OSSTAT DBA_HIST_OSSTAT V$PARAMETER STATS$PARAMETER DBA_HIST_PARAMETER V$SGA STATS$SGA DBA_HIST_SGA V$SQLSTATS STATS$SQL_SUMMARY DBA_HIST_SQLSTAT V$SQLTEXT STATS$SQLTEXT DBA_HIST_SQLTEXT V$SQL_PLAN STATS$SQL_PLAN DBA_HIST_SQL_PLAN V$SYSMETRIC_SUMMARY DBA_HIST_SYSMETRIC_SUMMARY V$SYSSTAT STATS$SYSSTAT DBA_HIST_SYSSTAT V$SYS_TIME_MODEL STATS$SYS_TIME_MODEL DBA_HIST_SYS_TIME_MODEL Jumpstart AWR data exploration: Leverage wealth of knowledge of v$ views 37

Exploring AWR Data: Key DBA_HIST Views DBA_HIST_SNAPSHOT Maps a snap_id to the Date/Time DBA_HIST_SQLSTAT Statistics on all SQL statements picked up by the DB Use this to find the Expensive SQL DBA_HIST_ACTIVE_SESS_HISTORY All the sessions and what they were running Samples rolled up every 10 seconds DBA_HIST_SYSMETRIC_SUMMARY (135 10g -158 11g) Various metrics (response time, I/O, ) 38

Tracking Measurements Over Time AAS Average Active Sessions.sql Uses: dba_hist_sysmetric_summary.metric_name: 'Average Active Sessions' 'Host CPU Utilization (%) ' 'Database CPU Time Ratio' 'Database Wait Time Ratio' 39

Tracking Measurements Over Time Load metrics - I/O Workload <query in sql script> AWR - dba_hist_sysmetric_summary - various metrics.sql Physical Read Total Bytes Per Sec Physical Write Total Bytes Per Sec 40

Tracking Measurements Over Time Load metrics - Workload volume/throughput <query in script> AWR - dba_hist_sysmetric_summary - various metrics.sql Network Traffic Volume Per Sec 41

Tracking Measurements Over Time AWR - Top-n waits by snap_id.sql Top-n events pivoted on Event Name <instructions in code> 1. Generate code fragments 2. Edit into pivot template graphing db file scattered read / db file sequential read 42

Tracking Measurements Over Time SQL statistics - AWR - Expensive SQL for a snap_id.sql 43

Tracking Measurements Over Time 44

Fun stuff Taming the AWR Tsunami 45

All the SQL associated with an event ASH SQL for SnapId - event.sql Usage Scenario: Have the event name from Top-n waits, but would like to know what SQL is causing that and to what extent Example execution with: direct path read temp 46

Sessions that were Blocked by other Sessions ASH - Blocked Sessions.sql Usage Scenario: App slow, but SQL seemed tuned. Found blocker and related info: Duration; sql_text of Blocked User; Blocker sid/event/sql_id; sql_text 47

Get all the SQL that involve a particular Object AWR - sql and plan for an object.sql Usage Scenario: High I/O on a particular table or index What other SQL hits that same object? 48

Reverse Engineering an AWR Report AWR - Report Queries.sql Usage Scenario: Data for Load Profile Section of AWR Report 49

Taming the AWR Tsunami Roger Cornejo roger.d.cornejo@gsk.com 50