DB2 for i. Analysis and Tuning. Mike Cain IBM DB2 for i Center of Excellence. mcain@us.ibm.com



Similar documents
DB2 for i5/os: Tuning for Performance

DBA Tools with System i Navigator

OnDemand SQL Performance Analysis Simplified

SQL Performance Diagnosis

IBM Power Systems Software. The ABCs of Coding High Performance SQL Apps DB2 for IBM i. Presented by Jarek Miszczyk IBM Rochester, ISV Enablement

Transaction Monitoring Version for AIX, Linux, and Windows. Reference IBM

2 SQL in iseries Navigator

Key Attributes for Analytics in an IBM i environment

SQL Basics for RPG Developers

Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress*

MyOra 3.0. User Guide. SQL Tool for Oracle. Jayam Systems, LLC

ERserver. iseries. DB2 Universal Database for iseries - Database Performance and Query Optimization

Informix Performance Tuning using: SQLTrace, Remote DBA Monitoring and Yellowfin BI by Lester Knutsen and Mike Walker! Webcast on July 2, 2013!

ERserver. iseries. Work management

Using AS/400 Database Monitor To Identify and Tune SQL Queries

DB2 for Linux, UNIX, and Windows Performance Tuning and Monitoring Workshop

SQL Server Performance Tuning and Optimization

MyOra 3.5. User Guide. SQL Tool for Oracle. Kris Murthy

Exam : IBM : Iseries Linux Soluton Sales v5r3

Toad for Oracle 8.6 SQL Tuning

Oracle EXAM - 1Z Oracle Database 11g Release 2: SQL Tuning. Buy Full Product.

1Z0-117 Oracle Database 11g Release 2: SQL Tuning. Oracle

HelpSystems Web Server User Guide

Microsoft SQL Server: MS Performance Tuning and Optimization Digital

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

DB Performance Overview - How can I utilize DB2 for IBM i efficiently

MS SQL Server 2014 New Features and Database Administration

Microsoft SQL Database Administrator Certification

System Monitoring and Diagnostics Guide for Siebel Business Applications. Version 7.8 April 2005

<Insert Picture Here> Oracle SQL Developer 3.0: Overview and New Features

Using Database Performance Warehouse to Monitor Microsoft SQL Server Report Content

Performance Tuning for the Teradata Database

CA Insight Database Performance Monitor for DB2 for z/os

My AutoSupport. User Guide. October 2013

System Monitor Guide and Reference

The Arts & Science of Tuning HANA models for Performance. Abani Pattanayak, SAP HANA CoE Nov 12, 2015

Performance Counters. Microsoft SQL. Technical Data Sheet. Overview:

TS: Microsoft SharePoint 2010, Configuring

Monitoring Replication

PERFORMANCE TUNING IN MICROSOFT SQL SERVER DBMS

ABAP SQL Monitor Implementation Guide and Best Practices

features at a glance

EMC Unisphere for VMAX Database Storage Analyzer

FileNet System Manager Dashboard Help

The Complete Performance Solution for Microsoft SQL Server

LearnFromGuru Polish your knowledge

Introduction. Part I: Finding Bottlenecks when Something s Wrong. Chapter 1: Performance Tuning 3

SQL Server Replication Guide

Table of Contents. Chapter 1: Introduction. Chapter 2: Getting Started. Chapter 3: Standard Functionality. Chapter 4: Module Descriptions

B.Sc (Computer Science) Database Management Systems UNIT-V

MS SQL Performance (Tuning) Best Practices:

User's Guide - Beta 1 Draft

How To Use The Enhanced Write Filter On Windows Xp Embedded (Dota) With A Powerbook (Dot) And Powerbook 2 (Windows Xp) With An Overlay (Powerbook) With The Write Filter (Wfmgr) On A

Top 10 Oracle SQL Developer Tips and Tricks

HP Device Manager 4.6

Rackspace Cloud Databases and Container-based Virtualization

Developing and Implementing Windows-Based Applications With Microsoft Visual C#.NET and Microsoft Visual Studio.NET

White Paper April 2006

SQL Server for developers. murach's TRAINING & REFERENCE. Bryan Syverson. Mike Murach & Associates, Inc. Joel Murach

Oracle Data Integrator: Administration and Development

SAP Sybase SQL Anywhere New Features Improve Performance, Increase Security, and Ensure 24/7 Availability

Getting Started with Tuning SQL Statements in IBM Data Studio and IBM Data Studio (stand-alone), Version 2.2.1

Inside the PostgreSQL Query Optimizer

Tivoli Monitoring for Databases: Microsoft SQL Server Agent

Configuring Apache Derby for Performance and Durability Olav Sandstå

DB Audit Expert 3.1. Performance Auditing Add-on Version 1.1 for Microsoft SQL Server 2000 & 2005

SQL Server 2012 Optimization, Performance Tuning and Troubleshooting

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

IBM DB2 for i indexing methods and strategies Learn how to use DB2 indexes to boost performance

DBMS Performance Monitoring

White Paper. Optimizing the Performance Of MySQL Cluster

How To Improve Performance In A Database

IBM Tivoli Composite Application Manager for Microsoft Applications: Microsoft Hyper-V Server Agent Version Fix Pack 2.

SQL Optimization & Access Paths: What s Old & New Part 1

Controlling Dynamic SQL with DSCC By: Susan Lawson and Dan Luksetich

University of Aarhus. Databases IBM Corporation

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

1. Physical Database Design in Relational Databases (1)

CA Unified Infrastructure Management

Performance Tuning and Optimizing SQL Databases 2016

Application. 1.1 About This Tutorial Tutorial Requirements Provided Files

Abstract. For notes detailing the changes in each release, see the MySQL for Excel Release Notes. For legal information, see the Legal Notices.

Application Scalability in Proactive Performance & Capacity Management

VMware vrealize Operations for Horizon Administration

DB2 Universal Database for iseries Administration

Oracle Database 12c: Performance Management and Tuning NEW

SQL Server 2012 Performance White Paper

Using AS/400 Database Monitor and Visual Explain

New Tools for Faster SQL Tuning and Analysis Embarcadero Technologies

Audit TM. The Security Auditing Component of. Out-of-the-Box

PERFORMANCE TUNING FOR PEOPLESOFT APPLICATIONS

SAP BO 4.1 COURSE CONTENT

TIBCO Spotfire Metrics Modeler User s Guide. Software Release 6.0 November 2013

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

SQL Server 2008 Performance and Scale

vcenter Operations Management Pack for SAP HANA Installation and Configuration Guide

Upgrade Guide. Product Version: Publication Date: 02/11/2015

In-memory databases and innovations in Business Intelligence

VMware vcenter Discovered Machines Import Tool User's Guide Version for vcenter Configuration Manager 5.3

DocAve 4.1 Backup User Guide

Transcription:

DB2 for i Monitoring, Analysis and Tuning Mike Cain IBM DB2 for i Center of Excellence Rochester, MN USA mcain@us.ibm.com 8 Copyright IBM Corporation, 2008. All Rights Reserved. This publication may refer to products that are not currently available in your country. IBM makes 2009 no IBM commitment Corporation to make available any products referred to herein.

Even though DB2 for i is: Self managing Self tuning Easy to use Easy to maintain SQL monitoring and analysis is advantageous

Review of Query Optimization and Execution

Components of Work - Database Request RunTime Output Results ƒ ƒ ƒ ƒ ƒ ƒ ƒ Journaling Index Maintenance Constraint Enforcement Locking Ti Trigger Processing Disk Operations CPU Operations Open ƒ ODP Creation Processing ƒ Database Authentication Key to optimum SQL performance Identify Minimize Eliminate bottlenecks in these areas Optimization i ƒ ƒ Access Plan Creation Index Estimates Process Request

Query Optimization Cost Based Query Optimization The DB2 for i Optimizer i performs "cost tbased" optimization i "Cost" is defined as the estimated time it takes to run the request "Costing" various plans refers to the comparison of a given set of algorithms and methods in an attempt to identify the "fastest" plan One goal of the optimizer is to eliminate I/O as early as possible by identifying the best path to and through the data The optimizer has the ability and freedom to "rewrite" the query Very sophisticated query strategies and methods are used

Query optimization takes into account System configuration System performance System attributes OS VRM Level Job, Query attributes The Plan SMP, DB parallelism Database design SQL Request Table sizes, number of rows Static Dynamic Extended Dynamic Interfaces Work management Views and Indexes (Radix, EVI)

SQL Query Processing New Request SQL request Optimize Open Run DB2 for i Time

(Query) Access Plans The output of query optimization SQL request ACCESS PLAN Contents A control structure t that t contains information on the actions necessary to satisfy each SQL request These contents include: Access Method Info on associated tables and indexes Any applicable program and/or environment information

Access Plan to ODP Internal Structures Executable code for all requested I/O operations ACCESS PLAN CREATE OPEN DATA PATH (ODP) Create process is EXPENSIVE Longer execution time the first time an SQL statement is executed Emphasizes the need of REUSABLE ODPs

Query Plan Execution DB Objects DB Engine Executable code for I/O operations and processing Data Access Data Processing Item1 150 XL Red Item2 525 S Blue Item3 310 XXL Yellow Item4 90 M Green

Query Optimization and Execution Phases Query processing can be roughly divided into four phases: Query Validation Validate the query request Validate any existing plan(s) Build the internal query structures Query Dispatcher Determine which query engine can complete the processing Query Optimization Choose the most efficient access and processing methods Build the access plan Query Execution Build the structures needed for query cursor Build the structures for any temporary structures (if needed) Build and activate query cursor (ODP) Generate information DB Engine executes the query plan

SQL Monitoring and Analysis Mechanisms

Query Optimization and Execution Information Indexes Advised System wide V5R4 and 6.1 only SQE Plan Cache V5R4 and 6.1 only SQE Plan Cache Snapshots V5R4 and 6.1 only Detailed Database Monitor Data SQL trace V5R4 and 6.1 enhanced Visual Explain V5R4 and 6.1 enhanced PRTSQLINF Messages Summarized Database Monitor Data Debug Job Log Messages

Query Optimization Feedback Indexes Advised SQE Plan Cache SQE Plan Cache Snapshots Visual Explain SQL request Query Optimization Print SQL Information Messages Detailed DB Monitor Data Summarized DB Monitor Data Debug Job Log Messages

Index Advised System wide New V5R4 feature, enhanced in 6.1 System wide index advice Data is placed into a DB2 table (QSYS2/SYSIXADV) Autonomic No overhead CQE and SQE support CQE only provides basic advice based on local selection predicates SQE provides complex advice based on all parts of the query GUI interface via iseries Navigator Advice by System, or Schema, or Table System only adds rows, user must manage the data Options to clear or prune Can create indexes directly from GUI New in 6.1: Multiple index creation Additional indexing analysis might be required New in 6.1: Condensed advice

Index Advised System wide

Index Advised System wide

Index Advised System wide

SQE Plan Cache New V5R4 feature, enhanced in 6.1 System wide information from the SQE Plan Cache Automatic No overhead SQE support only GUI interface via iseries Navigator Access Filtering Analysis by time, user, job, statement, etc. Visual Explain Data is volatile Information in the SQE Plan Cache is live and changing SQE Plan Cache is cleared at IPL Newin61:Event 6.1: monitor to capture plans that are pruned SQE Plan Cache is always available No need to start and stop a tool or utility SQE Plan Cache SQE stores all query plans in a centralized system wide plan cache. Along with the plans, SQE keeps meta data and runtime information for the plans (i.e. queries). The plan cache is considered temporary storage.

SQE Plan Cache

SQE Plan Cache Example: filter on top 10 and current user Get the plan ids for the top 10 queries Get the plan ids of all queries the current user ran AND the plan id lists together Return those plans to the user If the current user ran one or more of the top 10 plans, those particular plans will be returned. If the user did not run any of the top 10 plans, nothing is returned. The top 10 plans for current user is not necessarily returned.

SQE Plan Cache Show Statements List is initially empty to allow for user filtering

SQE Plan Cache Show Longest Runs

SQE Plan Cache Column filtering

SQE Plan Cache - Properties

SQE Plan Cache Event Monitors

SQE Plan Cache Snapshots New V5R4 feature, enhanced in 6.1 System wide information materialized from the SQE Plan Cache No overhead data capture is part of normal query optimization and execution Pre-filtering Data is placed into a single DB2 table SQE support only SQL interface (CALL QSYS2/DUMP_PLAN_CACHE) MC Press Tech Tip - Automatically Generate an SQE Plan Cache Snapshot http://www.mcpressonline.com/tips-techniques/system-administration/techtip-automatically-generate-an-sqe-plan-cache-snapshot.html New in 6.1: SQE Plan Cache Snapshots are automatically registered GUI interface via iseries Navigator Access Filtering Analysis by time, user, job, statement, etc. Visual Explain Data is not volatile Information from the SQE Plan Cache is captured at a point in time SQE Plan Cache is always available No need to start and stop a tool or utility Additional analysis methods available like before and after comparisons New in 6.1: Copy to spreadsheet

SQE Plan Cache Snapshots

SQE Plan Cache Snapshots

SQE Plan Cache Snapshots

SQE Plan Cache Snapshots

Detailed Database Monitor SQL Trace Enhanced in V5R4 and 6.1 Detailed information collected by the SQL tracing facility Data is placed into a single DB2 table Potentially high overhead CQE and SQE support Command interface STRDBMON / ENDDBMON Connection attributes interface GUI interface via iseries Navigator Access Pre-filtering and Post-filtering New in 6.1: port number and Query Governor Analysis by time, user, job, statement, etc. Summary information via dashboard Visual Explain Data is not volatile Information from the optimizer and engine is captured at a point in time Additional analysis methods available like before and after comparisons New in 6.1: Copy to spreadsheet

Detailed Database Monitor SQL Trace

Detailed Database Monitor SQL Trace

Detailed Database Monitor SQL Trace New in 6.1

Detailed Database Monitor SQL Trace

Detailed Database Monitor SQL Trace

Visual Explain Enhanced in V5R4, enhanced in 6.1 Graphical representation of query plan Representation of the DB objects and data structures Representation of the methods and strategy Associated environmental information Advice on indexes and column statistics Highlighting of specific query rewrites Highlighting of expensive methods CQE and SQE support GUI interface via iseries i Navigator Based on detailed optimizer information SQE Plan Cache SQE Plan Cache Snapshots Detailed Database Monitor Data New in 6.1: Explain while running Print attributes for a given node

Visual Explain

Visual Explain

Visual Explain Explain while running New in 6.1

SQL Details for Job (i.e. Connection) Requires DB2 for i 6.1

Which Feedback Mechanism? Indexes Advised SQE Plan Cache SQE Plan Cache Snapshots Visual Explain SQL request Query Optimization Print SQL Information Messages Detailed DB Monitor Data Summarized DB Monitor Data Debug Job Log Messages

Which Method or Mechanism? What is the starting point? What is the perspective? System Application User Job SQL Request Access method or strategy What information is already known, or assumed? What is the analysis methodology? How big of net can you cast? How much help do you want? Textual information or graphical information Real time information Comparative information General advice or specific advice Before and After information needed? It Depends!

What about System Performance Information? DB2 for i Collection Services Performance Tools Job Watcher idoctor Indexes Advised SQL request Query Optimization SQE Plan Cache Print SQL Information Messages SQE Plan Cache Snapshots Detailed DB Monitor Data Summarized DB Monitor Data Debug Job Log Messages Visual Explain