The following articles mainly introduce the DB2 database lock table problem. In actual operations, if the center queries data, pay attention to it. If interactive data query is used, the command center will apply the s lock to the queried records. at this time, if you want to update the record, because update requires the x lock, the exclusive lock will be in the lock wait.
First, enable the monitoring switch.
- db2 update dbm cfg using dft_mon_lock on
Snapshots
- db2 get snapshot for Locks on cleardb >snap.log
- tables
- bufferpools
- tablespaces
- database
Then let's look at the content in snap. log.
You can view the Lock of each Application based on the Application handle.
After monitoring, do not forget to disable the monitor.
- db2 update dbm cfg using dft_mon_lock off
In addition:
- db2 update monitor switches using LOCK on
- db2 get snapshot for locks on SAMPLE
Find the List of Locks section in the output to view the lock information.
- select * from table( snapshot_lock ( 'loangf' , -1) ) as lock
- start database manager admin mode user ...
The above content is an introduction to the DB2 database lock table problem. I hope you will get something.