DB2: Find out current locks, long transactions etc. [snapshot]

To find out current locks in a DB and other information about its current state, you need to take a "snapshot":

db2 "attach to  user  using "
db2 "get snapshot for applications on "  > mydatabase_snapshot.txt

Look into the resulting mydatabase_snapshot.txt for "Application ID holding"  (if there is a lock, this will read the ID of the aplication holding the lock). To find long queries [that are currently running], look for "Executing".


Tags: troubleshooting performance


Copyright © 2024 Jakub Holý
Powered by Cryogen
Theme by KingMob