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

Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.

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