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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Full SQL statement text trace record<br />

<strong>DB2</strong> V8 provides a new IFCID 350, which is both similar and in addition to IFCID 63, which<br />

traces the entire SQL statement. Previous versions of <strong>DB2</strong> limited the SQL statement text to a<br />

maximum of 5,000 bytes (the maximum length of a trace field).<br />

Since there is a 5,000 byte limit on a single data item being traced, a “repeating group" of<br />

5,000 byte items are placed in each IFCID 350 record up to a maximum of 6. If that is not<br />

enough, multiple IFCID 350 records are produced. IFCID 350 is written under the same<br />

circumstances that trigger the writing of IFCID 63. PREPARE attributes are also traced.<br />

Enhanced trace recording <strong>for</strong> PREPARE attribute<br />

Since <strong>DB2</strong> V7, you can change the attributes of a cursor or SELECT statement on the<br />

PREPARE statement. To do so, you use the ATTRIBITES clause on the PREPARE. For<br />

example, it allows you to change a cursor’s isolation level by providing a new attribute string.<br />

However, in V7 the attribute string is not always present in IFCID records, which makes<br />

problem determination and per<strong>for</strong>mance analysis more complex.<br />

<strong>DB2</strong> V8 adds the attribute string to the following trace records:<br />

► IFCID 63: (which contains the first 5,000 bytes of the SQL statement text) now also<br />

contains the attribute string on a short prepare.<br />

► IFCID 124: (which is used to obtain in<strong>for</strong>mation about the currently executing SQL<br />

statement through a READS request) now also contains the attributes string.<br />

► IFCID 317: (which is used to retrieve the SQL statement string of a statement in the<br />

dynamic statement cache) now also contains the attributes string.<br />

Add cached statement ID to IFCID 124<br />

IFCID 124 provides in<strong>for</strong>mation about the currently executing SQL statement through the<br />

READS interface. <strong>DB2</strong> V8 enhances IFCID 124 to also include the dynamic cached SQL<br />

statement ID. The 4 byte field QW0124ST was added to contain the cached dynamic SQL<br />

statement identifier.<br />

This enhancement works together with another enhancement in <strong>DB2</strong> V8 that allows you to<br />

Explain SQL statements from the dynamic statement cache. You can retrieve the in<strong>for</strong>mation<br />

about the currently executing SQL statement via IFCID 124. That now contains the SQL<br />

statement ID of the statement in the dynamic statement cache, and then explains the SQL<br />

statement from the dynamic statement cache using that statement ID.<br />

For more in<strong>for</strong>mation on how to explain a statement from the dynamic statement cache, see<br />

section 4.20, “EXPLAIN STMTCACHE” in the book <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8: Everything<br />

You Ever Wanted to Know, ... and More, SG24-6079.<br />

Agent level workfile tracing<br />

<strong>DB2</strong> V8 introduces a new IFCID 342 to record workfile and TEMP database usage at an<br />

application level. This allows you to take corrective action, such as adding space or cancelling<br />

a runaway query that is using a lot of space in the databases and preventing other queries<br />

from running successfully even they only need very little space.<br />

When active, IFCID 342 is written whenever space is allocated or deallocated in the workfile<br />

or TEMP database. It gives in<strong>for</strong>mation about the total amount of space being used by the<br />

agent currently and the maximum space that the agent may have used at any given point in<br />

time in the workfile or TEMP database. The trace also records the total amount of space<br />

being used <strong>for</strong> indexes on Declared Temporary Tables.<br />

Chapter 4. <strong>DB2</strong> subsystem per<strong>for</strong>mance 211

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

Saved successfully!

Ooh no, something went wrong!