19.06.2013 Views

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

DB2 UDB for z/OS Version 8 Performance Topics - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

► “NO” - Values in such columns may not be updated.<br />

► “SAME” - Values in such columns may be updated if and only if the update leaves the row<br />

belonging to the same partition.<br />

5.6.6 Lock holder can inherit WLM priority from lock waiter<br />

Assume that a transaction executes with a low WLM priority and makes updates to the<br />

database. Because it is updating, it must acquire X-locks on the rows of the pages that it<br />

modifies and then these X-locks are held until the transaction reaches a commit point. This is<br />

business as usual. If such a transaction holds an X-lock on a row in which another transaction<br />

is interested, the other transaction is <strong>for</strong>ced to wait until the first transaction (with a low WLM<br />

priority) commits. If the lock waiter per<strong>for</strong>ms very important work and is thus assigned a high<br />

WLM priority, it would be desirable that it is not slowed down by other transactions that<br />

execute in a low priority service class.<br />

To reduce the time the high priority transaction has to wait <strong>for</strong> that lock to be given up by the<br />

low priority transaction, it would be better if the waiting transaction could temporarily assign its<br />

own priority to the transaction that holds the lock until this transaction frees the locked<br />

resource.<br />

<strong>DB2</strong> V8 exploits WLM enqueue management. When a transaction has spent roughly half of<br />

the lock timeout value waiting <strong>for</strong> a lock, then the WLM priority of the transaction, which holds<br />

the lock, is increased to the priority of the lock waiter if the latter has a higher priority. If the<br />

lock holding transaction completes, it resumes its original service class. In case multiple<br />

transactions hold a common lock, this procedure is applied to all of these transactions.<br />

This function is implemented by the PTF <strong>for</strong> APAR PK19303, currently open.<br />

5.6.7 Detecting long readers<br />

Prior to <strong>DB2</strong> V8, <strong>DB2</strong> issues warning messages DSNR035I and DSNJ031I <strong>for</strong> a long running<br />

unit of recovery (UR) based on a number of system checkpoints taken since the beginning of<br />

the UR or the number of log records written.<br />

<strong>DB2</strong> V8 takes this one step further by also alerting you when you have a long-running reader<br />

in the system. It is probably less well known that not only updates have to commit frequently.<br />

Also read-only transactions should commit regularly. This is to allow utilities (that need to<br />

drain the object) to take control of the object, <strong>for</strong> example, during the switch phase of online<br />

REORG, the utility needs full control of the object to switch between the shadow data set and<br />

the actual data set used by <strong>DB2</strong>. For parallel operations, <strong>DB2</strong> records this in<strong>for</strong>mation only <strong>for</strong><br />

the originating task.<br />

A new system parameter LONG-RUNNING READER THRESHOLD, LRDRTHLD, is provided<br />

to specify the number of minutes that a read claim can be held by an agent be<strong>for</strong>e <strong>DB2</strong> will<br />

write an IFCID 313 record to report it as a long-running reader when statistics class 3 is<br />

active.<br />

IFCID 313 records all the LONG-RUNNING URs during a checkpoint or after exceeding the<br />

LOG RECORD’s written threshold without commit or all the LONG-RUNNING readers after<br />

exceeding the elapsed time threshold without commit.<br />

5.6.8 Explain a stored procedure<br />

This function allows you to run EXPLAIN without needing the authority to run the SQL to be<br />

explained.<br />

258 <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Per<strong>for</strong>mance <strong>Topics</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!