How does DB2 determine whether a table has a lock?

Source: Internet
Author: User
From: http://www.db2china.net/club/archiver/tid-10129.html

Reference: ---- view the number of locks in the table in the sample database

Select tabschema, tabname, count (*) as number_of_locks_held from sysibmadm. locks_held -- where db_name = 'sample' group by dbpartitionnum, tabschema, tabname ---- query database lock table information DB2 "select agent_id, tabschema, tabname from sysibmadm. snaplock "---- view lock wait select smallint (agent_id) as waiting_id, substr (appl_name,) as waiting_app, substr (authid,) as waiting_user, smallint (token) as holder_id, lock_mode as held, lock_object_type as type, lock_mode_requested as request from sysibmadm. lockwaits view lock table information ------------- select substr (tabschema,), substr (tabname,), count (*) as number_of_locks_held from sysibmadm. locks_held group by dbpartitionnum, tabschema, tabname

 

RelatedArticle:

http://www.db2china.net/club/viewthread.php? Tid = 9782 & extra = Page % 3d3

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.