Description of the DB2 database table lock mode

Source: Internet
Author: User

This article mainly describes the DB2 database table lock mode. If you are interested in the DB2 database table lock mode, you can click to view the following articles, the following is a detailed description of the main content of the article. I hope you will have a better understanding of it after browsing.

For Table-level locking, DB2 can use the following locking methods:

Table 1: DB2 database table lock mode

The following describes the table lock modes of several DB2 databases:

The IS, IX, and SIX methods are used at the table level and require row lock cooperation. They can prevent other applications from adding an exclusive lock to the table.

If an application acquires the IS lock of a table, the application can obtain the S lock on a row for read-only operations, and other applications can also read this row, or modify other rows in the table.

If an application acquires the IX lock of a table, the application obtains the X lock on a row for the change operation, and other applications can read or change other rows in the table.

If an application acquires the SIX lock of a table, the application can obtain the X lock on a row for modification. Other applications can only perform read-only operations on other rows of the table.

The S, U, X, and Z modes are used at the table level, but do not require row lock cooperation. They are relatively strict table lock policies.

If an application obtains the S lock of a table. This application can read any data in the table. It also allows other applications to obtain the read-only request lock for the table. If an application needs to change the data read from the table, it must wait until the S lock is released.

If an application obtains the U Lock of a table, the application can read any data in the table and obtain the X lock of the table to obtain the modification permission of any data in the table. Other applications can only read data from this table. The difference between the U Lock and the S lock lies in the intention of modification. The U Lock is designed to prevent two applications from simultaneously applying for the X lock when they own the S lock.

If an application obtains the X lock on a table, the application can read or modify any data in the table. Other applications cannot read or modify the table.

If an application obtains the Z lock on a table, the application can read or modify any data in the table. Other applications, including uncommitted read programs, cannot read or modify the table.

The IN lock is used for the table to allow uncommitted read. The above content is an introduction to the table lock mode of the DB2 database. I hope you will find some gains.

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.