Monitoring the Essentials in DB2 10.5

Slides:



Advertisements
Similar presentations
Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.
Advertisements

Tuning: overview Rewrite SQL (Leccotech)Leccotech Create Index Redefine Main memory structures (SGA in Oracle) Change the Block Size Materialized Views,
Copyright © SoftTree Technologies, Inc. DB Tuning Expert.
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
<Insert Picture Here>
© IBM Corporation Informix Chat with the Labs John F. Miller III Unlocking the Mysteries Behind Update Statistics STSM.
MCTS GUIDE TO MICROSOFT WINDOWS 7 Chapter 10 Performance Tuning.
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
1 - Oracle Server Architecture Overview
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Backup & Recovery 1.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Chapter 2. Creating the Database Environment
© 2010 IBM Corporation Information Management Performance Enhancements for DB2 V10.1 Anthony Reina - Accelerated Value Specialist
MCTS Guide to Microsoft Windows Vista Chapter 11 Performance Tuning.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
© 2006 IBM Corporation Adaptive Self-Tuning Memory in DB2 Adam Storm, Christian Garcia-Arellano, Sam Lightstone – IBM Toronto Lab Yixin Diao, M. Surendra.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
MCTS Guide to Microsoft Windows 7
Database Administration TableSpace & Data File Management
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
1 Oracle Database 11g – Flashback Data Archive. 2 Data History and Retention Data retention and change control requirements are growing Regulatory oversight.
Copyrighted material John Tullis 10/6/2015 page 1 Performance: WebSphere Commerce John Tullis DePaul Instructor
Physical Database Design & Performance. Optimizing for Query Performance For DBs with high retrieval traffic as compared to maintenance traffic, optimizing.
Extents, segments and blocks in detail. Database structure Database Table spaces Segment Extent Oracle block O/S block Data file logical physical.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
13 Copyright © 2006, Oracle. All rights reserved. Tuning PGA and Temporary Space.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
Physical Database Design Transparencies. ©Pearson Education 2009 Chapter 11 - Objectives Purpose of physical database design. How to map the logical database.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Module 14 Monitoring and Optimizing SharePoint Performance.
Indexes / Session 2/ 1 of 36 Session 2 Module 3: Types of Indexes Module 4: Maintaining Indexes.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
© 2010 IBM Corporation Information Management Using Snapshot monitor SQL Administrative Views for Performance Analysis on V10.1 Anthony Reina - Accelerated.
Deep understanding of DB2 and Snapshots monitoring and Administrative view Sharad D. Pawar ACI Payment system.
Infrastructure for Data Warehouses. Basics Of Data Access Data Store Machine Memory Buffer Memory Cache Data Store Buffer Bus Structure.
Session 1 Module 1: Introduction to Data Integrity
Trouble Shooting and Maintenance Pertemuan 13 Matakuliah: T0413 Tahun: 2009.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
IMS 4212: Database Implementation 1 Dr. Lawrence West, Management Dept., University of Central Florida Physical Database Implementation—Topics.
20 Copyright © 2008, Oracle. All rights reserved. Cache Management.
TOP 10 Thinks you shouldn’t do with/in your database
for all Hyperion video tutorial/Training/Certification/Material Essbase Optimization Techniques by Amit.
CODUG DB2 User Group Copyright 2005, GTS. All Rights Reerved DB2 for Linux, UNIX, Windows Tuning DBM and DB Configuration Parameters Philip K. Gunning.
21 Copyright © 2008, Oracle. All rights reserved. Enabling Usage Tracking.
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
Select Operation Strategies And Indexing (Chapter 8)
Oracle Announced New In- Memory Database G1 Emre Eftelioglu, Fen Liu [09/27/13] 1 [1]
This document is provided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
Data, Space and Transaction Processing
Table spaces.
SQL Server Internals Overview
MCTS Guide to Microsoft Windows 7
Database Performance Tuning &
SQL Server Monitoring Overview
Software Architecture in Practice
Database Performance Tuning and Query Optimization
Introduction of Week 3 Assignment Discussion
Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Chapter 11 Database Performance Tuning and Query Optimization
Presentation transcript:

Monitoring the Essentials in DB2 10.5 Philip K. Gunning Gunning Technology Solutions, LLC Session Code: C03 May 13, 2014 3:15 PM – 4:15 PM| Platform: DB2 LUW

DISCLAIMER DB2™ is a registered trademark of IBM Corporation. DB2 BLU, BLU Acceleration are registered trademarks or copyrights of IBM Corporation Other logos and product/trade names are registered trademarks or copyrights of their respective companies NOTES:

The Warp Speed Achieved with BLU Acceleration “For data analytics the volumes involved are usually dramatically larger than cache sizes, which highly limits exploitation of CPU caches. The secret to the warp speed-up achieved in BLU Acceleration is that IBM has designed every algorithm to minimize access to RAM, and maximize processing time in L3 and L2 caches. For the processor shown that provides a whopping 15x-41x speed-up for memory access” (Sam Lightstone, IBM, www.Softwaretradecraft.com) NOTES:

Overview Overview of BLU Acceleration DB2 in the New Galaxy Concepts Terminology DB2 in the New Galaxy When RAM is too slow Learning to speak and think “Column organized” in BLU Acceleration Rules of Thumb for column organized data in terms workload, concurrency, bufferpools, sort heap threshold, sortheap NOTES:

Overview Important role of UTIL_HEAP_SZ New “Column Organized” monitoring metrics How efficient are my column-organized tables Are you getting what you think? Using MONREPORT reporting module Tuning Recommendations Best Practices NOTES:

Quick Look at Prerequisites DB2 Workgroup Advanced Enterprise Server Edition DB2 Advanced Enterprise Server Edtion OS and Hardware prerequisites NOTES:

New Registry Variable Setting for Analytical Workload Before creating a new database, set the DB2_WORKLOAD registry variable to ANAYLTICS This will result in the following: Makes column organized tables the default table type DFT_TABLE_ORG=COLUMN Page and extent size configured for analytical processing PAGESIZE=32 DFT_EXTENT_SZ=4 DFT_DEGREE=ANY Memory for sorting, caching and hashing will be set based on the amount of RAM and server size Enables automatic space reclamation Compression is always on NOTES: Set the DB2_WORKLOAD registry variable to ANALYTICS before creating any database.

Setting the DB2_WORKLOAD Registry Variable Continued Memory for sorting, caching and hashing will be set based on the amount of RAM and server size CATALOGCACHE_SZ, SHEAPTHRES_SHR and SORTHEAP set to a value that is optimized for the hardware you are using Intraquery Parallelism enabled for any workload even if DBM CFG parameter INTRA_PARALLEL=OFF The default concurrency threshold on the SYSDEFAULTMANAGEDSUBCLASS service subclass is enabled to ensure maximum efficiency and utilization of the server Automatic Space Reclamation is enabled AUTO_MAINT=ON AUTON_REORG=ON Page and extent size configured for analytical processing Enables automatic space reclamation Compression is always on NOTES:

Setting the DB2_WORKLOAD Registry Variable Continued Automatic Space Reclamation is enabled AUTO_MAINT=ON AUTO_REORG=ON Space reclamation performed for column-organized tables by default NOTES: Set the DB2_WORKLOAD registry variable to ANALYTICS before creating any database.

Use of AUTOCONFIGURE For an existing database that you want to configure for BLU Acceleration Set the DB2_WORKLOAD=ANALYTICS registry variable and restart the instance Connect to the database you want to run autoconfigure on Run “db2 autoconfigure apply dbname” After running autoconfigure, review the bufferpool. SHEAPTHRES_SHR, SORTHEAP , UTIL_HEAP_SZ and adjust as necessary NOTES:

Use of AUTOCONFIGURE In an instance with multiple databases some of which are not using BLU, set the registry variable before you create the databases that will be using BLU, then unset the registry variable after creating the databases that will use BLU NOTES:

Setting SHEAPTHRES_SHR and SORTHEAP Parameters When BLU Acceleration is enabled, the self-tuning memory manager (STMM) does not adjust the values of the SHEAPTHRES_SHR and SORTHEAP database configuration parameters automatically. Set with static values by the AUTOCONFIGURE command when DB2_WORKLOAD=ANALYTICS registry setting is enabled NOTES:

Setting SHEAPTHRES_SHR and SORTHEAP Analytical workloads require larger sort memory areas due to the nature of the workload Optimal setting provides degree of concurrency required and associated SORTHEAP sizing Setting SHEAPTHRES_SHR to AUTOMATIC not supported for databases using column organized tables Tuning SHEAPTHRES_SHR and SORTHEAP as important as tuning BUFFERPOOLS Aim to prevent sort overflows to disk which can significantly slow down queries SET SEHAPTHRES_SHR to 40-50% of the memory available to the database DATABASE_MEMORY DB CFG Parameter NOTES: The SHEAPTHRES_SHR database configuration parameter represents a soft limit on the total amount of database shared memory that can be used by sort memory consumers at any one time. Set to handle degree of concurrent sort consumers (nbr of sort consumers x sortheap setting).

Setting SHEAPTHRES_SHR and SORTHEAP The SORTHEAP DB CFG parameter controls the amount of memory an application can use for SORTS SORTHEAP memory comes out of total SHEAPTHRES_SHR memory Size the SHEAPTHRES_SHR DB CFG parameter and SORTHEAP DB CFG parameter to provide the amount of concurrency desired and to prevent sort overflows Rule of thumb for sizing SORTHEAP is set it to 5-20% of SHEAPTHRES_SHR Monitor for sort overflows and post threshold sorts via MON_GET_DATABASE and MON_GET_UNIT_OF_WORK table functions NOTES: The higher the degree of sort concurrency requires, increase SHEAPTHRES_SHR and reduce the SORTHEAP DB CFG parameter. This should be done in small increments and through dedicated monitoring sessions.

Monitoring SHEAPTHRES_SHR and SORTHEAP Monitor for sort overflows and post threshold sorts via MON_GET_DATABASE and MON_GET_UNIT_OF_WORK table functions Adjust SHEAPTHRES_SHR upward and SORTHEAP upward gradually to eliminate sort overflows Don’t increase SORTHEAP without concomitant adjustment to SORTHEAP Can decrease SORTHEAP independently Mine the DYNAMIC SQL and target queries with high number of overflows Good way to train a DBA in tuning SQL or identifying proper indexes to eliminate SORTS NOTES:

Setting the STMTHEAP DB CFG Parameter Since analytic queries are more complex than OLTP type queries, they can benefit from an increased STMTHEAP DB CFG size The STMTHEAP DB CFG parameter specifies the size of the workspace used by the SQL compiler during compilation of an SQL statement NOTES: STMTHEAP is essentially a work space used by the SQL Compiler during compilation of an SQL statement. If you have queries that receive an SQL0437W with reason code 1, adjust the STMTHEAP size by 50% and continue to increment by same percentage as needed.

Importance of Setting UTIL_HEAP_SZ Correctly For LOAD operations and for building compression dictionaries UTIL_HEAP_SZ must be sufficiently sized Set to AUTOMATIC if DB2_WORKLOAD=ANALYTICS If DATABASE_MEMORY set to AUTOMATIC should be sufficient as it will grow as necessary If not sized sufficiently, can result in less than optimal compression NOTES:

Monitoring Adequacy of UTIL_HEAP_SZ setting Check the new PCTENCODED column in the SYSCAT.COLUMNS catalog view which is the the percentage of values that are encoded as a result of compression for a column in a column-organized table. If the overall compression ratio for you’re the table in is too low, check this statistic to see if values in specific columns were left uncompressed. Many columns with a very low value (or even 0) can be an indicator that utility heap might have been too small when the column compression dictionaries were created You might also see very low values for columns that were incrementally loaded with data that was outside of the scope of the column compression dictionary NOTES:

So, How are your Column-organized Tables Performing? Use monitor elements returned by the MON_GET_TABLE table function to determine the efficiency of column-organized tables and to identify candidate tables suitable to be organized by column NOTES:

New Column-organized Metrics from MON_GET_TABLE table function Use monitor elements returned by the MON_GET_TABLE table function to determine the efficiency of column-organized tables and to identify candidate tables suitable to be organized by column By dividing the NUM_COLUMNS_REFERENCED monitor element by the SECTION_EXEC_WITH_COL_REFERENCES monitor element, you can determine the average number of columns that a particular query accesses. If this average is much less than the number of columns in the table, the workload favors column organization. Controlled by the mon_obj_metrics DB CFG parameter setting Extended is the default and is required to return column-organized metrics NOTES:

Monitor Collection DB CFG Parameters (Review) Mon_act_metrics – controls collection of activity level monitor elements on the entire database (DEFAULT – BASE) MON_GET_ACTIVITY_DETAILS MON_GET_PKG_CACHE_STMT Activity event monitor (DETAILS_XML monitor element in the event_activity logical data groups) Mon_deadlock – controls generation of deadlock events on the entire database (DEFAULT- WITHOUT_HIST) Mon_locktimeout – controls generation of lock timeout events on the entire database (DEFAULT – NONE) Mon_lockwait – controls generation of lock wait events for the lock event monitor (DEFAULT – NONE) Mon_lw_thresh – the amount of time spent in lock wait before an event for mon_lockwait is generated (DEFAULT - 5000000) Mon_obj_metrics – controls collection of data object monitor elements on the entire database (DEFAULT- EXTENDED *formerly BASE) MON_GET_TABLE NOTES:

Monitor Collection DB CFG Parameters (Review) Mon_req_metrics – controls the collection of request monitor elements on the entire database (DEFAULT – BASE) MON_GET_UNIT_OF_WORK MON_GET_UNIT_OF_WORK_DETAILS MON_GET_CONNECTION MON_GET_CONNECTION_DETAILS MON_GET_SERVICE_SUBCLASS MON_GET_SERVICE_SUBCLASS_DETAILS MON_GET_WORKLOAD MON_GET_WORKLOAD_DETAILS Statistics event monitor (DETAILS_XML monitor element in the event_wlstats and event_scstats logical data groups) Unit of work event monitor Mon_uow_data – controls the generation of UOW events at the database level for the UOW event monitor (DEFAULT – NONE) NOTES:

Monitoring and MONREPORT Reporting Enhancements MONREPORT.DBSUMMARY and MONREPORT.CONNECTION reporting modules enhanced to support on column processing New monitor elements to assess bufferpool efficiency Monitor elements contain COL in the monitoring element name New monitor elements to monitor prefetch performance for data in column organized tables New monitor elements to measure column data size ADMIN_GET_TAB_INFO New monitor elements to measure time spent New monitor elements for the HASHED GROUP BY operator New monitor interfaces to get request metrics that are aggregated along different dimensions New monitor interfaces to get activity metrics Monitor interfaces to get database object metrics Refer to Database Monitoring Guide and Reference for complete details NOTES:

New CTQ Optimization Operator Use to denote operations on column organized tables Most processing should be below the CTQ operator in the access path (db2exfmt, db2explain) Optim Performance Manager Optim Query Tuner If many operations above this operator indicator of inefficient use of column organized table Re-look how table is being used NOTES:

Reviewing time spent in column processing versus row processing with new monitor elements New monitoring elements returned from MON_GET_ACTIVITY_DETAILS tabe function to show where time is being spent Total_app_section_excutions Total_col_executions Total_col_proc_time Total_col_time Total_cpu_time NOTES:

Understanding Automatic Space Reclamation Space reclamation for column-organized tables Space reclamation after deletions After a delete operation the row is logically deleted Space that was used by the deleted row is not available to subsequent transactions and remains unusable until space reclamation occurs REORG TABLE is required to reclaim the space NOTES:

Understanding Automatic Space Reclamation Space reclamation after updates After a delete operation the row is first deleted and a new copy of the row inserted at the end of the table Updated row uses space in proportion to the number of times that the row is updated until space reclamation occurs All rows in the extent where the update took place must be deleted before any space reclamation can occur REORG TABLE is required to reclaim the space NOTES:

Understanding Automatic Space Reclamation If DB2_WORKLOAD=ANALYTICS then AUTO_REORG enabled Define an automatic reorg online and/or offline policy using the AUTOMAINT_SET_POLICY or AUTOMAINT_SET_POLICYFILE stored procedures with the appropriate parameters Offline reorg considerations Need appropriate window Reclaims space Faster than online REORG Sample POLICYFILE in SAMPLE DB2 directory NOTES:

Automatic Space Reclamation Online REORG considerations Still need appropriate window Schedule ONLINE REORG window during period of low activity Reclaims space by specifying Specify RECLAIM EXTENTS option of REORG command to reclaim space To determine when a table REORG is necessary, use the ADMIN_GET_TAB_INFO table function to review an estimate of the amount of reclaimable space to reclaim Monitor REORG status with db2pd or SNAPTAB_REORG administrative view NOTES:

Summary DB2 BLU New Column-organized capabilities Use of AUTOCONFIGURE Review of DB2_WORKLOAD=ANALYTICS registry setting SHEAPTHRES_SHR and SORTHEAP setting discussion and recommendations Table monitoring metrics Monitoring Enhancements and some review Activity detail monitoring elements New Monitoring Elements Importance of adequate UTIL_HEAP_SZ REORG Considerations Space Usage and Reclamation NOTES:

References Tuning and Monitoring System Performance, located at https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Wc9a068d7f6a6_4434_aece_0d297ea80ab1/page/Tuning%20and%20Monitoring%20Database%20System%20Performance DB2 10.5 Database Monitor Guide and Reference, http://public.dhe.ibm.com/ps/products/db2/info/vr105/pdf/en_US/DB2Monitoring-db2f0e1050.pdf Best Practices, Optimizing Analytical Workloads using DB2 10.5 with BLU Acceleration, https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Wc9a068d7f6a6_4434_aece_0d297ea80ab1/page/Optimizing%20analytic%20workloads%20using%20DB2%2010.5%20with%20BLU%20Acceleration/comment/1dc59ee4-8c70-43f9-9d36-fba334b95891 NOTES:

References DB2 BLU Acceleration, Rapid Adoption Guide, http://www.ibm.com/developerworks/data/library/techarticle/dm-1309db2bluaccel/ When RAM is too Slow, http://softwaretradecraft.com/when-ram-is-too-slow-how-dynamic-in-memory-processing-changes-the-game-for-data-analytics/ DB2 10.5, What’s New, http://public.dhe.ibm.com/ps/products/db2/info/vr105/pdf/en_US/DB2WhatsNew-db2q0e1050.pdf NOTES:

Monitoring the Essentials in DB2 10.5 DB2 LUW Philip K. Gunning Gunning Technology Solutions, LLC pgunning@gts1consulting.com Monitoring the Essentials in DB2 10.5 DB2 LUW Please fill out your session evaluation before leaving!