1 06/05/08 Statspack Kyle Hailey

Slides:



Advertisements
Similar presentations
Office of the Accountant General (A&E) Andhra Pradesh Hyderabad
Advertisements

9 Copyright © 2006, Oracle. All rights reserved. Automatic Performance Management.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
1 Wait Event Enhancements in Oracle 10g Terry Sutton and Roger Schrag Database Specialists, Inc.
IO Waits Kyle Hailey #.2 Copyright 2006 Kyle Hailey Waits Covered in this Section  db file sequential read  db file scattered.
Enqueue Waits : Locks. #.2 Copyright 2006 Kyle Hailey Wait Tree - Locks Waits Disk I/O Library Cache Enqueue Undo TX 6 Row Lock TX 4 ITL Lock HW Lock.
Enqueue Waits : Locks. #.2 Copyright 2006 Kyle Hailey Locks REDO Lib Cache Buffer Cache IO Locks Network.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Oracle High Availability Solutions RAC and Standby Database Copyright System Managers LLC 2008.
1 Chapter 16 Latch and Mutex Contention. 2 Architecture Overview of Latches Protect Oracle’s SGA Prevent two processes from updating same area of SGA.
Buffer Cache Waits. #.2 Copyright 2006 Kyle Hailey Buffer Cache Waits Waits Disk I/O Buffer Busy Library Cache Enqueue SQL*Net Free Buffer Hot Blocks.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Performance And Tuning – Lecture 7 Copyright System Managers LLC 2007 all rights reserved.
Jonathan Lewis jonathanlewis.wordpress.com
Oracle 10.2 for z/OS and z/Linux Performance Update.
The Self-managing Database: Automatic Performance Diagnosis Graham Wood Kyle Hailey Oracle Corporation Session id:
Understanding Storage’s Impact on Oracle Performance Jamon Bowen Texas Memory Systems.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Oracle 10g Database Administrator: Implementation and Administration Chapter 14 Proactive Maintenance.
Redo Waits Kyle Hailey #.2 Copyright 2006 Kyle Hailey Redo REDO Lib Cache Buffer Cache Locks Network I/O.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
Average Session Load (ASL) The Golden Metric ? Kyle Hailey
Waits Defined Kyle Hailey #.2 Copyright 2006 Kyle Hailey Top 36 Foreground Waits write complete waits library cache.
1 Copyright © 2009, Oracle. All rights reserved. Exploring the Oracle Database Architecture.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Michael Sit Solution Specialists Manager Oracle Corporation.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Part II : Waits Events Kyle Hailey
Chapter 20 Other Memory Management Topics
1 Using Statspack in Oracle8i and 9i to Identify Problems Ian Jones Database Specialists, Inc.
Performance Diagnostics using STATSPACK data 18-May 2006 Tim Gorman SageLogix, Inc. N. CA Oracle Users Group.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
15 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Summary.
Achieving Scalability, Performance and Availability on Linux with Oracle 9iR2-RAC Grant McAlister Senior Database Engineer Amazon.com Paper
How STATSPACK Was Used to Solve Common Performance Issues Brian Hitchcock OCP 8, 8i, 9i DBA Sun Microsystems
Outline Introduction to Oracle Memory Structures SGA, PGA, SCA The Specifics of the System Global Area (SGA) Structures Overview of Program Global Areas.
Oracle 10g Advanced Performance Tuning Kyle Hailey Delphix - wait events docs – tools S-ASH.
Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey
#.6 Sampling Kyle Hailey
Oracle 10g Advanced Performance Tuning Kyle Hailey - wait events docs – tools S-ASH and.
10G - New Manageability Features Presented by Lenka Vanek
Monitoring and Tuning Oracle for z/OS and Oracle for z/Linux.
#.1 SASH – Simulated ASH and other tools. #.2 OEMDB Optimizer Lab 128SASH performance$100,000$1500$500free SQL Tuning$100,000includedN/A Both$200,000$1500N/A.
Preface 1Performance Tuning Methodology: A Review Course Structure 1-2 Lesson Objective 1-3 Concepts 1-4 Determining the Worst Bottleneck 1-5 Understanding.
#.1 Average Active Sessions (AAS) The Golden Metric ? Kyle Hailey
Oracle9i Performance Tuning Chapter 4 Tuning the Shared Pool Memory.
OEM 10g Performance and Tuning. #.2 Copyright 2006 Kyle Hailey Performance SQL Diagnostics SQLTuning Performance Session DB HOME.
SQL*Net & Other Waits. #.2 Copyright 2006 Kyle Hailey SQL*Net Waits Session Shadow Log Buffer Buffer Cache Log Buffer Buffer Cache SGA Library Cache Host.
8 Copyright © 2006, Oracle. All rights reserved. Tuning the Shared Pool.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1.
Same Plan Different Performance Mauro Pagano. Consultant/Developer/Analyst Oracle  Enkitec  Accenture DBPerf and SQL Tuning Training Tools (SQLT, SQLd360,
I NTRODUCTION OF W EEK 2  Assignment Discussion  Due this week:  1-1 (Exam Proctor): everyone including in TLC  1-2 (SQL Review): review SQL  Review.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Database Architectural Components
Performance Tuning Methodology Approach to Attacking Oracle Performance Problems.
1 PVSS Oracle scalability Target = changes per second (tested with 160k) changes per client 5 nodes RAC NAS 3040, each with one.
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
DB Issue Trouble Shooting Guideline
How STATSPACK Was Used to Solve Common Performance Issues
Oracle 11g Real Application Clusters Advanced Administration
Oracle Memory Internals
RAC Performance Lab.
Index Index.
Database administration
Presentation transcript:

1 06/05/08 Statspack Kyle Hailey

Kyle Hailey Brief History  Weakness of Ratios  Ratio based guess work – no waits  Utlbstat/Utlestat  Lists of rules – no global picture/perspective  Power of Waits  Time gains and losses clear  Undocumented  “Expert Only”  Statspack  Top 5 Wait Events  Filtered out Idle Events  Compulsive Tuning Disorder  iR2 CPU  Top 5 Timed Events (includes CPU)  Response Time = Service Time (CPU) + Wait Time  g Simplicity of AAS  Average Active Session (AAS) = DB Time / Elapsed Time  g SQL Row Source Counters Timings Sampling

V6 Problem  How do you shorten your daily commute?  Analyze Statistics ?  RPM  Number of rotations of wheels?  Average amount of gas in tank? No ! Solution :  Analyze Time  Where do you get blocked?  Are there alternatives ? Oracle 6 didn’t have wait times, but you do !

Ratios, Example v6  Wait timings unavailable for IO  Db file sequential read  Db file scattered read  Direct path read  Ratio : Cache Buffer Hit  proxy for IO wait time  Unreliable  High ratio  Bad – untuned SQL doing mega LIOs  Low ratio  Good - I/Os are coming from UNIX file cache or disk cache Reliability: IO Wait Times 06/05/08 Wait Events replaced Ratios !

Oracle 7  Waits introduced in version 7  Quantum Step  1992 slipped in for a benchmark  by kernel architect (now Senior VP) Juan Loaiza in 1992  Benchmark couldn’t find where time was being spent  Wait instrumentation solved the mystery  Originally Undocumented  Still badly documented course should help change that  Experts only Thus, ratio based tuning dominated 06/05/08

Copyright 2006 Kyle Hailey Oracle Instrumentation Database: Guilty until proven innocent Redo Lib Cache Buffer Cache IO Locks Network CPU Database

Statspack Introduced in by Connie Dialeris  Snapshots  Selects from 55 tables and views  x$ structures  v$ views  DBA views  Number of tables has expanded with each version  30 plus tables in Oracle8i  40 plus tables in Oracle9i  55 plus tables in Oracle10g  Calculates Deltas (and ratios)  Reports lines output, about 30 pages 2006 Kyle Hailey

Copyright 2006 Kyle Hailey Statspack: Cheat Sheet  Install  Connect as SYSDBA  Run  Exec statspack.snap;  Generate Reports  (AWR )

Statspack Sections (10g) Instance description Host hardware Snapshot headline Cache information Load profile Instance efficiency Shared pool stats Top timed events Host CPU load Host / Instance CPU warning VM activity Memory usage Time model stats RAC statistics All wait events Background wait events Event histogram SQL x 9 Instance activity Log switches OS stats Latch parent and child Mutex Segment stats x 8 Dictionary cache Library cache RAC (GES) RAC (CR and CUR served) RAC (cache xfer x 2) RAC (Remastering) Streams x 7 Shared pool advisor Java pool advisor SGA resizing SGA target advisor SGA summary SGA detail SQL memory summary Resource limits Parameters Session details x 3 Tablespace I/O File I/O File I/O histogram Buffer pool Instance Recovery Buffer pool advisory Buffer busy waits Various PGA summaries PGA histogram PGA advisory PGA allocation summary PGA allocation top N Enqueue (lock) activity Undo stats x 2 Latch activity Latch miss details

Statspack Method Statspack Method 06/05/08 Load profile good for having a feel for the application and comparing two periods for changes Efficiency ratios misleading carry over from version 6 days Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Call Time buffer busy waits 2, CPU time free buffer waits 1, write complete waits log buffer space Summary Waits Who/When Big Picture

Oracle 8 06/05/08 Top 5 Wait Events ~~~~~~~~~~~~~~~~~ Wait % Total Event Waits Time (cs) Wt Time direct path read 4,232 10, db file scattered read 6,105 6, direct path write 1,992 3, control file parallel write db file parallel write Statistic Total per Second per Trans CPU used by this session 358, ,372.6 Missing the CPU CPU time = 95% Eliminating all IO gains 3 % ! IO Looks horrible, but wait … Total time in secs = = /3792=95% 108/3792=3%

Oracle 9 06/05/08  Statspack adds CPU  Method  % wait time = potential performance gain Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Ela Time CPU time 8, direct path write 1, db file scattered read 4, direct path read db file parallel write Max gain is 6.22% by tuning all waits In other words go tune the top SQL % gain = Savings/Service Time Service Time = CPU time + Wait Time Service Time =DB Time in 10g

Problems in 9 1.Lack of Data to solve issues Examples 1.Buffer busy wait 2.latch free 3.db file scattered read (IO) 4.Enqueue (lock)

Buffer Busy Wait 06/05/08 Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Call Time buffer busy waits 2, CPU time free buffer waits 1, write complete waits log buffer space Buffer Busy Wait – trying to modify a block a buffer. Who blocks, what kind of buffer, what is the SQL? Buffer wait Statistics DB/Inst: DB4/db4 Snaps: 2-3 Class Waits Wait Time (s) Avg Time (ms) file header block data block 6, undo header Statspack fails for analysis

Latch Free 06/05/08 Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Ela Time latch free 9, CPU time PL/SQL lock timer SQL*Net message from dblink log file parallel write What Latch? There are 100s Latch Sleep breakdown for DB: CDB Instance: cdb Snaps: > ordered by misses desc Sleeps Latch Name Requests Misses Sleeps Sleeps 1-> cache buffers chains 8,448, ,484 6,930 0/0/0/0/0 library cache pin 8,405,896 82,915 1, /1330/4 7/1/0 library cache 8,435,488 55,645 1, /1247/2 2/1/0 shared pool 58, /1/0/0/0

IO 06/05/08 Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Ela Time db file scattered read 7, CPU time db file sequential read control file sequential read control file parallel write Are the disks slow? What files? Is the buffer cache too small? IO – what SQL? 5/7549=0.6ms Very fast Problem is SQL

IO 06/05/08 Is the buffer cache too small? IO – what SQL? File IO Stats for DB: ORA9 Instance: ora9 Snaps: Tablespace Filename Av Av Av Av Av Buffer Av Buf Rd(ms) Reads Reads/s Rd(ms) Blks/Rd Writes Writes/s Waits Wt(ms) EXAMPLE D:\ORACLE\ORADATA\ORA9\EXAMPLE01.DBF SYSTEM D:\ORACLE\ORADATA\ORA9\SYSTEM01.DBF 0.7 8, UNDOTBS1 D:\ORACLE\ORADATA\ORA9\UNDOTBS01.DBF Are the disks slow? What files? < 10ms

IO 06/05/08 IO – what SQL? Buffer Pool Advisory for DB: ORA9 Instance: ora9 End Snap: 22 Size for Size Buffers for Est Physical Estimated P Estimate (M) Factr Estimate Read Factor Physical Reads D ,973 D , ,668 D , ,612 D , ,612 D , ,612 D , ,612 D , ,132 D , ,132 D , ,132 Is the buffer cache too small?

IO 06/05/08 Sorted by Reads, not Time (reads proxy for IO wait time) SQL ordered by Reads for DB: ORA9 Instance: ora9 Snaps: CPU Elapsd Physical Reads Executions Reads per Exec %Total Time (s) Time (s) Hash Value , , Module: SQL*Plus select count(*) from sys.source$ Module: SQL*Plus select count(*) from all_objects select t.schema, t.name, t.flags, q.name from system.aq$_queue_t ables t, sys.aq$_queue_table_affinities aft, system.aq$_que What SQL?

Row Locks 10g+ 06/05/08 op 5 Timed Events Avg %Total ~~~~~~~~~~~~~~~~~~ wait Call Event Waits Time (s) (ms) Time enq: TX - row lock contention PL/SQL lock timer CPU time buffer busy waits 1, log file parallel write Who is waiting Who is blocking What is the SQL What is the row?

2110/26/2015 Current Method  1000 lines of data / 30 pages  What do you look at ?  Top 5 Timed Events? Top 5 Timed Events ~~~~~~~~~~~~~~~~~~ % Total Event Waits Time (s) Ela Time CPU time 11, log file sync 163,725 1, enqueue 4, latch free 28, db file sequential read 1,420, Jonathan Lewis minutes CPU Elapsed 15 minutes 48 Processors or 74% idle

Statspack Top 5 Timed Events missing  CPU Count  Elapsed Time  As well as drill down diagnostic data Take a step back, take deep breath, and start over  Start with Typical Problems  Identify Solutions  Design a Visual Representation  Put intelligence into the interface 06/05/08

OEM 10g Simple, Powerful Database Load Load Source: SQL Session Wait