db2pd - A db2 monitoring and troubleshooting tool.
In this blog we will see and learn about one of the important db2 tool which a DBA use it on daily basis. The db2pd command is a powerful tool for monitoring and administering DB2 Linux, UNIX and Windows databases and instances. You can use this tool to keep track of transactions, table spaces, table statistics, dynamic SQL, configuration settings and much, much more.
![](https://static.wixstatic.com/media/8531b9_796061e3e2944f5fa6d33e36a851c804~mv2.png/v1/fill/w_566,h_262,al_c,lg_1,q_85,enc_auto/8531b9_796061e3e2944f5fa6d33e36a851c804~mv2.png)
We can use plenty of options with db2pd for retrieving information about operating systems, dynamic SQL, table statistics, database partitions, and also including information about storage, configuration, recovery processes, HADR status, and many more. Below are few examples of troubleshooting DB2 issues using db2pd :
1) To get DB2 instance uptime
db2pd -
![](https://static.wixstatic.com/media/8531b9_ac9e7fda7a574e54b6811fbee7c1a6ac~mv2.png/v1/fill/w_586,h_96,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_ac9e7fda7a574e54b6811fbee7c1a6ac~mv2.png)
2) To get OS information
db2pd -osinfo
![](https://static.wixstatic.com/media/8531b9_f81c58390c0e46f3949c842ae0e6b7df~mv2.png/v1/fill/w_586,h_357,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_f81c58390c0e46f3949c842ae0e6b7df~mv2.png)
3) To get DB2 level
db2pd -V db2pd -version
![](https://static.wixstatic.com/media/8531b9_a85e16cc419a4483abdc0e217565f50f~mv2.png/v1/fill/w_586,h_235,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_a85e16cc419a4483abdc0e217565f50f~mv2.png)
4) To get almost everything db2 databases details
db2pd -d <database name> db2pd -everything
![](https://static.wixstatic.com/media/8531b9_5e414c301a39494aac835c28c1c2071b~mv2.png/v1/fill/w_586,h_399,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_5e414c301a39494aac835c28c1c2071b~mv2.png)
![](https://static.wixstatic.com/media/8531b9_4eb3573255ac4420bfac9f8a674b3564~mv2.png/v1/fill/w_586,h_400,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_4eb3573255ac4420bfac9f8a674b3564~mv2.png)
5) To get useful information about database logs
db2pd -db <database name> -logs
![](https://static.wixstatic.com/media/8531b9_817384f54d7046aabae298595171d203~mv2.png/v1/fill/w_586,h_387,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_817384f54d7046aabae298595171d203~mv2.png)
6) To get db2 database lock information
db2pd -db <database name> -locks
![](https://static.wixstatic.com/media/8531b9_33d14722208f4495b69e5b33517aa9dc~mv2.png/v1/fill/w_586,h_81,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_33d14722208f4495b69e5b33517aa9dc~mv2.png)
7) To get more diagnostic lock information
db2pd -db <database name> -locks -transactions -applications -dynamic
![](https://static.wixstatic.com/media/8531b9_84572978be3e4d499ff70a4780e18184~mv2.png/v1/fill/w_586,h_237,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_84572978be3e4d499ff70a4780e18184~mv2.png)
8) To capture all pending locks
db2pd -wlocks -db <database name>
![](https://static.wixstatic.com/media/8531b9_e30f1aa47eff42999b8ffb306073c58b~mv2.png/v1/fill/w_586,h_88,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_e30f1aa47eff42999b8ffb306073c58b~mv2.png)
If you got any locks here then you can use the -apinfo option with db2pd to capture detailed runtime information about the lock owner and lock waiter
db2pd -apinfo 21 -db <database name>
9) To get db2 database configuration information
db2pd -db <database name> -dbcfg
![](https://static.wixstatic.com/media/8531b9_967196c6f2f14a68ad38e3dfdb5021eb~mv2.png/v1/fill/w_586,h_226,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_967196c6f2f14a68ad38e3dfdb5021eb~mv2.png)
10) To get db2 hadr information
db2pd -db <database name> -hadr
![](https://static.wixstatic.com/media/8531b9_69f2f95306f84be7afef4195f37143e0~mv2.png/v1/fill/w_586,h_101,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_69f2f95306f84be7afef4195f37143e0~mv2.png)
11) To get tablespace containers statistics – total useable pages, used pages, free pages,tablespaces type
db2pd -tablespaces -db <database name>
![](https://static.wixstatic.com/media/8531b9_aeafe5857bbc4ea58148b7714176c3aa~mv2.png/v1/fill/w_586,h_286,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_aeafe5857bbc4ea58148b7714176c3aa~mv2.png)
12) To determine which application runs out of table space
db2pd -tcbstats -db <database name>
![](https://static.wixstatic.com/media/8531b9_31deadcb63a94f48899695aa0312e3ff~mv2.png/v1/fill/w_586,h_167,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_31deadcb63a94f48899695aa0312e3ff~mv2.png)
13) To view memory statistics of database partitions
db2pd -dbptnmem
![](https://static.wixstatic.com/media/8531b9_6d9a2dfd03034c3ca6f607c1c817c168~mv2.png/v1/fill/w_586,h_325,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_6d9a2dfd03034c3ca6f607c1c817c168~mv2.png)
14) To monitor memory usage.
db2pd -memblock
![](https://static.wixstatic.com/media/8531b9_5987bfcb2395402ebce9ba6a4a980a07~mv2.png/v1/fill/w_586,h_190,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_5987bfcb2395402ebce9ba6a4a980a07~mv2.png)
15) To verify whether recovery is in progress
db2pd -db <database name> -recovery
![](https://static.wixstatic.com/media/8531b9_c36595e6396742789d129fcd082b8351~mv2.png/v1/fill/w_586,h_99,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_c36595e6396742789d129fcd082b8351~mv2.png)
16) To determine the amount of resources that the transaction is using
db2pd -db <database name> -transactions
![](https://static.wixstatic.com/media/8531b9_0c109de9fbbb4ebe9de0a0f45cceb395~mv2.png/v1/fill/w_586,h_187,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_0c109de9fbbb4ebe9de0a0f45cceb395~mv2.png)
17) To monitor log usage
db2pd -db <database name> -logs
![](https://static.wixstatic.com/media/8531b9_34ae11a0da49422ea1a1097001fc101e~mv2.png/v1/fill/w_586,h_390,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_34ae11a0da49422ea1a1097001fc101e~mv2.png)
18) To view database bufferpool information.
db2pd -db <database name> -bufferpools
![](https://static.wixstatic.com/media/8531b9_b1fc7e1f3a0f4566892ff43703048b68~mv2.png/v1/fill/w_586,h_214,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_b1fc7e1f3a0f4566892ff43703048b68~mv2.png)
19) To get database application information.
db2pd -db <database name> -applications
![](https://static.wixstatic.com/media/8531b9_5374275134544095a9b089a419b9ef7d~mv2.png/v1/fill/w_586,h_190,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_5374275134544095a9b089a419b9ef7d~mv2.png)
20) To view dumps page cleaner related information from a database
db2pd -db <database name> -cleaner
![](https://static.wixstatic.com/media/8531b9_b74fe058e9f0448589524d9d3f488054~mv2.png/v1/fill/w_586,h_238,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_b74fe058e9f0448589524d9d3f488054~mv2.png)
21) To view the settings of the database configuration parameters.
db2pd -db <database name> -dbcfg
![](https://static.wixstatic.com/media/8531b9_26e05b7f9fc84d44a1487ed099de5f98~mv2.png/v1/fill/w_586,h_157,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_26e05b7f9fc84d44a1487ed099de5f98~mv2.png)
22) To view the settings of the database manager configuration parameters.
db2pd -dbmcfg
![](https://static.wixstatic.com/media/8531b9_b8d120e9329c4d21a04c4033b82a8ec2~mv2.png/v1/fill/w_586,h_225,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_b8d120e9329c4d21a04c4033b82a8ec2~mv2.png)
23) To get the fully resolved split diagnostic path.
db2pd -diagpath
![](https://static.wixstatic.com/media/8531b9_f8bfd4b0e1a2499e81ef0c501f0611dc~mv2.png/v1/fill/w_586,h_97,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_f8bfd4b0e1a2499e81ef0c501f0611dc~mv2.png)
24) To lists all EDUs in the instance.
db2pd -edus
![](https://static.wixstatic.com/media/8531b9_d82bcf1bfec149389e86b64cf31b7b20~mv2.png/v1/fill/w_586,h_203,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_d82bcf1bfec149389e86b64cf31b7b20~mv2.png)
25) To view the information about table and data partition reorganization of the connected database.
db2pd -db <database name> -reorg
![](https://static.wixstatic.com/media/8531b9_bc4b1bfc323a401a9ad235cef7a8001e~mv2.png/v1/fill/w_586,h_109,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_bc4b1bfc323a401a9ad235cef7a8001e~mv2.png)
26) To view the information about the status of the RUNSTATS utility on table and associated indexes of the connected database.
db2pd -db <database name> -runstats
![](https://static.wixstatic.com/media/8531b9_411a27b107034b1c9d9ed8e45a67ee17~mv2.png/v1/fill/w_586,h_115,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/8531b9_411a27b107034b1c9d9ed8e45a67ee17~mv2.png)
That's all in this post. If you liked this blog and interested in knowing more about IBM Db2. Please Like, Follow, Share & Subscribe to www.ImJhaChandan.com.
标签:information,get,db2pd,tool,database,db,db2 From: https://www.cnblogs.com/yaoyangding/p/17492718.html