IBM DB2® Universal Database™
DB2 Problem Determination Tutorial Series
______________________________________________
Combining DB2 and OS Diagnostics
DB2 Problem Determination Tutorial Series
Combining DB2 and OS Diagnostics
________________________________________________________________
2 © Copyright IBM Corp. 2003
Table of Contents
Combining DB2 and OS Diagnostics ................................................................................................. 3
About this tutorial........................................................................................................................... 3
Tutorial objectives....................................................................................................................... 3
Audience and assumptions.......................................................................................................... 3
Pre-tutorial setup ......................................................................................................................... 4
Tutorial conventions used ........................................................................................................... 4
About the author.......................................................................................................................... 5
Understanding the environment...................................................................................................... 6
Introduction to system configuration and user environment information.................................. 6
Relevant DB2 configuration information................................................................................... 8
Obtaining configuration information on specific platforms ....................................................... 9
Diagnostic and event logs ............................................................................................................. 11
Correlating DB2 and system events or errors ........................................................................... 11
System error and message logs on UNIX® .............................................................................. 12
Windows® event logs and the Dr. Watson log......................................................................... 12
Identifying and researching operating system errors ................................................................ 13
Operating system error examples on UNIX.................................................................................. 15
Hitting a file size limit .............................................................................................................. 15
Per-process IPC limits............................................................................................................... 16
System-wide IPC limits ............................................................................................................ 17
Defining a performance problem, initial data collection.............................................................. 19
Clarifying the problem.............................................................................................................. 19
System diagnostics that can be performed quickly................................................................... 20
DB2 diagnostics that can be performed quickly....................................................................... 21
DB2 function call stacks, trap files, and tracing ....................................................................... 22
Formatting stack dump files on Windows ................................................................................ 23
Using perfmon on Windows ..................................................................................................... 24
Avoiding pitfalls and a first glance at system data ................................................................... 28
DB2 snapshot elements associated with system resource usage .............................................. 29
Performance problem examples.................................................................................................... 31
Too much system CPU ............................................................................................................. 31
Too much I/O ............................................................................................................................ 31
Too much memory.................................................................................................................... 33
Summary....................................................................................................................................... 35
Where to go from here .............................................................................................................. 35
DB2 Problem Determination Tutorial Series
Combining DB2 and OS Diagnostics
________________________________________________________________
© Copyright IBM Corp. 2003. 3
Combining DB2 and OS Diagnostics
About this tutorial
Tutorial objectives
The objectives of this tutorial are to guide you through the initial steps in defining and diagnosing
system errors and performance problems that involve DB2. Specifically, you will learn the
following things:
• What information to collect from DB2 tools and logs
• What information to collect from operating system tools and logs
• What environmental information to collect
• How to use all this information together in problem investigation.
Topics include understanding configuration, performance and resource monitoring, and basic
diagnostic log analysis.
The following platforms are covered:
• AIX
• Solaris
• HP-UX
• Linux
• Windows
Audience and assumptions
This tutorial is for anybody who reports or analyzes DB2 problems where at least one of these
conditions applies:
• The operating system or user environment may be a factor
• There is an issue with a resource managed by the operating system, such as CPU, memory,
interprocess communication (IPC) resources, or disks
In order to take this tutorial, it is assumed that you have the following skills:
• Are familiar with the basic concepts of an operating system - including RAM, CPU, virtual
memory, IPC resources, and I/O
• Are familiar with basic operating system commands
• Understand DB2 concepts including bufferpools, tablespaces, sorting, parallelism, the idle
agent pool, and DB2 process names
DB2 Problem Determination Tutorial Series
Combining DB2 and OS Diagnostics
________________________________________________________________
4 © Copyright IBM Corp. 2003
Prior to taking this tutorial, it is suggested that you review the following chapters from the DB2
v7.2 Administration Guide:
Chapter 4 - Parallel Database Systems
Chapter 20 - Elements of Performance
Chapter 21 - Architecture and Processes Overview
Chapter 27 - Operational Performance
Chapter 32 - Configuring DB2
Appendix M - Using the Windows NT® Performance Monitor
The Administration Guide can be viewed online at the DB2 Technical Support Web site:
http://www-3.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/document.d2w/report?fn=db2v7d0frm3toc.htm
Pre-tutorial setup
DB2 Enterprise Edition, version 7.2 FixPak or greater should be installed on the platforms you
have available. Some examples illustrate platform-specific behaviour or tools on AIX, Linux,
Solaris, and Windows. It is possible to work through some of the UNIX examples on any of the
supported UNIX platforms, though specific commands and their output will differ.
The SAMPLE database should be created with the db2sampl command.
You should have administrator privileges on the systems where you are working. If administrator
privileges cannot be obtained, there are a few exercises that you might not be able to complete.
Note: Some examples in this tutorial will create stress on the system, so other users may be
affected. The system may also become unstable.
Tutorial conventions used
When a tool or utility is first mentioned it will be shown in bold text.
All commands and their output will be shown in a monospace font.
Some examples will show specific command options that may change over time, but these changes
will always be documented in DB2 UDB documentation.
DB2 Problem Determination Tutorial Series
Combining DB2 and OS Diagnostics
________________________________________________________________
© Copyright IBM Corp. 2003. 5
About the author
Michael Cornish is a senior technical analyst with the DB2 UDB Support Team. He specializes in
memory-related issues, system performance, and solving problems which cross the boundary
between DB2 and operating systems.
You can reach Michael by locating his e-mail address in the IBM Global Directory at
http://www.ibm.com/contact/employees/us .