Practical DB2 UDB
Performance


John Maenpaa
Senior Consultant
John_Maenpaa@ylassoc.com
Practical DB2 UDB Performance
©   Copyright 1998-2003 Yevich, Lawson & Associates, Inc. All Rights Reserved

Yevich, Lawso...
Disclaimer
                               PLEASE READ THE FOLLOWING NOTICE
The information contained in this presentation ...
Abstract
This presentation will serve as an introduction to performance monitoring UDB
databases. The target audience will...
Define Performance Tuning
■ Performance
  –   Behavior of computer under a specific workload
■ Performance Measurement
  –  ...
Balancing Resources
■   Processor (CPU)
■   Memory
■   I/O
■   Network
■   People
■   Money




        © YL&A 1999-2003  ...
Quick-start Tips
■ Collect statistics
   –   The optimizer can’t do its job without them
■ Workload Performance Wizard
   ...
Instances and Databases
■ Instance
  –   Database Manager
  –   System Administration
  –   Communication
  –   Attach-lev...
Practical DB2 UDB Performance




                        DB2 Monitors




     © YL&A 1999-2003        9         Practica...
Monitor Switches
■ Setting Defaults
■ Setting Interactively
■ Counter Reset




        © YL&A 1999-2003   10   Practical ...
Commands
■   Get Monitor Switches
■   Set Monitor Switches
■   List Applications Show Detail
■   db2mtrk
■   db2expln




...
Snapshot Monitors
■   Get Snapshot For DBM
■   Get Snapshot For All Databases
■   Get Snapshot For All Applications
■   Ge...
Get Snapshot
>>-GET SNAPSHOT FOR--------------------------------------------->

>--+-+-DATABASE MANAGER-+--WRITE TO FILE--...
Get Snapshot for Dynamic SQL
 Number of executions                =   1
 Number of compilations              =   1
 Worst ...
Event Monitor
SET EVENT MONITOR
EVENT_MON_STATE(EVEMONNAME)


                                                            ...
Event Monitors
■ Deadlocks
■ Statements




      © YL&A 1999-2003   16   Practical DB2 UDB Performance
Practical DB2 UDB Performance




                        External Monitors




     © YL&A 1999-2003          17         ...
Processor
■   top
■   ps
■   Task Manager
■   Performance Monitor




        © YL&A 1999-2003   18   Practical DB2 UDB Pe...
Looking at Processes
■   top
■   ps -ef
■   ps -aux
■   Windows Task Manager




        © YL&A 1999-2003   19   Practical...
Output from "top"
top - 08:37:51 up 11:15, 0 users, load average: 0.61, 0.33, 0.20
Tasks: 108 total,   5 running, 103 slee...
Output from "ps -aux"
USER        PID %CPU %MEM VSZ RSS      TTY         STAT START     TIME COMMAND
root       1720 0.0 0...
Output from "ps -ef"
UID         PID   PPID   C   STIME   TTY         TIME   CMD
root       1720      1   0   Dec02   ?   ...
Windows Task Manager Process View




     © YL&A 1999-2003   23          Practical DB2 UDB Performance
Memory Hierarchy

                        Database Manager
                         Shared Memory




                 Dat...
Database Global Memory

Database Manager
 Shared Memory
                              Utility Heap                        ...
Database Global Memory
                                  Database Global Memory
Application          Database    Services:...
Global SQL Cache

                Dynamic SQL Cache          Static SQL Cache

  User 1          Section   Section        ...
Looking at DB2 Memory Usage
■ Operating System Tools
  –   vmstat
  –   ps
  –   Windows Task Manager
  –   Windows Perfor...
Output from "vmstat"
procs -----------memory---------- ---swap-- -----io---- --system--   ----cpu----
 r b    swpd   free ...
Output from "DB2 Memory Visualizer"




     © YL&A 1999-2003    30           Practical DB2 UDB Performance
Output from "db2mtrk"
$ db2mtrk -i -p -w -d -v
Tracking Memory on: 2002/12/03 at 10:03:26

Memory for instance

   Databas...
I/O Tuning
■ Data Placement
■ Index Placement
■ DMS or SMS

                                      Agent




              ...
Storage Distribution – Logs
■ Log Placement



                                             Agent




               Log
 ...
Storage
■ iostat
■ Performance Monitor




       © YL&A 1999-2003   34   Practical DB2 UDB Performance
Output from “iostat”

tty:         tin              tout      avg-cpu:        % user       % sys        % idle       %
iow...
Performance Monitor




     © YL&A 1999-2003   36   Practical DB2 UDB Performance
Applications
■ Static SQL
  –   Explain
■ Dynamic SQL
  –   Snapshot
  –   Explain




        © YL&A 1999-2003   37   Pra...
Practical DB2 UDB Performance




                        GUI Tools




     © YL&A 1999-2003      38       Practical DB2 ...
Control Center




     © YL&A 1999-2003   39   Practical DB2 UDB Performance
Configuration Advisor
■ Better than parameter defaults
■ User input
   –   Database description
   –   Memory availability
...
Visual Explain




      © YL&A 1999-2003   41   Practical DB2 UDB Performance
Design Advisor
■ Workload
   –   Single SQL statement
   –   SQL statements with frequencies
■ Recommends indexes for quer...
Design Advisor




     © YL&A 1999-2003   43   Practical DB2 UDB Performance
Design Advisor




     © YL&A 1999-2003   44   Practical DB2 UDB Performance
Design Advisor




     © YL&A 1999-2003   45   Practical DB2 UDB Performance
Design Advisor




     © YL&A 1999-2003   46   Practical DB2 UDB Performance
Design Advisor




     © YL&A 1999-2003   47   Practical DB2 UDB Performance
Health Center




     © YL&A 1999-2003   48   Practical DB2 UDB Performance
Trademarks
■ IBM
  –   is a registered trademark of International Business Machines
      Corporation.
■ DB2
  –   is a tr...
Cost Avoidance Through Performance Audits
■ DB2 Performance Audits
  –   Existing or new database designs and applications...
Thank You




© YL&A 1999-2003      51       Practical DB2 UDB Performance
Upcoming SlideShare
Loading in...5
×

Practical DB2 UDB Performance

463

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
463
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
44
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Practical DB2 UDB Performance

  1. 1. Practical DB2 UDB Performance John Maenpaa Senior Consultant John_Maenpaa@ylassoc.com
  2. 2. Practical DB2 UDB Performance © Copyright 1998-2003 Yevich, Lawson & Associates, Inc. All Rights Reserved Yevich, Lawson & Associates. Inc. 3900 Wood Duck Dr. Suite D Springfield, IL 62707 TEL: 1-888-246-5049 INT’L: 1-217-698-8142 FAX : 1-217-698-8143 www.ylassoc.com info@ylassoc.com Developed by: John Maenpaa © YL&A 1999-2003 2 Practical DB2 UDB Performance
  3. 3. Disclaimer PLEASE READ THE FOLLOWING NOTICE The information contained in this presentation is based on techniques, algorithms, and documentation published by the several authors and companies, and in addition is the result of research. It is therefore subject to change at any time without notice or warning. The information contained in this presentation has not been submitted to any formal tests or review and is distributed on an “As is” basis without any warranty, either expressed or implied. The use of this information or the implementation of any of these techniques is a client responsibility and depends on the client’s ability to evaluate and integrate them into the client’s operational environment. While each item may have been reviewed for accuracy in a specific situation, there is no guarantee that the same or similar results will be obtained elsewhere. Clients attempting to adapt these techniques to their own environments do so at their own risks. Foils, handouts, and additional materials distributed as part of this presentation or seminar should be reviewed in their entirety. This presentation may contain information about software releases that are not yet Generally Available. Material is subject to change. YL&A is not responsible for the accuracy of the information. IBM is not responsible for the accuracy of the information or delivery of unreleased features discussed in this presentation. © YL&A 1999-2003 3 Practical DB2 UDB Performance
  4. 4. Abstract This presentation will serve as an introduction to performance monitoring UDB databases. The target audience will be DBA’s who have little or no system or performance tuning experience. The goal of this presentation is to cut through the mounds of performance issues, and focus on the big things which can be easily addressed by applying a few practical techniques. The system monitors, snapshot monitors, event monitors, and control center monitoring will be discussed, as well as a simple and practical approach to utilizing these tools quickly and effectively. © YL&A 1999-2003 4 Practical DB2 UDB Performance
  5. 5. Define Performance Tuning ■ Performance – Behavior of computer under a specific workload ■ Performance Measurement – Response time – Throughput – Availability ■ Performance Tuning – Iterative – Long-Term – Application Specific – Balancing Act © YL&A 1999-2003 5 Practical DB2 UDB Performance
  6. 6. Balancing Resources ■ Processor (CPU) ■ Memory ■ I/O ■ Network ■ People ■ Money © YL&A 1999-2003 6 Practical DB2 UDB Performance
  7. 7. Quick-start Tips ■ Collect statistics – The optimizer can’t do its job without them ■ Workload Performance Wizard – Guides that helps tune queries ■ Health Center – Provides a set of monitoring and tuning tools ■ Design Advisor Tool (db2advis) – Find out what indexes may improve query performance ■ Activate the database – ACTIVATE DATABASE command – Initializes database on all partitions – Avoid startup time on first connection © YL&A 1999-2003 7 Practical DB2 UDB Performance
  8. 8. Instances and Databases ■ Instance – Database Manager – System Administration – Communication – Attach-level ■ Database – Contains Data – Application – Connect-level © YL&A 1999-2003 8 Practical DB2 UDB Performance
  9. 9. Practical DB2 UDB Performance DB2 Monitors © YL&A 1999-2003 9 Practical DB2 UDB Performance
  10. 10. Monitor Switches ■ Setting Defaults ■ Setting Interactively ■ Counter Reset © YL&A 1999-2003 10 Practical DB2 UDB Performance
  11. 11. Commands ■ Get Monitor Switches ■ Set Monitor Switches ■ List Applications Show Detail ■ db2mtrk ■ db2expln © YL&A 1999-2003 11 Practical DB2 UDB Performance
  12. 12. Snapshot Monitors ■ Get Snapshot For DBM ■ Get Snapshot For All Databases ■ Get Snapshot For All Applications ■ Get Snapshot For Dynamic SQL on database © YL&A 1999-2003 12 Practical DB2 UDB Performance
  13. 13. Get Snapshot >>-GET SNAPSHOT FOR---------------------------------------------> >--+-+-DATABASE MANAGER-+--WRITE TO FILE-------------+----------> | +-DB MANAGER-------+ | | '-DBM--------------' | +-ALL--+-----+--DATABASES-------------------------+ | '-DCS-' | +-ALL--+-----+--APPLICATIONS----------------------+ | '-DCS-' | +-ALL BUFFERPOOLS---------------------------------+ +-+-----+--APPLICATION--+-APPLID--appl-id------+--+ | '-DCS-' '-AGENTID--appl-handle-' | +-FCM FOR ALL DBPARTITIONNUMS---------------------+ +-LOCKS FOR APPLICATION--+-APPLID--appl-id------+-+ | '-AGENTID--appl-handle-' | +-ALL REMOTE_DATABASES----------------------------+ +-ALL REMOTE_APPLICATIONS-------------------------+ '-+-ALL-------------------+--ON--database-alias---' +-+-----+--+-DATABASE-+-+ | '-DCS-' '-DB-------' | +-+-----+--APPLICATIONS-+ | '-DCS-' | +-TABLES----------------+ +-TABLESPACES-----------+ +-LOCKS-----------------+ +-BUFFERPOOLS-----------+ +-REMOTE_DATABASES------+ +-REMOTE_APPLICATIONS---+ '-DYNAMIC SQL-----------' © YL&A 1999-2003 13 Practical DB2 UDB Performance
  14. 14. Get Snapshot for Dynamic SQL Number of executions = 1 Number of compilations = 1 Worst preparation time (ms) = 10 Best preparation time (ms) = 10 Internal rows deleted = 0 Internal rows inserted = 0 Rows read = 3 Internal rows updated = 0 Rows written = 0 Statement sorts = 0 Total execution time (sec.ms) = 0.011386 Total user cpu time (sec.ms) = 0.000000 Total system cpu time (sec.ms) = 0.000000 Statement text = UPDATE ONTRACK SET TWCS_580 = '0´0´0' WHERE ONTRACKID = '1007371_CHELSEAEVANS_1' © YL&A 1999-2003 14 Practical DB2 UDB Performance
  15. 15. Event Monitor SET EVENT MONITOR EVENT_MON_STATE(EVEMONNAME) Catalog: Active Event Monitor Monitor Definition CREATE EVENT MONITOR Named Pipe File(s) DROP EVENT MONITOR DB2EVMON SELECT EVMONNAME, CASE WHEN EVENT_MON_STATE (EVMONNAME) = THEN 'Inactive' WHEN EVENT_MON_STATE (EVMONNAME) = THEN 'Active' END FROM SYSCAT.EVENTMONITORS © YL&A 1999-2003 15 Practical DB2 UDB Performance
  16. 16. Event Monitors ■ Deadlocks ■ Statements © YL&A 1999-2003 16 Practical DB2 UDB Performance
  17. 17. Practical DB2 UDB Performance External Monitors © YL&A 1999-2003 17 Practical DB2 UDB Performance
  18. 18. Processor ■ top ■ ps ■ Task Manager ■ Performance Monitor © YL&A 1999-2003 18 Practical DB2 UDB Performance
  19. 19. Looking at Processes ■ top ■ ps -ef ■ ps -aux ■ Windows Task Manager © YL&A 1999-2003 19 Practical DB2 UDB Performance
  20. 20. Output from "top" top - 08:37:51 up 11:15, 0 users, load average: 0.61, 0.33, 0.20 Tasks: 108 total, 5 running, 103 sleeping, 0 stopped, 0 zombie Cpu(s): 86.8% user, 13.2% system, 0.0% nice, 0.0% idle Mem: 774608k total, 767504k used, 7104k free, 70372k buffers Swap: 1028152k total, 24776k used, 1003376k free, 471492k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ Command 3979 jmaenpa 20 0 16768 13m 11m R 82.0 1.8 0:09.58 kdeinit 4822 jmaenpa 11 0 250m 250m 250m R 7.9 33.1 42:16.16 vmware 4156 jmaenpa 11 0 9492 9472 4576 S 4.9 1.2 0:00.58 db2bp 4202 jmaenpa 11 0 7520 7512 3148 S 2.3 1.0 0:00.25 db2 4082 jmaenpa 12 0 1032 1032 808 R 1.3 0.1 0:01.86 top 2035 jmaenpa 8 0 10772 7620 7520 S 0.3 1.0 0:00.26 kdeinit 2313 jmaenpa 9 0 18176 15m 12m R 0.3 2.0 0:12.83 kdeinit 4157 db2inst1 9 0 34500 33m 32m S 0.3 4.4 0:00.16 db2sysc 1 root 8 0 512 464 448 S 0.0 0.1 0:03.47 init 2 root 9 0 0 0 0 S 0.0 0.0 0:00.42 keventd 3 root 18 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd_CPU0 4 root 9 0 0 0 0 S 0.0 0.0 0:00.82 kswapd © YL&A 1999-2003 20 Practical DB2 UDB Performance
  21. 21. Output from "ps -aux" USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1720 0.0 0.1 6072 1404 ? S Dec02 0:00 /opt/IBM/db2/V8.1/bin/db2fmcd db2as 1774 0.0 0.2 9304 2040 ? S Dec02 0:00 /home/db2as/das/bin/db2fmd -i d db2as 2254 0.0 0.2 10248 2052 ? S Dec02 0:00 /home/db2as/das/adm/db2dasrrm db2as 2255 0.0 0.2 10248 2052 ? S Dec02 0:00 /home/db2as/das/adm/db2dasrrm db2as 2256 0.0 0.2 10248 2052 ? S Dec02 0:00 /home/db2as/das/adm/db2dasrrm db2as 2258 0.0 0.2 10248 2052 ? S Dec02 0:00 /home/db2as/das/adm/db2dasrrm db2as 2260 0.0 0.2 10248 2052 ? S Dec02 0:00 /home/db2as/das/adm/db2dasrrm db2as 2261 0.0 0.2 10248 2052 ? S Dec02 0:00 /home/db2as/das/adm/db2dasrrm db2as 2262 0.0 0.2 10248 2052 ? S Dec02 0:00 /home/db2as/das/adm/db2dasrrm jmaenpa 3982 0.0 0.1 2308 1364 pts/1 S 08:34 0:00 /bin/bash root 4051 0.1 2.6 85876 20868 pts/1 S 08:34 0:00 db2wdog db2inst1 4056 0.0 2.9 86132 22996 pts/1 S 08:35 0:00 db2sysc root 4057 0.0 2.6 85876 20904 pts/1 S 08:35 0:00 db2ckpwd root 4058 0.0 2.6 85876 20904 pts/1 S 08:35 0:00 db2ckpwd root 4059 0.0 2.6 85876 20904 pts/1 S 08:35 0:00 db2ckpwd root 4060 0.0 2.6 85876 20908 pts/1 S 08:35 0:00 db2gds db2inst1 4061 0.0 2.7 86084 21164 pts/1 S 08:35 0:00 db2syslog db2inst1 4062 0.0 2.7 86084 21236 pts/1 S 08:35 0:00 db2ipccm db2inst1 4063 0.0 2.9 86132 22928 pts/1 S 08:35 0:00 db2tcpcm db2inst1 4064 0.0 2.9 86132 22992 pts/1 S 08:35 0:00 db2resync db2inst1 4065 0.0 2.7 85876 20928 pts/1 S 08:35 0:00 db2srvlst jmaenpa 4156 2.0 1.2 27120 9472 pts/2 S 08:36 0:03 /home/db2inst1/sqllib/bin/db2bp db2inst1 4157 0.2 4.4 123624 34456 pts/1 S 08:36 0:00 db2agent (GDMS0401) db2inst1 4160 0.0 2.7 122768 21052 pts/1 S 08:36 0:00 db2loggr (GDMS0401) db2inst1 4161 0.0 2.7 122756 20952 pts/1 S 08:36 0:00 db2loggw (GDMS0401) db2inst1 4162 0.0 2.7 122756 21340 pts/1 S 08:36 0:00 db2dlock (GDMS0401) db2inst1 4163 0.0 2.8 122760 21768 pts/1 S 08:36 0:00 db2pfchr db2inst1 4164 0.0 2.7 122756 21472 pts/1 S 08:36 0:00 db2pfchr db2inst1 4165 0.0 2.7 122756 21016 pts/1 S 08:36 0:00 db2pfchr db2inst1 4166 0.0 2.7 122756 21168 pts/1 S 08:36 0:00 db2pclnr db2inst1 4167 0.0 2.7 85880 20972 pts/1 S 08:36 0:00 db2event (DB2DETAILDEADLOCK) jmaenpa 4202 1.8 0.9 22912 7512 pts/2 S 08:37 0:01 db2 © YL&A 1999-2003 21 Practical DB2 UDB Performance
  22. 22. Output from "ps -ef" UID PID PPID C STIME TTY TIME CMD root 1720 1 0 Dec02 ? 00:00:00 /opt/IBM/db2/V8.1/bin/db2fmcd db2as 2254 1 0 Dec02 ? 00:00:00 /home/db2as/das/adm/db2dasrrm db2as 2255 2254 0 Dec02 ? 00:00:00 /home/db2as/das/adm/db2dasrrm db2as 2256 2255 0 Dec02 ? 00:00:00 /home/db2as/das/adm/db2dasrrm db2as 2258 2255 0 Dec02 ? 00:00:00 /home/db2as/das/adm/db2dasrrm db2as 2260 2255 0 Dec02 ? 00:00:00 /home/db2as/das/adm/db2dasrrm db2as 2261 2255 0 Dec02 ? 00:00:00 /home/db2as/das/adm/db2dasrrm db2as 2262 2255 0 Dec02 ? 00:00:00 /home/db2as/das/adm/db2dasrrm root 4051 1 0 08:34 pts/1 00:00:00 db2wdog db2inst1 4056 4051 0 08:35 pts/1 00:00:00 db2sysc root 4057 4056 0 08:35 pts/1 00:00:00 db2ckpwd root 4058 4056 0 08:35 pts/1 00:00:00 db2ckpwd root 4059 4056 0 08:35 pts/1 00:00:00 db2ckpwd root 4060 4056 0 08:35 pts/1 00:00:00 db2gds db2inst1 4061 4056 0 08:35 pts/1 00:00:00 db2syslog db2inst1 4062 4056 0 08:35 pts/1 00:00:00 db2ipccm db2inst1 4063 4056 0 08:35 pts/1 00:00:00 db2tcpcm db2inst1 4064 4056 0 08:35 pts/1 00:00:00 db2resync db2inst1 4065 4060 0 08:35 pts/1 00:00:00 db2srvlst jmaenpa 4156 1 2 08:36 pts/2 00:00:04 /home/db2inst1/sqllib/bin/db2bp 4089C1001 5 db2inst1 4157 4062 0 08:36 pts/1 00:00:00 db2agent (GDMS0401) db2inst1 4160 4060 0 08:36 pts/1 00:00:00 db2loggr (GDMS0401) db2inst1 4161 4060 0 08:36 pts/1 00:00:00 db2loggw (GDMS0401) db2inst1 4162 4060 0 08:36 pts/1 00:00:00 db2dlock (GDMS0401) db2inst1 4163 4060 0 08:36 pts/1 00:00:00 db2pfchr db2inst1 4164 4060 0 08:36 pts/1 00:00:00 db2pfchr db2inst1 4165 4060 0 08:36 pts/1 00:00:00 db2pfchr db2inst1 4166 4060 0 08:36 pts/1 00:00:00 db2pclnr db2inst1 4167 4060 0 08:36 pts/1 00:00:00 db2event (DB2DETAILDEADLOCK) jmaenpa 4202 4089 1 08:37 pts/2 00:00:01 db2 © YL&A 1999-2003 22 Practical DB2 UDB Performance
  23. 23. Windows Task Manager Process View © YL&A 1999-2003 23 Practical DB2 UDB Performance
  24. 24. Memory Hierarchy Database Manager Shared Memory Database Global (numdb) Database Global Memory Memory Application Global (maxappls) Application Global Memory Memory Agent Private (maxagents) Agent Private Memory Memory © YL&A 1999-2003 24 Practical DB2 UDB Performance
  25. 25. Database Global Memory Database Manager Shared Memory Utility Heap Database Heap util_heap_sz dbheap Database Global Backup Buffer Log Buffer Memory Bufferpools logbufsz Restore Buffer Catalog Cache Extended Memory restbufsz catalogcache_sz Application Global Cache Memory Package Cache Lock List pckcachesz locklist Agent Private Memory © YL&A 1999-2003 25 Practical DB2 UDB Performance
  26. 26. Database Global Memory Database Global Memory Application Database Services: Log Program Agent RDS= Relational Data Services Buffer DMS= Data Management Services Log BPS= Buffer Pool Services Writes: LMS= Log Manager Services Wrap Commit Logfiles Buffer Pool Descriptive Area Log Write Head Buffer Pools Changed Pages I/O Servers Page Cleaners Threshold Table Spaces © YL&A 1999-2003 26 Practical DB2 UDB Performance
  27. 27. Global SQL Cache Dynamic SQL Cache Static SQL Cache User 1 Section Section Section Section Catalog Tables SQL Section Section Section Section Application Compiler A User 2 Section Section Application B © YL&A 1999-2003 27 Practical DB2 UDB Performance
  28. 28. Looking at DB2 Memory Usage ■ Operating System Tools – vmstat – ps – Windows Task Manager – Windows Performance Monitor ■ DB2 Memory Visualizer – db2memvis ■ DB2 Memory Tracker – db2mtrk – Current Usage – Maximums – Watermarks © YL&A 1999-2003 28 Practical DB2 UDB Performance
  29. 29. Output from "vmstat" procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 61260 86448 27388 436992 0 1 17 15 166 508 6 6 88 0 4 0 61260 86412 27420 436996 0 0 0 10 1190 3211 89 11 0 0 6 0 61260 86396 27436 436996 0 0 0 6 1188 3157 88 12 0 0 4 0 61260 86328 27472 436996 0 0 0 14 1343 3323 92 8 0 0 4 0 61260 86312 27488 436996 0 0 0 6 1375 3270 89 11 0 0 © YL&A 1999-2003 29 Practical DB2 UDB Performance
  30. 30. Output from "DB2 Memory Visualizer" © YL&A 1999-2003 30 Practical DB2 UDB Performance
  31. 31. Output from "db2mtrk" $ db2mtrk -i -p -w -d -v Tracking Memory on: 2002/12/03 at 10:03:26 Memory for instance Database Monitor Heap has watermark of 180224 bytes Other Memory has watermark of 5226496 bytes Total: 5406720 bytes Memory for database: GDMS0401 Backup/Restore/Util Heap has watermark of 16384 bytes Package Cache has watermark of 327680 bytes Catalog Cache Heap has watermark of 81920 bytes Buffer Pool Heap has watermark of 4341760 bytes Buffer Pool Heap has watermark of 671744 bytes Buffer Pool Heap has watermark of 409600 bytes Buffer Pool Heap has watermark of 278528 bytes Buffer Pool Heap has watermark of 212992 bytes Lock Manager Heap has watermark of 458752 bytes Database Heap has watermark of 1540096 bytes Other Memory has watermark of 0 bytes Total: 8339456 bytes Memory for agent 4157 Application Heap has watermark of 212992 bytes Application Control Heap has watermark of 16384 bytes Total: 229376 bytes © YL&A 1999-2003 31 Practical DB2 UDB Performance
  32. 32. I/O Tuning ■ Data Placement ■ Index Placement ■ DMS or SMS Agent Data Index LOB © YL&A 1999-2003 32 Practical DB2 UDB Performance
  33. 33. Storage Distribution – Logs ■ Log Placement Agent Log Writer Logs Logs Data Index LOB © YL&A 1999-2003 33 Practical DB2 UDB Performance
  34. 34. Storage ■ iostat ■ Performance Monitor © YL&A 1999-2003 34 Practical DB2 UDB Performance
  35. 35. Output from “iostat” tty: tin tout avg-cpu: % user % sys % idle % iowait 0.0 0.7 10.4 7.1 66.2 16.2 Disks: % tm_act Kbps tps Kb_read Kb_wrtn hdisk0 2.4 22.3 3.5 882928 1204548 hdisk1 2.3 13.5 3.1 51513 1205556 hdisk2 0.0 0.2 0.0 7926 8591 hdisk3 0.0 2.7 0.1 244815 8667 hdisk5 0.4 5.8 0.6 398895 141241 hdisk6 1.5 9.3 1.5 507399 358925 hdisk8 0.6 4.4 0.7 378227 29820 hdisk10 0.4 6.2 0.5 432079 150080 hdisk7 1.2 8.1 1.5 145979 610140 hdisk9 0.5 6.2 0.7 443075 133559 hdisk4 1.8 17.2 2.5 995893 610140 hdisk11 0.4 6.1 0.5 439219 128642 hdisk13 1.9 19.1 2.6 1438816 348162 © YL&A 1999-2003 35 Practical DB2 UDB Performance
  36. 36. Performance Monitor © YL&A 1999-2003 36 Practical DB2 UDB Performance
  37. 37. Applications ■ Static SQL – Explain ■ Dynamic SQL – Snapshot – Explain © YL&A 1999-2003 37 Practical DB2 UDB Performance
  38. 38. Practical DB2 UDB Performance GUI Tools © YL&A 1999-2003 38 Practical DB2 UDB Performance
  39. 39. Control Center © YL&A 1999-2003 39 Practical DB2 UDB Performance
  40. 40. Configuration Advisor ■ Better than parameter defaults ■ User input – Database description – Memory availability – Workload – Locking ■ Overrides permitted © YL&A 1999-2003 40 Practical DB2 UDB Performance
  41. 41. Visual Explain © YL&A 1999-2003 41 Practical DB2 UDB Performance
  42. 42. Design Advisor ■ Workload – Single SQL statement – SQL statements with frequencies ■ Recommends indexes for queries ■ Uses optimizer to compare candidates © YL&A 1999-2003 42 Practical DB2 UDB Performance
  43. 43. Design Advisor © YL&A 1999-2003 43 Practical DB2 UDB Performance
  44. 44. Design Advisor © YL&A 1999-2003 44 Practical DB2 UDB Performance
  45. 45. Design Advisor © YL&A 1999-2003 45 Practical DB2 UDB Performance
  46. 46. Design Advisor © YL&A 1999-2003 46 Practical DB2 UDB Performance
  47. 47. Design Advisor © YL&A 1999-2003 47 Practical DB2 UDB Performance
  48. 48. Health Center © YL&A 1999-2003 48 Practical DB2 UDB Performance
  49. 49. Trademarks ■ IBM – is a registered trademark of International Business Machines Corporation. ■ DB2 – is a trademark of IBM Corp. © YL&A 1999-2003 49 Practical DB2 UDB Performance
  50. 50. Cost Avoidance Through Performance Audits ■ DB2 Performance Audits – Existing or new database designs and applications – Certification of design and implementation acceptance – Evaluation of all the performance ‘points’ in a DB2 environment ■ Physical Design ■ Subsystem ■ Application Code and SQL Specific to your needs! © YL&A 1999-2003 50 Practical DB2 UDB Performance
  51. 51. Thank You © YL&A 1999-2003 51 Practical DB2 UDB Performance
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×