Db2 troubleshooting tools

The db2pd command::

You can use the Db2 problem determination tool, db2pd, to obtain troubleshooting information from database system memory sets, without acquiring any lock or latch in the database. Since the db2pd tool works directly with memory, it is possible to retrieve information that is changing as it is being collected using minimal Db2 engine resources.

If the database is running in a Massively Parallel Processing (MPP) setup, a pureScale configuration, or an HADR setup, this command must be run on all the nodes or members of the cluster. However, if you have logical partitions within one physical server in an MPP setup, it collects information for all the logical nodes of the current host.

If you want to see the HADR database status, you can execute the db2pd command either on the primary or on the standby server.

Use the following command to execute the tool:

db2pd -db SAMPLE -hadr

Database Member 0 -- Database SAMPLE -- Active -- Up 170 days 08:17:44 -- Date 2018-05-13-20.23.52.606937

HADR_ROLE = PRIMARY

REPLAY_TYPE = PHYSICAL

HADR_SYNCMODE = NEARSYNC

STANDBY_ID = 1

LOG_STREAM_ID = 0

HADR_STATE = PEER

HADR_FLAGS =

PRIMARY_MEMBER_HOST = DB2AXNODE001

PRIMARY_INSTANCE = db2inst1

PRIMARY_MEMBER = 0

STANDBY_MEMBER_HOST = DB2AXNODE002

STANDBY_INSTANCE = db2inst1

STANDBY_MEMBER = 0

HADR_CONNECT_STATUS = CONNECTED

HADR_CONNECT_STATUS_TIME = 11/24/2017 11:08:30.948572 (1511543310)

HEARTBEAT_INTERVAL(seconds) = 30

HEARTBEAT_MISSED = 3

HEARTBEAT_EXPECTED = 21499

HADR_TIMEOUT(seconds) = 120

TIME_SINCE_LAST_RECV(seconds) = 0

PEER_WAIT_LIMIT(seconds) = 300

LOG_HADR_WAIT_CUR(seconds) = 0.000

LOG_HADR_WAIT_RECENT_AVG(seconds) = 0.000681

LOG_HADR_WAIT_ACCUMULATED(seconds) = 787983.115

LOG_HADR_WAIT_COUNT = 529872503

SOCK_SEND_BUF_REQUESTED,ACTUAL(bytes) = 0, 262088

SOCK_RECV_BUF_REQUESTED,ACTUAL(bytes) = 0, 262088

PRIMARY_LOG_FILE,PAGE,POS = S0135197.LOG, 33536, 21171039888078

STANDBY_LOG_FILE,PAGE,POS = S0135197.LOG, 33521, 21171039826535

HADR_LOG_GAP(bytes) = 2508

STANDBY_REPLAY_LOG_FILE,PAGE,POS = S0135197.LOG, 33520, 21171039822144

STANDBY_RECV_REPLAY_GAP(bytes) = 3728

PRIMARY_LOG_TIME = 05/13/2018 20:23:52.000000 (1526261032)

STANDBY_LOG_TIME = 05/13/2018 20:23:49.000000 (1526261029)

STANDBY_REPLAY_LOG_TIME = 05/13/2018 20:23:48.000000 (1526261028)

STANDBY_RECV_BUF_SIZE(pages) = 131072

STANDBY_RECV_BUF_PERCENT = 0

STANDBY_SPOOL_LIMIT(pages) = 33423360

STANDBY_SPOOL_PERCENT = 0

STANDBY_ERROR_TIME = NULL

PEER_WINDOW(seconds) = 300

PEER_WINDOW_END = 05/13/2018 20:28:50.000000 (1526261330)

READS_ON_STANDBY_ENABLED = N

 

If you want to extract all of the locking information on the SAMPLE database, you can run the db2pd command without actually locking or latching any resource in the database using the following command:

db2pd -db SAMPLE -locks

Database Member 0 -- Database SAMPLE -- Active -- Up 170 days 08:19:35 -- Date 2018-05-13-20.25.43.409995

Locks:

Address TranHdl Lockname Type Mode Sts Owner Dur HoldCount Att ReleaseFlg rrIID

0x0A000300464B7B80 132 FFFA801500390006C0F6000252 RowLock ..X G 132 1 0 0x00200020 0x40000000 0

0x0A000300464CCA00 132 00CE00040000000143DD009952 RowLock ..X G 132 1 0 0x00200008 0x40000000 0

0x0A000300464E4800 132 00CE00040000000143DC00BA52 RowLock ..X G 132 1 0 0x00200008 0x40000000 0

0x0A000300464CDF80 132 00CE00040000000143DE002E52 RowLock ..X G 132 1 0 0x00200008 0x40000000 0

Comments

Popular posts from this blog

Db2 export command example using file format (del , ixf)

How to fix DB2 Tablespace OFFLINE state issue?

How to determine fenced User-ID of a DB2 instance