Claims and Drains


Claims and drain locks are used to control currency between SQL processes and utilities, with partition independence being a major focus. Utilities and SQL can concurrently access and update different partitions, including different logical partitions of nonpartitioned indexes.

A logical partition refers to the set of index entries that point to rows in a particular data partition. Logical partitions exist only in nonpartitioned indexes of partitioned tables. An index entry belongs to one and only one logical partition.

Claims

When it first accesses an object within a unit of work, an application makes a claim on the object and releases the claim at the next commit point. Unlike a transaction lock, the claim cannot persist past the commit point. To access the object in the next unit of work, the application must make a new claim. Claims can be acquired on

  • Simple table space

  • Segmented table space

  • Index space

  • Data partition

  • Index partition

The three claim classes are write, repeatable read, and cursor stability and are described in Table 16-6. Claims are released at COMMIT except for utilities and cursors defined WITH HOLD that are still positioned on an object. All SQL processes are claimers, but only occasionally is a utility a claimer, such as an online load resume.

Table 16-6. Claim Classes

Claim Class

Isolation Level

Allows Reading

Allows Updating

Allows Inserting

Allows Deleting

Write

Any

Yes

Yes

Yes

Yes

Repeatable read

RR

Yes

No

No

No

Cursor stability

CS

Yes

No

No

No


NOTE

DB2 has no limit on the number of concurrent claimers.


Drains

Drain locks are used to serialize access to partitions and page sets among utilities, commands, and SQL applications. The drain is initiated at any time, but the takeover of an object occurs only when all access to the object has been quiesced. The drain process acquires a lock to prevent subsequent access from occurring until the lock is released.

To drain a resource, a utility or a command first acquires a drain lock and then waits until all claimers of a particular class on the resource are released. Only then is the resource considered drained. A utility trying to take over can time out if a long-running SQL process does not release the claim quickly enough.

A utility that needs only read-only access will drain on the write class, which will prevent any new updating claimers. A utility that needs to change data will drain all claim classes.



DB2 for z. OS Version 8 DBA Certification Guide
DB2 for z/OS Version 8 DBA Certification Guide
ISBN: 0131491202
EAN: 2147483647
Year: 2003
Pages: 175
Authors: Susan Lawson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net