db2 concurrency

package - executable form of one or more queries - SYSCAT.PACKAGES
a package is created using PREP and BIND commands.
You can set level of isolation (or concurrency) of the package
There are 4 levels: UR (Uncommitted Reads), CS (Cursor Stability), RS (Read Stability), RR (Repeatable Read)
The lowest isolation (highest concurrency) is UR, the highest isolation - RR. Default - CS.

db2 prep something.sqc isolation RS
db2 bind something.bnd isolation RR
db2 prep something.sqc bindfile using something.bnd isolation RS
db2 bind something.bnd

Locks
- mode (state) - IN (Intent None), IS (Intent Share), NS (Next Key Share), S (Share), IX (Intent Exclusive), SIX (Share with Intent Exclusive), U (Update), NX (Next Key Exclusive), NW (Next Key Weak Exclusive), X (Exclusive), W (Weak exclusive), Z (Super exclusive)
- Object,
- Duration.

db2 lock table test in share mode
db2 alter table test locksize table
db2 alter table test locksize row

你可能感兴趣的:(db2)