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.

If you specify SHRLEVEL CHANGE, the applications can read from and write to the index,<br />

table space or partition that is being checked. The phases of processing inside CHECK<br />

INDEX differ in SHRLEVEL REFERENCE and SHRLEVEL CHANGE. In the case of<br />

SHRLEVEL REFERENCE, <strong>DB2</strong> unloads the index entries, sorts the index entries, and scans<br />

the data to validate index entries. On the other hand, SHRLEVEL CHANGE first goes to the<br />

table space data set and unloads the data and sorts the index keys and merges (if the index is<br />

non-partitioned), and then scans the index to validate.<br />

CHECK INDEX with option SHRLEVEL CHANGE per<strong>for</strong>ms the following actions:<br />

► Issues QUIESCE WRITE YES <strong>for</strong> the specified object and all of its indexes (this drains the<br />

writers so no updates are allowed <strong>for</strong> a while)<br />

► Invokes DFSMSdss at the data set level to copy the table space and all indexes to shadow<br />

data sets<br />

Note: Online CHECK INDEX will use FlashCopy V2 if available, otherwise concurrent<br />

copy will be used, this can elongate the read-only time.<br />

► Allows write access to the specified object and indexes<br />

► Runs CHECK INDEX on the shadow data sets<br />

Tip: FlashCopy V2 is needed since it supports data set copy (FlashCopy V1 works only at<br />

the volume level). Another advantage is that the source and target of a FlashCopy V2 can<br />

be a different logical subsystem within the Enterprise Storage System.<br />

Index processing with SHRLEVEL CHANGE<br />

SHRLEVEL CHANGE has a new architecture. SHRLEVEL REFERENCE unload phase<br />

unloads keys from the index and the check phase compares sorted keys against the data via<br />

tablespace scan. SHRLEVEL CHANGE unload phase does a table space scan extracting<br />

keys and the check phase compares sorted keys against the keys in the index.<br />

CHECK INDEX in V8 can provide parallel processing like REBUILD INDEX, which minimizes<br />

elapsed time <strong>for</strong> checking the data and indexes. If you specify more than one index to check<br />

and the SHRLEVEL CHANGE option, CHECK INDEX checks the indexes in parallel unless<br />

constrained by available memory or sort work files. Checking indexes in parallel reduces the<br />

elapsed time <strong>for</strong> a CHECK INDEX job by sorting the index keys and checking multiple indexes<br />

in parallel, rather than sequentially.<br />

It is important <strong>for</strong> parallel processing to specify appropriate values in the SORTDEVT and<br />

SORTNUM parameter. SORTDEVT specifies the device type <strong>for</strong> temporary data sets that are<br />

to be dynamically allocated by the DFSORT. SORTNUM can specify the number of temporary<br />

data sets dynamically allocated by the sort program (DFSORT). Example 6-1 is a sample JCL<br />

of CHECK INDEX.<br />

Example 6-1 Sample JCL of CHECK INDEX SHRLEVEL CHANGE<br />

//CHKIDXB EXEC PGM=DSNUTILB,REGION=4096K,PARM='SSTR,CHKINDX1'<br />

//SYSPRINT DD SYSOUT=A<br />

//SYSUDUMP DD SYSOUT=A<br />

//UTPRINT DD SYSOUT=A<br />

//DSNTRACE DD SYSOUT=A<br />

//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(5,2)),VOL=SER=SCR03<br />

//SYSOUT DD UNIT=SYSDA,SPACE=(CYL,(5,2)),VOL=SER=SCR03<br />

//SORTLIB DD DISP=SHR,DSN=SYS1.SORTLIB<br />

Chapter 6. Utilities 263

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

Saved successfully!

Ooh no, something went wrong!