IBM Support

How to collect DB2 diagnose data if reproduce the issue hangs the DB2 host machine

Technical Blog Post


Abstract

How to collect DB2 diagnose data if reproduce the issue hangs the DB2 host machine

Body

Sometimes customer encounters issue that hangs the DB2 host machine. In this situation, no command can be issued on the host machine, nor can connect to it. Which makes collecting data impossible when the host machine hangs. So we have to use the time window between starting of reproduce and the server hang to collect the data. Sometimes this window is not long enough for all the commands to be finished, to withhold the window and collect as much data as possible, we can force sending "sigstop" to stop db2sysc, and collect data, then send "sigcont" to let it continue and "sigstop" again, to stop db2sysc to collect data to see what is changed.

 

On terminal-1:

  1. db2start
  2. find out db2sysc-pid
  3. db2 connect to db <dbname>
  4. Reproduce the issue

On terminal 2:

  1. kill -SIGSTOP <db2sysc-pid>
  2. Collect data, for example
    1. ps -elf > ps_elf.out
    2. pstack <db2sysc-pid> > db2sysc.<time>.stack # this will hang

On terminal 3:

  1. kill -SIGCONT <db2sysc-pid> # this will allow pstack to produce the stack of all threads on terminal 3
  2. wait for 10 seconds

Then repeat steps on terminal 2 and 3 again for as many iterations as needed.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm13286707