Workload Insights Without a Trace - Introducing DB2 z/os SQL tracking SOFTWARE ENGINEERING GMBH and SEGUS Inc. 1

Similar documents
DB2 10 Capturing Tuning and Trending for SQL Workloads - a resource and cost saving approach

DB2 10 Capturing Tuning and Trending for SQL Workloads - a resource and cost saving approach. Roy Boxwell SOFTWARE ENGINEERING GmbH

DB2 11 Capturing Tuning and Trending for SQL Workloads - a resource and cost saving approach. Ulf Heinrich SEGUS Inc

Can I control a dynamic world? - Dynamic SQL Management for DB2 z/os

DB2 and Memory Exploitation. Fabio Massimo Ottaviani - EPV Technologies. It s important to be aware that DB2 memory exploitation can provide:

Collecting Cached SQL Data and Its Related Analytics. Gerald Hodge HLS Technologies, Inc.

Dynamic SQL Re-Examined

An A-Z of System Performance for DB2 for z/os

What Developers must know about DB2 for z/os indexes

The Present and Future of Large Memory in DB2

DB2 Performance A Primer. Bill Arledge Principal Consultant CA Technologies Sept 14 th, 2011

What it does not show is how to write the program to retrieve this data.

[Slide 2: disclaimer]

To REORG or not to REORG That is the Question. Kevin Baker BMC Software

Memory for MIPS: Leveraging Big Memory on System z to Enhance DB2 CPU Efficiency

Foreword Preface Db2 Family And Db2 For Z/Os Environment Product Overview DB2 and the On-Demand Business DB2 Universal Database DB2 Middleware and

IDAA v4.1 PTF 5 - Update The Fillmore Group June 2015 A Premier IBM Business Partner

Don t Let ICIs put your DB2 applications in the ICU!

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

Vendor: IBM. Exam Code: Exam Name: IBM Certified Database Administrator - DB2 10 for z/os. Version: Demo

Quest Central for DB2

DB2 12 for z/os: Technical Overview and Highlights

DB2 11 for z/os Application Functionality (Check out these New Features) Randy Ebersole IBM

Westfield DB2 z/os System Management

Best Practices. Deploying Optim Performance Manager in large scale environments. IBM Optim Performance Manager Extended Edition V4.1.0.

V9 Migration KBC. Ronny Vandegehuchte

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

This is the forth SAP MaxDB Expert Session and this session covers the topic database performance analysis.

Built in Function. BIF Compatibility. A german customer presentation translated and anonymized. by Siegfried Fürst SOFTWARE ENGINEERING GmbH

DB2 for z/os in the Big Memory Era

Key Metrics for DB2 for z/os Subsystem and Application Performance Monitoring (Part 1)

Db2ZAI Machine Learning in Db2 for z/os

IBM Application Performance Analyzer for z/os Version IBM Corporation

Presentation Abstract

The Present and Future of Large Memory in DB2. Jay Yothers DB2 for z/os Development, IBM

Click to edit the title text format

Oracle Database 10g The Self-Managing Database

Db2 for z/os: Lies, Damn lies and Statistics

Db2 V12 Gilbert Sieben

DB2 9 for z/os Selected Query Performance Enhancements

Enhanced Monitoring Support in DB2 10 for z/os

Paging algorithms. CS 241 February 10, Copyright : University of Illinois CS 241 Staff 1

Where s the BiF?? Roy Boxwell, Senior Software Architect, Software Engineering GmbH SEGUS Inc and SOFTWARE ENGINEERING GMBH

Optimizing Insert Performance - Part 1

With the growth of data, the reduction in of DBA staffing, tight budgets, and the business goal to be 24x7 it is becoming more important to automate

What's New with CA DB2 Tools

Query Store What s it all about?

Key Metrics for DB2 for z/os Subsystem and Application Performance Monitoring (Part 1)

Vendor: IBM. Exam Code: C Exam Name: DB2 10 System Administrator for z/os. Version: Demo

IBM DB2 11 DBA for z/os Certification Review Guide Exam 312

Performance 101 for DB2 for LUW

CA Unified Infrastructure Management Snap

Efficient Monitoring & Tuning of Dynamic SQL

Rdb features for high performance application

DB2 for z/os Tools Overview & Strategy

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Performance Monitoring

DB2 10 for z/os Technical Overview

Cloning - What s new and faster?

Workload Management for an Operational Data Warehouse Oracle Database Jean-Pierre Dijcks Sr. Principal Product Manager Data Warehousing

Where are we in the course?

DB2 11 and Beyond Celebrating 30 Years of Superior Technology

Page Replacement. (and other virtual memory policies) Kevin Webb Swarthmore College March 27, 2018

Oracle Database 12c Performance Management and Tuning

Reminder: Mechanics of address translation. Paged virtual memory. Reminder: Page Table Entries (PTEs) Demand paging. Page faults

Session: E01 E02 What Every DBA Should Know About Dynamic SQL

Collecting DB2 Metrics in SMF Part 3

SEGUS Inc DB2 z/os tools

DB2 9 for z/os V9 migration status update

DB2 10 for z/os Technical Update

Deep Dive Into Storage Optimization When And How To Use Adaptive Compression. Thomas Fanghaenel IBM Bill Minor IBM

TUC TOTAL UTILITY CONTROL FOR DB2 Z/OS. TUC Unique Features

Stored Procedure Monitoring and Analysis

Chapter 9: Virtual Memory

WMQ for z/os Auditing and Monitoring

The Modern Mainframe At the Heart of Your Business

End to End Analysis on System z IBM Transaction Analysis Workbench for z/os. James Martin IBM Tools Product SME August 10, 2015

Db2 12 A new spin on a successful database

Development in a Virtualized Production Environment

Expert Stored Procedure Monitoring, Analysis and Tuning on System z

DB2 z/os Audit using SQL Workload Expert for DB2 z/os

Modern DB2 for z/os Physical Database Design

Build a system health check for Db2 using IBM Machine Learning for z/os

Control your own destiny with Optimization Hints

Optimising Insert Performance. John Campbell Distinguished Engineer IBM DB2 for z/os Development

IBM DB2 LUW Performance Tuning and Monitoring for Single and Multiple Partition DBs

Lets start with the standard disclaimer. Please go to the next slide

Memory Management for Dynamic SQL

Background. Let s see what we prescribed.

SQL Server 2014 In-Memory OLTP: Prepare for Migration. George Li, Program Manager, Microsoft

Ten Breakthroughs That Changed DB2 Forever!

Anthony AWR report INTERPRETATION PART I

Performance Optimization for Informatica Data Services ( Hotfix 3)

DB2 10 for z/os Optimization and Query Performance Improvements

purequery Deep Dive Part 2: Data Access Development Dan Galvin Galvin Consulting, Inc.

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

DB2 9 for z/os: Buffer Pool Monitoring and Tuning

Monitoring & Tuning Azure SQL Database

Chapter 8: Virtual Memory. Operating System Concepts

Pass IBM C Exam

Transcription:

Workload Insights Without a Trace - Introducing DB2 z/os SQL tracking 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 1

Agenda What s new in DB2 10 What s of interest for geeks in DB2 10 What s of interest for (performance) auditors Questions 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 2

DSC at a glance Characteristics: The DSC is where dynamic SQL statements, and *only* dynamic SQL statements, reside once they have been PREPAREd if certain ZPARM and/or BIND options are in use. The next time the exact same statement is to be PREPAREd the cache is searched and, if all is valid and certain ZPARM and/or BIND options are in use, then the PREPARE is avoided Thus saving lots of CPU time. Ideally an SQL statement should stay in the cache forever, but the real world shows that two days of residency or latency is typical. 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 3

DSC at a glance Characteristics: SELECT FROM WHERE Prepare AKA: Mini-BIND Optimizer (Optimizer-) RUNSTATS DB2 Catalog Statistics Access Paths for dynamic SQL are determined on the fly and stored in the DSC. LRU, RUNSTATS, ALTER, DROP, REVOKE, DB2 RESTART invalidates and flushes the DSC for an object. Dynamic Statement Cache 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 4

DSC at a glance Cache behavior overview: CACHEDYN-> NO YES K NO No skeletons cached in EDMP E E P D Y N A M I C YES Only full prepares No prepared statements kept across commits (note1) No statement strings kept across commits NONE No skeletons cached in EDMP Only full prepares No prepared statements kept across commits (note 1) Stmt strings kept across commits implicit prepares LOCAL Note 1: unless a cursor WITH HOLD is open Note 2: unless invalidated or flushed out due to LRU Note 3: assuming MAXKEEPD > 0 Skeletons cached in EDMP 1st prepare full; others short (note 2) No prepared statements kept across commits (note 1) No statement strings kept across commits Global Skeletons cached in EDMP 1st prepare full; others short (note 2) Prepared stmts across commits avoids prepares (note 3) Stmt strings kept across commits implicit prepares FULL AKA: Prepare Avoidance 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 5

DSC at a glance The many flavors of PREPARE: Full Skeleton copy of the SQL is not in the cache or the cache is not active. Caused by a PREPARE or EXECUTE IMMEDIATE statement. Short A skeleton copy of the PREPAREd SQL statement is copied to local storage. Avoided PREPARE avoided by using full caching. PREPAREd statement information is still in thread s local storage. Implicit Due to limits, such as MAXKEEPD, a PREPARE cannot be avoided and DB2 will issue the PREPARE on behalf of the application. 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 6

DSC at a glance DB2 Setup and Support: The right setup saves a lot of money Exploit the full flavor of caching MAXKEEPD>0 CACHEDYN=YES KEEPDYNAMIC(YES) 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 7

DSC at a glance So far, so good The DSC opened up great opportunities for dynamic SQL Packaged applications like SAP Less-mainframe-skilled developers Interactive multi-platform solutions The mainframe competing with the distributed environment Cost efficient and well performing applications The key is the Dynamic Statement Cache USE IT, or IBM will make you use it 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 8

DSC ZPARMs through the ages DSC relevant parameters and what they have been set to or defaulted to over the releases of DB2 Version MAXKEEPD 0-65535 CACHEDYN (Yes/No) Notes 5 5000 NO EDMPOOL was the CACHE 6 5000 NO If CACHEDYN YES then new EDMDSPAC With valid range 1K 2,097,152K 7 5000 NO New EDMDSMAX with valid range 0 2,097,152K and default 1,048,576K 8 5000 YES EDMDSPAC and EDMDSMAX removed. New EDMSTMTC with valid range 5,000K 1,048,576K and new opaque ZPARM CACHEDYN_FREELOCAL valid values 0 or 1 with default 0 (off) 9 5000 YES CACHEDYN_FREELOCAL default changed to 1 (on) and EDMSTMTC default changed to 56,693K 10 5000 YES EDMSTMTC default changed to 113,386K 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 9

DSC Tracing Besides the caching, the DSC gives you insight: Memory resident storage of PREPAREd dynamic SQL statements SQL text Statement ID Date/time, current status Resource consumption Who When What Where Start IFCIDs 316, 317 (318) to access the data* once the data is gathered, decide on what you want to analyze *These three IFCIDs are not really IFCIDs but more switches to enable externalization of dynamic SQL metrics 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 10

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 11

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 12

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 13

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 14

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 15

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 16

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 17

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 18

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 19

DSC Tracing 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 20

DSC Tracing WOW! This is great insight, without having to run a monitor,nor a trace! BUT! Does it really show ALL statements being executed? Do you really get the full picture? What about static SQL? What was this flush thing from slide four? 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 21

DSC Tracing Characteristics: SELECT FROM WHERE Prepare AKA: Mini-BIND Optimizer (Optimizer-) RUNSTATS DB2 Catalog Statistics Access Paths for dynamic SQL are determined on the fly and stored in the DSC. LRU, RUNSTATS, ALTER, DROP, REVOKE, DB2 RESTART invalidates and flushes the DSC for an object. Dynamic Statement Cache 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 22

DSC Tracing How does the smarter database, how does DB2 10 for z/os deal with it?... New: IFCIDs 316 was enhanced to externalize the data from the DSC when a flushing situation occurs (LRU, RUNSTATs, ALTER, DROP, REVOKE, ) 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 23

SSC at a glance Start the new IFCIDs 400, 401 to access additional data* let s call it the Static Statement Cache The SSC gives you the full picture: Memory resident storage of static SQL statements Statement ID Date/time, current status Resource consumption Like with the enhanced 316, data is externalized when the memory is full. NO DATA LOSS *These two IFCIDs are not really IFCIDs but more switches to enable externalization of static SQL metrics 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 24

SSC at a glance 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 25

SSC at a glance 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 26

SSC at a glance 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 27

SSC at a glance DB2 10 also provides some additional information from The DSC trace we all know today: Wait time accumulation for Latch requests Page latches Drain locks Drains during waits for claims to be released Log writers 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 28

SSC at a glance Date and time in store clock format for Stmt insertion and update (along with internal format) Number of times that a RID list overflowed because of storage shortage # of RIDs exceeded internal limit(s) a RID list append for a hybrid join interrupted because of RID pool storage shortage # of RIDs exceeded internal limit(s) a RID list retrieval failed for multiple IX access. The result of IX AND/Oring could not be determined 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 29

How to exploit DSC & SSC Have a started task running 24x7 catching all the IFCIDs that DB2 will be throwing and stores the data. Allow to exclude yourself from the system. Externalize the data like every 60 min, or allow -customization (e.g. 30-180 minutes -ad hoc data refresh 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 30

How to exploit DSC & SSC Triggered at the interval, the data captured needs to be processed locally, or at a different site: Allow two levels of details for static SQL Full - Capture the SQL Text at trace time Ref - Use the SYSPACKSTMT table for the SQL Text Referring to the Catalog should be the efficient default. However, in case of a very dynamic environment the SQL text needs to be captured real-time to avoid missing SQL text situations when using history and the original SQL isn t there anymore (e.g. a new pre-compile leads to a new STMTNO). 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 31

How to exploit DSC & SSC Resulting benefits: Executed SQL in a plex report Workload and Performance warehouse repository that contains *all* executed SQL Threshold based warning system for Exceeded resource limits Unusual workload Powerful history and trending analysis All of this is now available with the smallest ever possible overhead! 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 32

How to exploit it Real world scenarios: Scenario 1: Heavy hitters Scenario 2: Executed SQL by program Scenario 3: Objects used in SQL Scenario 4: Never executed SQL Scenario 5: RID Pool control Auditor Scenario 1: Who did what? Auditor Scenario 2: When did it happen? 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 33

Scenario 1: Heavy hitters All SQL that uses over a threshold of CPU All SQL that scans over a threshold of Getpages All SQL that waits too long Etc etc History, Drill-down Static and Dynamic 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 34

Scenario 1: Heavy hitters 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 35

Scenario 1: Heavy hitters data for SSC 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 36

Scenario 1: Heavy hitters 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 37

Scenario 1: Heavy hitters 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 38

Scenario 2: Executed SQL by program All SQL in programs with usage stats History, Drill-down Static 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 39

Scenario 2: Executed SQL by program 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 40

Scenario 2: Executed SQL by program 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 41

Scenario 2: Executed SQL by program Here you can see the Count column This gives the correct sequence in the BIND statement depending on the execution rate Another bonus! 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 42

Scenario 2: Executed SQL by program Again lots of data off to the right 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 43

Scenario 3: Objects used in SQL All SQL in programs with usage stats If the SQL text has been processed you can then see what objects are being used in your system. Of course what is even better is to see those objects *not* being used! History, Drill-down Static and Dynamic 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 44

Scenario 3: Objects used in SQL 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 45

Scenario 3: Objects used in SQL Here you can Zoom to the catalog object details or Select down to detail level to review SQL text and then link across to our Analyse+ tool. 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 46

Scenario 4: Never executed SQL All SQL in programs that has *never* been executed! Think of the possibilities here How often have you tuned and tuned a SQL to then find out that it is never actually executed? History, Drill-down Static 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 47

Scenario 4: Never executed SQL 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 48

Scenario 4: Never executed SQL 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 49

Scenario 4: Never executed SQL Here you can see the never executed statements in a given package 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 50

Scenario 4: Never executed SQL 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 51

Scenario 5: RID Pool control Where am I getting RID overflow or failure? Can I solve it with better statistics and a REBIND? History, Drill-down Static and Dynamic 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 52

Scenario 5: RID Pool control 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 53

Scenario 5: RID Pool control 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 54

Scenario 5: RID Pool control Again lots of data off to the right 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 55

Auditor Scenario 1: Who did what? All executed SQL for a given Authorization History, Drill-down Dynamic 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 56

Auditor Scenario 1: Who did what? 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 57

Auditor Scenario 1: Who did what? 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 58

Auditor Scenario 2: When did it happen? All executed SQL from a given (1st) time History, Drill-down Static and Dynamic 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 59

Auditor Scenario 2: When did it happen? 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 60

Auditor Scenario 2: When did it happen? 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 61

Auditor Scenario 2: When did it happen? Timestamps and other data off to the right remember! 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 62

Conclusion The DSC continues to increase DB2 efficiency An additional enhancement SSC closes the gap of out-of-the-box workload data DSC and SSC provide detailed production workload information ready-to-go 2011 SOFTWARE ENGINEERING GMBH and SEGUS Inc. 63