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.

Column Type Content<br />

VIEW_NAME VARCHAR(128) NOT NULL WITH<br />

DEFAULT<br />

PATH VARCHAR(2048) NOT NULL WITH<br />

DEFAULT<br />

FUNCTION_TEXT VARCHAR(1500) NOT NULL WITH<br />

DEFAULT<br />

D.1.4 DSN_STATEMNT_CACHE_TABLE<br />

This new table was recently introduced by PTF UQ89372 <strong>for</strong> APAR PQ88073. With this<br />

enhancement a new keyword ALL is added to EXPLAIN STMTCACHE and a new explain<br />

table DSN_STATEMENT_CACHE_TABLE is created to hold the output of IFCID 316 and<br />

IFCID 318.<br />

A brief description follows, as reported in the APAR text.<br />

There are two different sets of in<strong>for</strong>mation that can be collected from the SQL statements in<br />

the dynamic statement cache. Specifying STMTCACHE with the STMTID or STMTTOKEN<br />

keywords causes the traditional access path in<strong>for</strong>mation to be written to the PLAN_TABLE <strong>for</strong><br />

the associated SQL statement as well as a single row written to<br />

DSN_STATEMENT_CACHE_TABLE if it exists.<br />

However, specifying STMTCACHE with the new ALL keyword causes in<strong>for</strong>mation to be<br />

written to only DSN_STATEMENT_CACHE_TABLE. It consists of one row per SQL statement<br />

in the dynamic statement cache <strong>for</strong> which the current authorization ID is authorized to<br />

execute.<br />

The contents of these rows show identifying in<strong>for</strong>mation about the cache entries, as well as<br />

an accumulation of statistics reflecting the executions of the statements by all processes that<br />

have executed the statement.<br />

This in<strong>for</strong>mation is nearly identical to the in<strong>for</strong>mation returned from the IFI monitor READS<br />

API <strong>for</strong> IFCIDs 0316 and 0317.<br />

Note that the collection and reset of the statistics in these records is controlled by starting and<br />

stopping IFCID 318. For more details, see "Controlling collection of dynamic statement cache<br />

statistics with IFCID 0318" in <strong>DB2</strong> <strong>UDB</strong> <strong>for</strong> z/<strong>OS</strong> <strong>Version</strong> 8 Administration Guide,<br />

SC18-7413-01, Appendix E - Programming <strong>for</strong> the Instrumentation Facility Interface (IFI).<br />

The new EXPLAIN option is:<br />

EXPLAIN STMTCACHE ALL;<br />

The name of the view, if the function<br />

that is specified in the<br />

FUNCTION_NAME column is<br />

referenced in a view definition.<br />

Otherwise, this field is blank.<br />

The value of the SQL path when <strong>DB2</strong><br />

resolved the function reference.<br />

The text of the function reference (the<br />

function name and parameters).<br />

SQLCODE -20248 is issued if no statement is found in the cache <strong>for</strong> the auth ID that is used.<br />

-20248 ATTEMPTED TO EXPLAIN A CACHED STATEMENT WITH<br />

STMTID, STMTTOKEN ID-token, OR ALL BUT THE REQUIRED<br />

EXPLAIN INFORMATION IS NOT ACCESSIBLE.<br />

Be<strong>for</strong>e you can use EXPLAIN STMTCACHE ALL, Statement Cache must be turned on. You<br />

must also create the table DSN_STATEMENT_CACHE_TABLE to hold the results of<br />

EXPLAIN STMTCACHE ALL. The DDL is shown in Example D-1.<br />

Appendix D. EXPLAIN and its tables 417

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

Saved successfully!

Ooh no, something went wrong!