IBM Support

How to collect basic data for initial investigation of DB2 memory issue ?

Question & Answer


Question

What is a list of commands?

Cause

DB2 memory usage issues are closed with Operating system.

Answer

1. Operating system data.

(1) Getting db2sysc process ID.
Some commands needs db2sysc process ID as an parameter.
You can find the db2sysc process ID with following command.

As an db2 instance user,
$ db2pd -edu |grep "db2sysc PID" |awk '{print $3;}'

or


ps -ef |grep db2sysc

(2) Gathering data for each operating system.

< Common for AIX, HP-UX, Solaris and Linux only>
ps -elf > ps_elf.out
ps aux > ps_aux.out
vmstat 1 5 > vmstat_1_5.out
ipcs -am > ipcs_am.out

<AIX Only>
vmstat -v > vmstat_v.out
svmon -G > svmon_G.out
svmon -P <db2sysc process ID> > svmon_P.out
svmon -U <db2 instance user id>  > svmon_U.out
vmo -a > vmo.out
lsps -a > lsps.out


<Linux Only>
top -b -n 1 > top.out
free > free.out
cat /proc/meminfo > meminfo.out
cat /proc/<db2sysc PID>/maps > maps.out


<Solaris Only>
pmap -x <db2sysc PID>  > pmap.out
prstat > prstat.out

<Windows only>
(1) Using 'Performance Monitor' in Windows O/S

Run the 'Performance Monitor' tool and add counters for monitoring memory behavior.
For detail, refer the following link.

https://technet.microsoft.com/en-us/magazine/2008.08.pulse.aspx#id0120026

or

(2) Using 'db2pd -vmstat'

 Usage : -vmstat [t] [interval] [count] [computername]


example )


E:\>db2pd -vmstat t 1 10 WIN-F1D0IH1UJ3P


run            memory                system             CPU
--- --------------------------- ----------------- ---------------
  r     used     free   pi   po int/s  cs/s  sc/s usr sys idl int
  2  3391472  6122196    0    0     0     0 192600   0   0 100   0   18:54:03
  1  3392256  6121920    0    0    86  3000  7956   0   2  98   0   18:54:04
  1  3392284  6121484    0    0    74  1410  5360   0   0 100   0   18:54:05
.....


2. In db2 instance user please collect

db2mtrk -a -i -d  -p  > db2mtrk.out

db2pd -dbptnmem
db2pd -inst -memsets -mempool > db2pd_mem_inst.out
db2pd -alldbs -memsets -mempool > db2pd_mem_dbs.out


db2pd -alldbs -app -agent -activestatement -util -edu > db2pd_app.out

3. When you need to check the detail and leak problem of a certain memory pool,
use the 'db2pd -memblock' option.

NOTE : '-memblock' option can affect DB2 server performance and take long time.
Therefore only use this option in case this data is necessary.
If you are not sure, please consult with IBM support representative.


(For example, for 'sort' area memory pool)

db2pd -memblock sort > db2pd_memblock_inst.out
db2pd -alldbs -memblock sort > db2pd_memblock_dbs.out


3. Please also collect db2support with following command
db2support . -d <dbname> -s -o db2support.zip

Related Information

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Operating System \/ Hardware - Memory Management","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21635446