DB2 database lock table Problems

Source: Internet
Author: User

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.

 
 
  1. db2 update dbm cfg using dft_mon_lock on 

Snapshots

 
 
  1. db2 get snapshot for Locks on cleardb >snap.log  
  2. tables   
  3. bufferpools  
  4. tablespaces  
  5. 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.

 
 
  1. db2 update dbm cfg using dft_mon_lock off 

In addition:

 
 
  1. db2 update monitor switches using LOCK on   
  2. db2 get snapshot for locks on SAMPLE  

Find the List of Locks section in the output to view the lock information.

 
 
  1. select * from table( snapshot_lock ( 'loangf' , -1) ) as lock  
  2. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.