A database lock is a mechanism utilized by Db2 to govern the access to a database object amongst different transactions. This article describes the locking mechanism for Db2 (for LUW).
Locking and latching are both key mechanisms employed by relational database management systems to ensure data integrity, consistency, and the serialization of resources. In the Db2 for z/OS IRLM manages the locks, but both Db2 and IRLM have internal latches.
With this month’s topic being “locking, concurrency and waits”, it may not be a bad time to review some of the locking basics. It might help your junior colleagues or your developers to get a better understanding.
Steve Thomas of CA Technologies presents a great introduction into the world of locks, latches, claims and drains. A must see for all developers working wit Db2 for z/OS as well as all DBAs wanting to refresh their knowledge.
Starting in Db2 Version 188.8.131.52, a new feature called 'DB2_AVOID_LOCK_ESCALATION' provides control over lock escalation behaviour. The feature is configured through a dynamic (no instance recycling needed) registry variable: