Few days ago we received a complaint of slowness on one of our application so I have to check lock waits on IBM DB2. In this tutorial we will learn how to check lock waits on IBM DB2.
What are Lock Waits ?
Lock waits happen when a transaction or query wants to obtain a lock on resources such as database tables but that lock is already held by another query or transaction and if duration of these lock waits increase you will experience slowness in execution of query or transaction.
How to check Lock Waits ?
1. Login to your IBM DB2 database using database admin/owner login.
2. Type following command.
In my case the command was db2top -d P1DED where P1DEDB is the name of DB2 database.
3. Type capital U by pressing shift key + u and you will see below screen.
4. Type capital L by pressing shift key + l and you will see below screen. If there are some lock waits you will see them in next screen (as shown below in second screen shot.) and if there is nothing it means there are no lock waits(as shown in first screen shot) on your database and it is normal.
Hope this post will helpful for you. Please comment in the comment section below and share the post if you find this post informative and helpful. Thanks.