Ember Basics - Monitoring - Troubleshooting - Virtual
Ember Basics - Monitoring - Troubleshooting - Virtual
Troubleshooting Db2
Ember Crooks
1
Agenda
• Db2 Documentation
• Error Messages
• Db2 Diagnostic Log
• Overview of Monitoring Tools:
• db2top
• dsmtop
• dmctop
• monreport Module
• mon_get Table Functions and Views
Troubleshooting Methodology
Take a Systemic Approach
Ember’s Foundations for Troubleshooting
4
Methodical Troubleshooting
5
Don’t :
Panic
7
Bottlenecks
8
Db2 Documentation
Navigating the IBM Db2 Knowledge Center
IBM Db2 Knowledge Center – Search Box
10
Search – Inline Preview
11
IBM Db2 Knowledge Center – Version Dropdown
12
IBM Db2 Knowledge Center – Table of Contents
13
IBM Db2 Knowledge Center –
Navigating from the Table of Contents
14
Command Page
Syntax diagram
16
How to Read a Db2 Syntax Diagram (1|4)
• Read the syntax diagrams from left to right and top to bottom,
following the path of the line.
• The >>-- symbol indicates the beginning of a syntax diagram.
• The --> symbol indicates that the syntax is continued on the next line.
• The >-- symbol indicates that the syntax is continued from the
previous line.
• The -->< symbol indicates the end of a syntax diagram.
• A word or phrase in a box indicates a parameter block.
17
How to Read a Db2 Syntax Diagram (2|4)
20
Configuration Parameter
Configuration Type
Wait until it
works again
Knowledge
Center Down! Try a different
browser
23
PDF Documentation
24
Db2 Error Messages
A Wealth of Information in a Small Package
Important Information in Error Message or SQLCA
Required: Optional:
• Error number • Object identifiers Full Error
• Basic text • Names Message
description of • Numbers
error • Reason Codes
26
Error Messages
• https://www.ibm.com/support/knowledgecenter/en/SSEPGG_10.5.0/com.ibm.db2.luw.messages.doc/doc/c0052007.html
Getting Information on Errors – Command Line (1|2)
$ db2 ? SQL0911N
Explanation:
68
72
…
28
Getting Information on Errors – Command Line (2|2)
$ db2 ? SQL0551N
Explanation:
29
IBM Knowledge Center:
Anatomy of an Error
Error number and generic error text
34
Parsing db2diag.log with the db2diag Tool
• To display all messages in the last hour:
db2diag –H 1h
• To display all error level messages:
db2diag -level error
• To display all error messages containing the DB2 ZRC return code 0x87040055, and the
application ID G916625D.NA8C.068149162729:
db2diag -g msg:=0x87040055 -l Error | db2diag -gi appid^=G916625D.NA
• To display all messages logged after the one with timestamp 2017-08-15-00.00.00.000000
inclusively:
db2diag -time 2017-08-15-00.00.00.000000
• To display severe errors logged for the last three days (using slightly different syntax for
the level of error:
db2diag -gi "level=severe" -H 3d
• To call db2diag from a Perl script using default settings, enter:
system("db2diag -readfile");
Searching and Formatting using db2diag
$ db2diag -e 4500 -fmt %dataobject
DATA #1 :
Package Cache Overflow
memory needed : 10592
current used size (OSS) : 134106751
maximum cache size (APM) : 130191196
maximum logical size (OSS): 134150417
maximum used size (OSS) : 215154688
owned size (OSS) : 137101312
number of overflows : 9400
Monitoring Tools
Many Methods to Understand what is Happening
Types of Monitoring
Historical Performance
Monitoring
Real-Time Monitoring
• Why was the database
slow at 2 PM on • What is happening right Monitoring to
Thursday? now? Generate Alerts
• What trends to we see in • Why is the database slow
right now? • What condition exists that
performance
risk imminent outage?
• What red flags do we see • What is causing this effect
indicating potential that someone is seeing?
performance problem
areas?
38
Real-Time Monitoring
39
Memory Metrics
Remote Access
Lightweight In-
Oldest Version
Reset Metrics
Update Info
Deprecated
Connection
Requires
Use SQL
db2top On-screen N N Y Y N Y <9.1, fp6>
41
db2top – Help Screen
42
db2top – Interval and Cumulative
44
db2top – Lock Chaining
47
dmctop
• Start with
dmctop –d dbname
• CPU usage not
always accurate
• Read efficiency!
• db2top shortcuts
work when the
Menu pane is
active
48
dmctop Time Modes
• Delta • Actual
• Refreshes every 10 seconds by • Refreshes every 10 seconds by
default default
• Values are • Values are always since database
• Since dmctop was started restart, even if you reset baseline
• Since that dmctop screen was first used
• Since baseline was reset
• Some values per minute or per
second
49
dmctop:
Time Spent
50
db2pd – a Few Useful Options
• mempools
• memsets
• osinfo
• wlocks
• repeat
• bufferpools
• hadr
MONREPORT.DBSUMMARY
• Good summary of data
• Snapshot-like format that uses more recent monitoring infrastructure
• Snipets…
Part 1 - System performance
<SNIP>
Sort
--------------------------------------------------------------------------------
TOTAL_SORTS = 4
SORT_OVERFLOWS = 0
POST_THRESHOLD_SORTS = 0
POST_SHRTHRESHOLD_SORTS = 0
MON_GET* Functions and Views
MON_GET_CONNECTION MON_GET_SERVICE_SUB MON_GET_UNIT_OF_WO MON_GET_WORKLOAD MON_GET_DATABASE
and CLASS and RK and and and MON_GET_APPL_LOCKW
MON_GET_BUFFERPOOL
MON_GET_CONNECTION MON_GET_SERVICE_SUB MON_GET_UNIT_OF_WO MON_GET_WORKLOAD_ MON_GET_DATABASE_D AIT
_DETAILS CLASS_DETAILS RK_DETAILS DETAILS ETAILS
MON_GET_EXTENDED_L MON_GET_PAGE_ACCESS
MON_GET_CONTAINER MON_GET_INDEX MON_GET_LOCKS MON_GET_TABLE MON_GET_TABLESPACE
ATCH_WAIT _INFO
MON_GET_PKG_CACHE_
MON_GET_TABLE_USAG STMT and MON_GET_AUTO_MAINT MON_GET_AUTO_RUNST MON_GET_EXTENT_MOV MON_GET_REBALANCE_S
MON_GET_RTS_RQST
E_LIST MON_GET_PKG_CACHE_ _QUEUE ATS_QUEUE EMENT_STATUS TATUS
STMT_DETAILS
MON_FORMAT_XML_CO
MON_FORMAT_XML_ME MON_FORMAT_XML_TI MON_FORMAT_XML_WA
MPONENT_TIMES_BY_R
TRICS_BY_ROW MES_BY_ROW IT_TIMES_BY_ROW
OW
55
Querying MON_GET* Table Functions
Member is
Can specify Name of the table
usually one of the
specific columns function
parameters
58
Ember Crooks
ember.crooks@gmail.com
59