1137
DB2 Version 9.1 for z/OS Utility Guide and Reference SC18-9855-06

dsnugk16

Embed Size (px)

Citation preview

DB2 Version 9.1 for z/OS

Utility Guide and Reference

SC18-9855-06

DB2 Version 9.1 for z/OS

Utility Guide and Reference

SC18-9855-06

Note Before using this information and the product it supports, be sure to read the general information under Notices at the end of this information.

Seventh edition (March 2010) This edition applies to DB2 Version 9.1 for z/OS (DB2 V9.1 for z/OS), product number 5635-DB2, and to any subsequent releases until otherwise indicated in new editions. Make sure you are using the correct edition for the level of the product. Specific changes are indicated by a vertical bar to the left of a change. A vertical bar to the left of a figure caption indicates that the figure has changed. Editorial changes that have no technical significance are not noted. Copyright IBM Corporation 1983, 2010. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

ContentsAbout this information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvWho should read this information . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv DB2 Utilities Suite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Terminology and citations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv Accessibility features for DB2 Version 9.1 for z/OS . . . . . . . . . . . . . . . . . . . . . . xvi How to send your comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii Naming conventions used in this information . . . . . . . . . . . . . . . . . . . . . . . xvii How to read syntax diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx

Part 1. Introduction to the DB2 utilities . . . . . . . . . . . . . . . . . . . . . 1Chapter 1. Basic information about the DB2 utilities. . . . . . . . . . . . . . . . . 3Types of DB2 utilities . . . . . . . . . . . . . . . . Privileges and authorization IDs . . . . . . . . . . . . . Utilities that can be run on declared temporary objects . . . . . Effect of utilities on objects that have the DEFINE NO attribute . . Effect of utilities on data that is encrypted through built-in functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 4 4 5

Chapter 2. DB2 utilities packaging . . . . . . . . . . . . . . . . . . . . . . . . 7SMP/E jobs for DB2 utility products . . . . . . . . . . . . . . The operation of DB2 utilities in a mixed-release data sharing environment . . . . . . . . . . . . . . . . . . . . . . . . . . 7 . 8

Part 2. DB2 online utilities . . . . . . . . . . . . . . . . . . . . . . . . . . 11Chapter 3. Invoking DB2 online utilities. . . . . . . . . . . . . . . . . . . . . . 13Data sets that online utilities use . . . . . . . . . . . . . . . . . . . . . . . . . Utility control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . Required authorizations for invoking online utilities on tables that have multilevel security with row-level granularity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Invoking DB2 online utilities in a trusted connection . . . . . . . . . . . . . . . . . . Using the DB2 Utilities panel in DB2I . . . . . . . . . . . . . . . . . . . . . . . Invoking a DB2 utility by using the DSNU CLIST command in TSO . . . . . . . . . . . . . DSNU CLIST command . . . . . . . . . . . . . . . . . . . . . . . . . . . Invoking a DB2 utility by using the supplied JCL procedure (DSNUPROC) . . . . . . . . . . . Invoking a DB2 utility by creating the JCL data set yourself . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 . 15 . . . . . . . 18 18 18 21 22 28 30

|

Chapter 4. Monitoring and controlling online utilities . . . . . . . . . . . . . . . . 33Monitoring utilities with the DISPLAY UTILITY command . . . Running utilities concurrently . . . . . . . . . . . . . Online utilities in a data sharing environment . . . . . . . . Termination of an online utility with the TERM UTILITY command Restart of an online utility . . . . . . . . . . . . . . Using the RESTART parameter . . . . . . . . . . . . Adding or deleting utility statements . . . . . . . . . . Modifying utility control statements . . . . . . . . . . Restarting after the output data set is full . . . . . . . . Restarting with templates. . . . . . . . . . . . . . How DB2 restarts with lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 34 35 36 36 39 40 40 40 40 41

Chapter 5. BACKUP SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . 43Syntax and options of the BACKUP SYSTEM control statement . Before running BACKUP SYSTEM . . . . . . . . . . . Data sets that BACKUP SYSTEM uses . . . . . . . . Copyright IBM Corp. 1983, 2010

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. 44 . 46 . 47

iii

Concurrency and compatibility for BACKUP Dumping a fast replication copy to tape . . . Termination or restart of BACKUP SYSTEM . Sample BACKUP SYSTEM control statements .

SYSTEM . . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

47 47 48 48

Chapter 6. CATENFM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Syntax and options of the control statement . . Before converting the catalog . . . . . . . Data sets that CATENFM uses when converting Concurrency and compatibility for CATENFM. Converting to new-function mode . . . . . . Termination or halt of CATENFM . . . . . . . . . . . . . . the catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 52 52 53 53 53

Chapter 7. CATMAINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Syntax and options of the CATMAINT control statement . . . . . . . . . . . . . . . . . . Before running CATMAINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data sets that CATMAINT uses . . . . . . . . . . . . . . . . . . . . . . . . . Concurrency and compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . Updating the catalog for a new release . . . . . . . . . . . . . . . . . . . . . . . . Renaming the owner, creator, and schema of database objects . . . . . . . . . . . . . . . . Changing the ownership of objects from an authorization ID to a role . . . . . . . . . . . . . . Changing the catalog name used by storage groups or index spaces and table spaces. . . . . . . . . Identifying invalidated plans and packages after the owner, creator, or schema name of an object is renamed Termination or restart of CATMAINT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 56 56 57 57 57 57 58 58 58

| | | |

Chapter 8. CHECK DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Syntax and options of the CHECK DATA control statement Before running CHECK DATA . . . . . . . . . . Data sets that CHECK DATA uses . . . . . . . . Concurrency and compatibility for CHECK DATA . . Create exception tables . . . . . . . . . . . . Exception processing for tables with auxiliary columns . . Specifying the scope of CHECK DATA . . . . . . . How violations are identified . . . . . . . . . . Detect and correct constraint violations . . . . . . . Resetting CHECK-pending status . . . . . . . . . LOB column errors . . . . . . . . . . . . . . Resetting auxiliary CHECK-pending status . . . . . . Termination and restart of CHECK DATA . . . . . . Sample CHECK DATA control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 69 70 74 76 77 77 77 78 78 79 80 80 81

|

Chapter 9. CHECK INDEX. . . . . . . . . . . . . . . . . . . . . . . . . . . . 85Syntax and options of the CHECK INDEX control statement Data sets that CHECK INDEX uses . . . . . . . . Defining the work data set for CHECK INDEX . . . Shadow data sets . . . . . . . . . . . . . Concurrency and compatibility for CHECK INDEX . . . Single logical partitions . . . . . . . . . . . . Indexes in parallel . . . . . . . . . . . . . . Reviewing CHECK INDEX output. . . . . . . . . Termination or restart of CHECK INDEX . . . . . . Correcting XML data after running CHECK INDEX . . . Sample CHECK INDEX control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 89 90 90 92 94 95 98 99 99 99

Chapter 10. CHECK LOB . . . . . . . . . . . . . . . . . . . . . . . . . . . 103Syntax and options of the CHECK LOB control statement Before running CHECK LOB . . . . . . . . . . Data sets that CHECK LOB uses . . . . . . . . Concurrency and compatibility for CHECK LOB . . How CHECK LOB identifies violations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 107 107 109 110

iv

Utility Guide and Reference

Resetting CHECK-pending status for a LOB Resolving media failure . . . . . . . Termination or restart of CHECK LOB . . Sample CHECK LOB control statements .

table . . . . . .

space . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

110 111 111 111

Chapter 11. COPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113Syntax and options of the COPY control statement . Before running COPY . . . . . . . . . . Data sets that COPY uses . . . . . . . . Concurrency and compatibility for COPY . . . Full image copies . . . . . . . . . . . . Incremental image copies . . . . . . . . . Multiple image copies . . . . . . . . . . Copying a list of objects . . . . . . . . . . Using more than one COPY statement . . . . . Copying segmented table spaces . . . . . . . Copying partitions or data sets in separate jobs . . Copying partition-by-growth table spaces . . . . Copying an XML table space . . . . . . . . Copying indexes . . . . . . . . . . . . Using DFSMSdss concurrent copy . . . . . . Specifying conditional image copies . . . . . . Preparing for recovery . . . . . . . . . . Improving performance . . . . . . . . . . Copying table spaces with mixed volume IDs . . Defining generation data groups . . . . . . . Using DB2 with DFSMS products . . . . . . Image copies on tape . . . . . . . . . . . Termination of COPY. . . . . . . . . . . Restart of COPY . . . . . . . . . . . . Sample COPY control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 124 124 126 129 130 131 133 134 135 135 135 135 136 136 138 139 140 141 141 141 141 142 142 143

| | |

Chapter 12. COPYTOCOPY

. . . . . . . . . . . . . . . . . . . . . . . . . . 155. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156 161 162 163 163 164 164 164 164 164 165 165 165 166 166 166 167 167

Syntax and options of the COPYTOCOPY control statement . . . Data sets that COPYTOCOPY uses . . . . . . . . . . . Concurrency and compatibility for COPYTOCOPY . . . . . . Full or incremental image copies with COPYTOCOPY. . . . . Incremental image copies with COPYTOCOPY . . . . . . . Using more than one COPYTOCOPY statement . . . . . . . Copying an inline copy made by REORG with a range of partitions Copying from a specific image copy . . . . . . . . . . . Using TEMPLATE with COPYTOCOPY . . . . . . . . . Updating SYSCOPY records . . . . . . . . . . . . . How to determine which input copy to use . . . . . . . . Defining generation data groups . . . . . . . . . . . . Using DB2 with DFSMS products . . . . . . . . . . . Image copies on tape . . . . . . . . . . . . . . . . Copying a LOB table space . . . . . . . . . . . . . . Copying a list of objects from tape . . . . . . . . . . . Termination or restart of COPYTOCOPY . . . . . . . . . Sample COPYTOCOPY control statements. . . . . . . . .

Chapter 13. DIAGNOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173Syntax and options of the DIAGNOSE control statement Data sets that DIAGNOSE uses . . . . . . . . Concurrency and compatibility for DIAGNOSE . . . Forcing a utility abend . . . . . . . . . . . Termination or restart of DIAGNOSE . . . . . . Sample DIAGNOSE control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 177 177 177 178 178

Contents

v

Chapter 14. EXEC SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181Syntax and options of the EXEC SQL control statement Concurrency and compatibility for EXEC SQL . . . Termination or restart of EXEC SQL . . . . . . . Sample EXEC SQL control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 183 183 183

Chapter 15. LISTDEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185Syntax and options of the LISTDEF control statement Concurrency and compatibility for LISTDEF . . . Creating the LISTDEF control statement . . . . Including objects in a list . . . . . . . . . Previewing the contents of a list . . . . . . . Creating LISTDEF libraries . . . . . . . . . Using lists in other utility jobs. . . . . . . . Using the TEMPLATE utility with LISTDEF . . . Using the OPTIONS utility with LISTDEF . . . . Termination or restart of LISTDEF . . . . . . Sample LISTDEF control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 193 193 194 197 197 198 199 200 200 200

Chapter 16. LOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205Syntax and options of the LOAD control statement. . . . . . . . . . . . . . Before running LOAD . . . . . . . . . . . . . . . . . . . . . . . Data sets that LOAD uses . . . . . . . . . . . . . . . . . . . . . Concurrency and compatibility for LOAD . . . . . . . . . . . . . . . . When to use SORTKEYS NO . . . . . . . . . . . . . . . . . . . . . Loading variable-length data . . . . . . . . . . . . . . . . . . . . . How LOAD orders loaded records . . . . . . . . . . . . . . . . . . . Replacing data with LOAD. . . . . . . . . . . . . . . . . . . . . . Using LOAD for tables with identity columns, ROWID columns, or row change timestamp Adding more data to a table or partition . . . . . . . . . . . . . . . . . Deleting all the data in a table space . . . . . . . . . . . . . . . . . . Loading partitions . . . . . . . . . . . . . . . . . . . . . . . . . Partition-by-growth table spaces . . . . . . . . . . . . . . . . . . . . Loading data containing XML columns . . . . . . . . . . . . . . . . . . Loading delimited files . . . . . . . . . . . . . . . . . . . . . . . Loading data with referential constraints . . . . . . . . . . . . . . . . . Correcting referential constraint violations. . . . . . . . . . . . . . . . . Compressing data . . . . . . . . . . . . . . . . . . . . . . . . . Loading data from DL/I . . . . . . . . . . . . . . . . . . . . . . Loading data by using the cross-loader function. . . . . . . . . . . . . . . Using inline COPY with LOAD . . . . . . . . . . . . . . . . . . . . Improving LOAD performance . . . . . . . . . . . . . . . . . . . . Improving performance for parallel processing . . . . . . . . . . . . . . Improved performance with SORTKEYS . . . . . . . . . . . . . . . . Improving performance with LOAD or REORG PREFORMAT . . . . . . . . . Converting input data . . . . . . . . . . . . . . . . . . . . . . . Specifying input fields . . . . . . . . . . . . . . . . . . . . . . . Specifying the TRUNCATE and STRIP options . . . . . . . . . . . . . . . How LOAD builds indexes while loading data . . . . . . . . . . . . . . . Building indexes in parallel for LOAD . . . . . . . . . . . . . . . . . . How LOAD leaves free space . . . . . . . . . . . . . . . . . . . . . Loading with RECOVER-pending, REBUILD-pending, or REORG-pending status . . . Exit procedures. . . . . . . . . . . . . . . . . . . . . . . . . . Loading ROWID columns . . . . . . . . . . . . . . . . . . . . . . Loading a LOB column . . . . . . . . . . . . . . . . . . . . . . . LOAD LOG on a LOB table space . . . . . . . . . . . . . . . . . . . Loading an XML column . . . . . . . . . . . . . . . . . . . . . . LOAD LOG on an XML table space . . . . . . . . . . . . . . . . . . . Running LOAD RESUME YES SHRLEVEL CHANGE without logging . . . . . . . Collecting inline statistics while loading a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 248 249 253 256 256 256 257 259 260 260 260 262 262 263 265 267 267 269 270 271 272 273 273 274 275 276 277 277 278 280 281 281 282 282 283 283 284 284 285

|

| |

| |

vi

Utility Guide and Reference

Inline COPY for a base table space . . . . . . . . . . . Termination of LOAD . . . . . . . . . . . . . . . Restart of LOAD . . . . . . . . . . . . . . . . . After running LOAD . . . . . . . . . . . . . . . . Copying the loaded table space or partition . . . . . . . Resetting COPY-pending status . . . . . . . . . . . Resetting REBUILD-pending status . . . . . . . . . . Resetting the CHECK-pending status . . . . . . . . . Running CHECK INDEX after loading a table that has indexes. Recovering a failed LOAD job . . . . . . . . . . . . Reorganization of an auxiliary index after LOAD . . . . . Effects of running LOAD . . . . . . . . . . . . . . Sample LOAD control statements. . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

. . . . . . . . . . . . .

285 285 286 288 288 288 288 289 291 291 292 292 293

Chapter 17. MERGECOPY . . . . . . . . . . . . . . . . . . . . . . . . . . . 307Syntax and options of the MERGECOPY control statement Data sets that MERGECOPY uses . . . . . . . . Concurrency and compatibility for MERGECOPY . . . Full or incremental image copy . . . . . . . . . How to determine which input copy MERGECOPY uses . Merging online copies . . . . . . . . . . . . Using MERGECOPY with individual data sets . . . . Using MERGECOPY or COPY. . . . . . . . . . Avoiding MERGECOPY LOG RBA inconsistencies . . . Creating image copies in a JES3 environment. . . . . Terminating or restart of MERGECOPY. . . . . . . Sample MERGECOPY control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308 310 311 312 313 313 313 313 313 314 314 314

Chapter 18. MODIFY RECOVERY . . . . . . . . . . . . . . . . . . . . . . . . 317Syntax and options of the MODIFY RECOVERY control statement Before running MODIFY RECOVERY . . . . . . . . . . Data sets that MODIFY RECOVERY uses . . . . . . . . Concurrency and compatibility for MODIFY RECOVERY. . . How MODIFY RECOVERY deletes rows . . . . . . . . . How MODIFY RECOVERY deletes SYSOBDS entries . . . . . Reclaiming space in the DBD . . . . . . . . . . . . . Improving REORG performance after adding a column . . . . Termination or restart of MODIFY RECOVERY . . . . . . . The effect of MODIFY RECOVERY on version numbers . . . . Sample MODIFY RECOVERY control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 321 321 321 322 323 323 324 324 324 325

Chapter 19. MODIFY STATISTICS . . . . . . . . . . . . . . . . . . . . . . . . 327Syntax and options of the MODIFY STATISTICS control statement Data sets that MODIFY STATISTICS uses . . . . . . . . . Concurrency and compatibility for MODIFY STATISTICS. . . . Deciding which statistics history rows to delete . . . . . . . Deleting specific statistics history rows . . . . . . . . . . Termination or restart of MODIFY STATISTICS . . . . . . . Sample MODIFY STATISTICS control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 330 330 331 331 331 332

Chapter 20. OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335Syntax and options of the OPTIONS control statement Concurrency and compatibility for OPTIONS. . . . Executing statements in preview mode . . . . . . Specifying LISTDEF and TEMPLATE libraries . . . Overriding standard utility processing behavior . . . Termination or restart of OPTIONS . . . . . . . Sample OPTIONS control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 338 339 339 339 339 339

Chapter 21. QUIESCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343Contents

vii

Syntax and options of the QUIESCE control statement. Before running QUIESCE . . . . . . . . . . Data sets that QUIESCE uses . . . . . . . . Concurrency and compatibility for QUIESCE . . . Using QUIESCE on catalog and directory objects . . Common quiesce points . . . . . . . . . . . Specifying a list of table spaces and table space sets . Running QUIESCE on a table space in pending status . Determining why the write to disk fails . . . . . Termination and restart of QUIESCE . . . . . . Sample QUIESCE control statements . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

344 345 346 346 348 348 348 349 349 350 350

Chapter 22. REBUILD INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . 353Syntax and options of the REBUILD INDEX control statement Before running REBUILD INDEX. . . . . . . . . . Data sets that REBUILD INDEX uses . . . . . . . Concurrency and compatibility for REBUILD INDEX . . Access with REBUILD INDEX SHRLEVEL . . . . . . Rebuilding index partitions. . . . . . . . . . . . Rebuilding indexes on partition-by-growth table spaces . . Improving performance when rebuilding index partitions . Rebuilding multiple indexes . . . . . . . . . . . Resetting the REBUILD-pending status . . . . . . . . Rebuilding critical catalog indexes . . . . . . . . . Recoverability of a rebuilt index . . . . . . . . . . Termination or restart of REBUILD INDEX . . . . . . The effect of REBUILD INDEX on index version numbers . Sample REBUILD INDEX control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 361 362 364 366 366 367 367 368 372 373 373 373 373 374

|

Chapter 23. RECOVER . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377Syntax and options of the RECOVER control statement . . . . . . . . Before running RECOVER . . . . . . . . . . . . . . . . . . Data sets that RECOVER uses . . . . . . . . . . . . . . . . Concurrency and compatibility for RECOVER . . . . . . . . . . Using a system-level backup . . . . . . . . . . . . . . . . . How to determine which system-level backups DB2 recovers . . . . . . Determining the recovery base . . . . . . . . . . . . . . . . Determining whether the system-level backups reside on disk or tape . . . Recovering a table space . . . . . . . . . . . . . . . . . . Recovering a list of objects . . . . . . . . . . . . . . . . . . Recovering a data set or partition . . . . . . . . . . . . . . . Recovering with incremental copies . . . . . . . . . . . . . . . Recovering a page . . . . . . . . . . . . . . . . . . . . . Recovering an error range . . . . . . . . . . . . . . . . . . Effect on RECOVER of the NOT LOGGED or LOGGED table space attributes . Recovering with a data set copy that is not made by DB2 . . . . . . . Recovering catalog and directory objects . . . . . . . . . . . . . Reinitializing DSNDB01.SYSUTILX . . . . . . . . . . . . . . . Recovering a table space that contains LOB or XML data . . . . . . . . Recovering a table space that contains clone objects . . . . . . . . . Point-in-time recovery . . . . . . . . . . . . . . . . . . . Avoiding specific image copy data sets . . . . . . . . . . . . . . Improving RECOVER performance . . . . . . . . . . . . . . . Optimizing the LOGAPPLY phase . . . . . . . . . . . . . . . Recovering image copies in a JES3 environment . . . . . . . . . . . Resetting RECOVER-pending or REBUILD pending status . . . . . . . How the RECOVER utility allocates incremental image copies . . . . . . How the RECOVER utility performs fallback recovery. . . . . . . . . How the RECOVER utility retains tape mounts . . . . . . . . . . . Avoiding damaged media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 387 387 388 390 390 391 391 391 392 393 393 394 394 395 395 396 401 401 402 403 408 409 409 411 411 412 412 413 413

| | |

|

| |

viii

Utility Guide and Reference

Termination or restart of RECOVER . . Effects of running RECOVER . . . . Sample RECOVER control statements .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. . .

. 413 . 414 . 414

Chapter 24. REORG INDEX

. . . . . . . . . . . . . . . . . . . . . . . . . . 419. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420 432 433 437 439 439 440 441 442 442 443 444 445 445

Syntax and options of the REORG INDEX control statement . . . . . . . . . . . . . Before running REORG INDEX . . . . . . . . . . . . . . . . . . . . . . . Data sets that REORG INDEX uses . . . . . . . . . . . . . . . . . . . . . Concurrency and compatibility for REORG INDEX . . . . . . . . . . . . . . . . Determining when an index requires reorganization . . . . . . . . . . . . . . . . Using the LEAFDISTLIMIT and REPORTONLY options to determine when reorganization is needed Access with REORG INDEX SHRLEVEL . . . . . . . . . . . . . . . . . . . . Temporarily interrupting REORG. . . . . . . . . . . . . . . . . . . . . . . Improving performance . . . . . . . . . . . . . . . . . . . . . . . . . . Termination of REORG INDEX . . . . . . . . . . . . . . . . . . . . . . . Restart of REORG INDEX . . . . . . . . . . . . . . . . . . . . . . . . . Review of REORG INDEX output . . . . . . . . . . . . . . . . . . . . . . Effect of REORG INDEX on index version numbers . . . . . . . . . . . . . . . . Sample REORG INDEX control statements . . . . . . . . . . . . . . . . . . .

Chapter 25. REORG TABLESPACE . . . . . . . . . . . . . . . . . . . . . . . 449Syntax and options of the REORG TABLESPACE control statement Before running REORG TABLESPACE . . . . . . . . . . Data sets that REORG TABLESPACE uses . . . . . . . . Concurrency and compatibility for REORG TABLESPACE . . Determining when an object requires reorganization . . . . . Access with REORG TABLESPACE SHRLEVEL . . . . . . . Omitting the output data set . . . . . . . . . . . . . Unloading without reloading . . . . . . . . . . . . . Reclaiming space from dropped tables . . . . . . . . . . Reorganizing the catalog and directory . . . . . . . . . . Changing data set definitions . . . . . . . . . . . . . Temporarily interrupting REORG. . . . . . . . . . . . Building a compression dictionary . . . . . . . . . . . Overriding dynamic DFSORT and SORTDATA allocation. . . . Rebalancing partitions by using REORG . . . . . . . . . How to unload and reload partitions in parallel . . . . . . . Using inline copy with REORG TABLESPACE . . . . . . . Improving REORG TABLESPACE performance . . . . . . . Parallel index building for REORG TABLESPACE . . . . . . Methods of unloading data . . . . . . . . . . . . . . Encountering an error in the RELOAD phase. . . . . . . . Reorganization of partitioned table spaces . . . . . . . . . Reorganization of partition-by-growth table spaces . . . . . . Reorganization of segmented table spaces . . . . . . . . . Counting records loaded during RELOAD phase . . . . . . Reorganization of a LOB table space. . . . . . . . . . . Termination of REORG TABLESPACE . . . . . . . . . . Restart of REORG TABLESPACE . . . . . . . . . . . . Review of REORG TABLESPACE output . . . . . . . . . After running REORG TABLESPACE . . . . . . . . . . Effects of running REORG TABLESPACE . . . . . . . . . Sample REORG TABLESPACE control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 481 486 493 498 499 501 502 502 502 504 504 505 505 505 507 507 508 510 513 513 513 513 514 514 515 515 517 519 519 520 521

|

Chapter 26. REPAIR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535Syntax and options of the REPAIR control statement Before running REPAIR . . . . . . . . . . Data sets that REPAIR uses. . . . . . . . Concurrency and compatibility for REPAIR . . Resetting table space status. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536 550 551 551 554

Contents

ix

Resetting index space status . . . . . . . . . . . . . . . Repairing a damaged page . . . . . . . . . . . . . . . . Using the DBD statement . . . . . . . . . . . . . . . . Locating rows by key. . . . . . . . . . . . . . . . . . Using VERIFY with REPLACE and DELETE operations . . . . . . Repairing critical catalog table spaces and indexes . . . . . . . . Updating version information when moving objects to another subsystem Termination or restart of REPAIR . . . . . . . . . . . . . . Review of REPAIR output . . . . . . . . . . . . . . . . After running REPAIR . . . . . . . . . . . . . . . . . Sample REPAIR control statements . . . . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

555 555 555 556 557 557 557 558 558 559 559

Chapter 27. REPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563Syntax and options of the REPORT control statement Data sets that REPORT uses . . . . . . . . Concurrency and compatibility for REPORT . . . How REPORT recovers information . . . . . . Running REPORT on the catalog and directory . . Terminating or restarting REPORT . . . . . . Review of REPORT output . . . . . . . . . Sample REPORT control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564 568 568 568 570 570 571 577

Chapter 28. RESTORE SYSTEM

. . . . . . . . . . . . . . . . . . . . . . . . 585. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586 587 588 589 589 589 589 590 590 590

|

Syntax and options of the RESTORE SYSTEM control statement Before running RESTORE SYSTEM . . . . . . . . . . Data sets that RESTORE SYSTEM uses . . . . . . . . Concurrency and compatibility for RESTORE SYSTEM . . Restoring data in a data sharing environment . . . . . . Using DISPLAY UTILITY with RESTORE SYSTEM . . . . . Termination and restart of RESTORE SYSTEM . . . . . . Effects of running RESTORE SYSTEM . . . . . . . . . After running RESTORE SYSTEM . . . . . . . . . . Sample RESTORE SYSTEM control statements . . . . . .

Chapter 29. RUNSTATS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593Syntax and options of the RUNSTATS control statement . . . . . Before running RUNSTATS . . . . . . . . . . . . . . . Data sets that RUNSTATS uses . . . . . . . . . . . . Concurrency and compatibility for RUNSTATS . . . . . . . When to use RUNSTATS . . . . . . . . . . . . . . . Assessing table space status . . . . . . . . . . . . . . Collecting distribution statistics for column groups . . . . . . . Updating statistics for a partitioned table space . . . . . . . . Running RUNSTATS on the DB2 catalog . . . . . . . . . . Improving RUNSTATS performance . . . . . . . . . . . . Collecting frequency statistics for data-partitioned secondary indexes Invalidating statements in the dynamic statement cache . . . . . Collecting statistics history . . . . . . . . . . . . . . . Collecting statistics on LOB table spaces . . . . . . . . . . Termination or restart of RUNSTATS . . . . . . . . . . . Review of RUNSTATS output . . . . . . . . . . . . . . Access path statistics . . . . . . . . . . . . . . . . Space statistics (columns for tuning information) . . . . . . After running RUNSTATS . . . . . . . . . . . . . . . Sample RUNSTATS control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594 608 608 610 612 612 613 613 613 613 614 615 615 615 615 615 620 623 629 629

Chapter 30. STOSPACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635Syntax and options of the STOSPACE control statement . Data sets that STOSPACE uses . . . . . . . . . Concurrency and compatibility for STOSPACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 . 636 . 637

x

Utility Guide and Reference

How STOSPACE ensures availability of objects it STOSPACE Obtaining statistical information with STOSPACE . . . . Analysis of the values in a SPACE or SPACEF column . . Terminate or restart of STOSPACE . . . . . . . . . Sample STOSPACE control statement . . . . . . . .

requires . . . . . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

637 637 638 638 639

Chapter 31. TEMPLATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641Syntax and options of the TEMPLATE control statement Before running TEMPLATE. . . . . . . . . . Concurrency and compatibility for TEMPLATE . . Key TEMPLATE operations . . . . . . . . . Creating data set names . . . . . . . . . . . Controlling data set size . . . . . . . . . . . Default space calculations . . . . . . . . . . Working with TAPE . . . . . . . . . . . . Working with GDGs . . . . . . . . . . . . Template switching . . . . . . . . . . . . Termination or restart of TEMPLATE . . . . . . Sample TEMPLATE control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 654 654 654 655 656 656 657 657 657 658 658

|

Chapter 32. UNLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663Syntax and options of the UNLOAD control statement . Before running UNLOAD . . . . . . . . . . . Data sets that UNLOAD uses . . . . . . . . . Concurrency and compatibility for UNLOAD . . . Unloading partitions . . . . . . . . . . . . . Unloading XML data . . . . . . . . . . . . . Selecting tables and rows to unload . . . . . . . . Selecting and ordering columns to unload . . . . . . Unloading data from image copy data sets . . . . . Converting data with the UNLOAD utility . . . . . Output field types . . . . . . . . . . . . . . Output field positioning and size. . . . . . . . . Layout of output fields . . . . . . . . . . . . Unloading delimited files . . . . . . . . . . . Specifying TRUNCATE and STRIP options for output data Generating LOAD statements . . . . . . . . . . Unloading compressed data . . . . . . . . . . Field specification errors. . . . . . . . . . . . Termination or restart of UNLOAD . . . . . . . . Sample UNLOAD control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664 699 699 700 702 702 703 703 703 705 705 707 708 710 713 713 714 714 714 715

|

Part 3. DB2 stand-alone utilities . . . . . . . . . . . . . . . . . . . . . . . 721Chapter 33. Invoking stand-alone utilities . . . . . . . . . . . . . . . . . . . . 723Creating utility control statements . . . . . . . . . . . . . . . . . . . . . . . . Specifying options by using the JCL EXEC PARM parameter . . . . . . . . . . . . . . . Effects of invoking stand-alone utilities on tables that have multilevel security with row-level granularity . . . . . . . 723 . 723 . 724

Chapter 34. DSNJCNVB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725 Chapter 35. DSNJLOGF (preformat active log) . . . . . . . . . . . . . . . . . . 727 Chapter 36. DSNJU003 (change log inventory) . . . . . . . . . . . . . . . . . . 729Syntax and options of the DSNJU003 control statement Making changes for active logs . . . . . . . . Making changes for archive logs . . . . . . . . Creating a conditional restart control record . . . . Deleting log data sets with errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730 743 745 745 746

Contents

xi

Altering references to NEWLOG and DELETE data sets . . . Defining the high-level qualifier for catalog and directory objects Renaming DB2 system data sets . . . . . . . . . . . Renaming DB2 active log data sets . . . . . . . . . . Renaming DB2 archive log data sets . . . . . . . . . . Sample DSNJU003 control statements . . . . . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

747 747 748 748 748 748

Chapter 37. DSNJU004 (print log map)

. . . . . . . . . . . . . . . . . . . . . 751. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752 . 753 . 753

Syntax and options of the DSNJU004 control statement . Sample DSNJU004 control statement . . . . . . . DSNJU004 (print log map) output . . . . . . . .

Chapter 38. DSN1CHKR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763Syntax and options of the DSN1CHKR control statement . Sample DSN1CHKR control statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764 . 766

Chapter 39. DSN1COMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771Syntax and options of the DSN1COMP control statement. . . . . Before running DSN1COMP . . . . . . . . . . . . . . Estimating compression savings achieved with option REORG . . . Free space in compression calculations on table space . . . . . . The effect of running DSN1COMP on a table space with identical rows Sample DSN1COMP control statements . . . . . . . . . . DSN1COMP output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772 775 776 776 777 777 779

Chapter 40. DSN1COPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781Syntax and options of the DSN1COPY control statement . . . Before running DSN1COPY . . . . . . . . . . . . Data sets that DSN1COPY uses . . . . . . . . . . The effect of altering a table before running DSN1COPY . . . Checking for inconsistent data. . . . . . . . . . . . The effects of not specifying the OBIDXLAT option. . . . . Requirements for using an image copy as input to DSN1COPY. Resetting page log RBAs . . . . . . . . . . . . . Copying from an image copy . . . . . . . . . . . . Restoring indexes with DSN1COPY . . . . . . . . . . Restoring table spaces with DSN1COPY . . . . . . . . Printing with DSN1COPY . . . . . . . . . . . . . Copying tables from one subsystem to another . . . . . . Sample DSN1COPY control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783 788 789 794 794 794 795 795 795 796 796 797 797 798

Chapter 41. DSN1LOGP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803| Determining the PSID for base and clone objectsSyntax and options of the DSN1LOGP control statement . . Reading archive log data sets on tape . . . . . . Locating table and index identifiers . . . . . . . Sample DSN1LOGP control statements . . . . . . DSN1LOGP output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805 811 812 813 813 816

Chapter 42. DSN1PRNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823Syntax and options of the DSN1PRNT control statement Printing with DSN1PRNT instead of DSN1COPY . . Determining page size and DSSIZE . . . . . . . Sample DSN1PRNT control statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 824 830 830 831

Chapter 43. DSN1SDMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833Syntax and options of the DSN1SDMP control statement . Assigning buffers . . . . . . . . . . . . . . Conditions for generating a dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 834 . 839 . 840

xii

Utility Guide and Reference

Stopping or modifying DSN1SDMP traces . Sample DSN1SDMP control statements . .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. .

. 840 . 841

Part 4. Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 845Appendix A. Limits in DB2 for z/OS . . . . . . . . . . . . . . . . . . . . . . . 847 Appendix B. DB2-supplied stored procedures . . . . . . . . . . . . . . . . . . 853DSNUTILS stored procedure . DSNUTILU stored procedure . DSNACCOR stored procedure. DSNACCOX stored procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 860 871 874 895

Appendix C. Advisory or restrictive states . . . . . . . . . . . . . . . . . . . . 925Auxiliary CHECK-pending status . Auxiliary warning status . . . . CHECK-pending status . . . . . COPY-pending status . . . . . . DBET error status . . . . . . . Group buffer pool RECOVER-pending Informational COPY-pending status . REBUILD-pending status . . . . RECOVER-pending status . . . . REFRESH-pending status . . . . REORG-pending status . . . . . Restart-pending status . . . . . . . . . . . . . . . . . . . . status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925 926 927 927 928 928 929 929 930 931 931 932

|

Appendix D. Productivity-aid sample programs . . . . . . . . . . . . . . . . . . 933DSNTIAUL . . . . . DSNTIAD . . . . . DSNTEP2 and DSNTEP4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934 . 940 . 941

|

Appendix E. How real-time statistics are used by DB2 utilities . . . . . . . . . . . 947 Appendix F. Real-time statistics . . . . . . . . . . . . . . . . . . . . . . . . 949Setting up your system for real-time statistics . . . . . . Setting the interval for writing real-time statistics . . . . Establishing base values for real-time statistics . . . . . Contents of the real-time statistics tables . . . . . . . . Operating with real-time statistics . . . . . . . . . . DSNACCOX stored procedure. . . . . . . . . . . DSNACCOR stored procedure. . . . . . . . . . . When DB2 externalizes real-time statistics . . . . . . . How DB2 utilities affect the real-time statistics . . . . . How non-DB2 utilities affect real-time statistics. . . . . Real-time statistics on objects in work file databases . . . Real-time statistics for DEFINE NO objects . . . . . . Real-time statistics on read-only or nonmodified objects . . How dropping objects affects real-time statistics . . . . How SQL operations affect real-time statistics counters . . Real-time statistics in data sharing . . . . . . . . . How the EXCHANGE command affects real-time statistics . Improving concurrency with real-time statistics . . . . Recovering the real-time statistics tables . . . . . . . Statistics accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 949 . 949 . 949 . 949 . 949 . 950 . 978 . 999 . 999 . 1007 . 1007 . 1007 . 1007 . 1007 . 1007 . 1009 . 1009 . 1010 . 1010 . 1010

|

Appendix G. Delimited file format . . . . . . . . . . . . . . . . . . . . . . . 1011Delimited data types . . . Examples of delimited files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1012 . 1013

Contents

xiii

Information resources for DB2 for z/OS and related products . . . . . . . . . . . 1015 How to obtain DB2 information . . . . . . . . . . . . . . . . . . . . . . . . 1021 How to use the DB2 library . . . . . . . . . . . . . . . . . . . . . . . . . . 1025 Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1029Programming Interface Information . . . . . . . . . . . . . . . . General-use Programming Interface and Associated Guidance Information . . Product-sensitive Programming Interface and Associated Guidance Information . Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1030 1031 1031 1031

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077

xiv

Utility Guide and Reference

About this informationThis information contains usage information for the tasks of system administration, database administration, and operation. It presents detailed information about using utilities, specifying syntax (including keyword and parameter descriptions), and starting, stopping, and restarting utilities. This book also includes job control language (JCL) and control statements for each utility. This information assumes that your DB2 subsystem is running in Version 9.1 new-function mode. Generally, new functions that are described, including changes to existing functions, statements, and limits, are available only in new-function mode. Two exceptions to this general statement are new and changed utilities and optimization enhancements, which are also available in conversion mode unless stated otherwise.

Who should read this informationThis information is intended for system administrators, database administrators, system operators, and application programmers of DB2 online and stand-alone utilities. Recommendation: Familiarize yourself with DB2 for z/OS prior to using this book.

DB2 Utilities SuiteImportant: In this version of DB2 for z/OS, the DB2 Utilities Suite is available as an optional product. You must separately order and purchase a license to such utilities, and discussion of those utility functions in this publication is not intended to otherwise imply that you have a license to them. The DB2 Utilities Suite is designed to work with the DFSORT program, which you are licensed to use in support of the DB2 utilities even if you do not otherwise license DFSORT for general use. If your primary sort product is not DFSORT, consider the following informational APARs mandatory reading: v II14047/II14213: USE OF DFSORT BY DB2 UTILITIES v II13495: HOW DFSORT TAKES ADVANTAGE OF 64-BIT REAL ARCHITECTURE These informational APARs are periodically updated. Related information DB2 utilities packaging (Utility Guide)

Terminology and citationsIn this information, DB2 Version 9.1 for z/OS is referred to as "DB2 for z/OS." In cases where the context makes the meaning clear, DB2 for z/OS is referred to as "DB2." When this information refers to titles of DB2 for z/OS books, a short title is used. (For example, "See DB2 SQL Reference" is a citation to IBM DB2 Version 9.1 for z/OS SQL Reference.)

Copyright IBM Corp. 1983, 2010

xv

When referring to a DB2 product other than DB2 for z/OS, this information uses the product's full name to avoid ambiguity. The following terms are used as indicated: DB2 Represents either the DB2 licensed program or a particular DB2 subsystem. OMEGAMON Refers to any of the following products: v IBM Tivoli OMEGAMON XE for DB2 Performance Expert on z/OS v IBM Tivoli OMEGAMON XE for DB2 Performance Monitor on z/OS v IBM DB2 Performance Expert for Multiplatforms and Workgroups v IBM DB2 Buffer Pool Analyzer for z/OS C, C++, and C language Represent the C or C++ programming language. | CICS Represents CICS Transaction Server for z/OS. IMS Represents the IMS Database Manager or IMS Transaction Manager. MVS Represents the MVS element of the z/OS operating system, which is equivalent to the Base Control Program (BCP) component of the z/OS operating system. RACF Represents the functions that are provided by the RACF component of the z/OS Security Server.

Accessibility features for DB2 Version 9.1 for z/OSAccessibility features help a user who has a physical disability, such as restricted mobility or limited vision, to use information technology products successfully.

Accessibility featuresThe following list includes the major accessibility features in z/OS products, including DB2 Version 9.1 for z/OS. These features support: v Keyboard-only operation. v Interfaces that are commonly used by screen readers and screen magnifiers. v Customization of display attributes such as color, contrast, and font size Tip: The Information Management Software for z/OS Solutions Information Center (which includes information for DB2 Version 9.1 for z/OS) and its related publications are accessibility-enabled for the IBM Home Page Reader. You can operate all features using the keyboard instead of the mouse.

Keyboard navigationYou can access DB2 Version 9.1 for z/OS ISPF panel functions by using a keyboard or keyboard shortcut keys. For information about navigating the DB2 Version 9.1 for z/OS ISPF panels using TSO/E or ISPF, refer to the z/OS TSO/E Primer, the z/OS TSO/E User's Guide, and the z/OS ISPF User's Guide. These guides describe how to navigate each interface, including the use of keyboard shortcuts or function keys (PF keys). Each guide includes the default settings for the PF keys and explains how to modify their functions.

xvi

Utility Guide and Reference

Related accessibility informationOnline documentation for DB2 Version 9.1 for z/OS is available in the Information Management Software for z/OS Solutions Information Center, which is available at the following Web site: http://publib.boulder.ibm.com/infocenter/dzichelp

IBM and accessibilitySee the IBM Accessibility Center at http://www.ibm.com/able for more information about the commitment that IBM has to accessibility.

How to send your commentsYour feedback helps IBM to provide quality information. Please send any comments that you have about this book or other DB2 for z/OS documentation. You can use the following methods to provide comments: v Send your comments by e-mail to [email protected] and include the name of the product, the version number of the product, and the number of the book. If you are commenting on specific text, please list the location of the text (for example, a chapter and section title or a help topic title). v You can send comments from the Web. Visit the DB2 for z/OS - Technical Resources Web site at: http://www.ibm.com/support/docview.wss?&uid=swg27011656 This Web site has an online reader comment form that you can use to send comments. v You can also send comments by using the feedback link at the footer of each page in the Information Management Software for z/OS Solutions Information Center at http://publib.boulder.ibm.com/infocenter/db2zhelp.

Naming conventions used in this informationThis topic describes naming conventions that are unique to commands and utilities. When you use a parameter for an object that is created by SQL statements (for example, tables, table spaces, and indexes), identify the object by following the SQL syntactical naming conventions. See the description for naming conventions in DB2 SQL Reference. In this book, characters are classified as letters, digits, or special characters. v A letter is any one of the uppercase characters A through Z (including the three characters that are reserved in the United States as alphabetic extenders for national languages, #, @, and $.). v A digit is any one of the characters 0 through 9. v A special character is any character other than a letter or a digit. See DB2 SQL Reference for an additional explanation of long identifiers, short identifiers, and location identifiers. authorization-id A short identifier of one to eight letters, digits, or the underscore that identifies a set of privileges. An authorization ID must begin with a letter.

About this information

xvii

connection-name An identifier of one to eight characters that identifies an address space connection to DB2. A connection identifier is one of the following values: v v v v TSO (for DSN processes that run in TSO foreground). BATCH (for DSN processes that run in TSO batch). DB2CALL (for the call attachment facility (CAF)). The system identification name (for IMS and CICS processes).

See DB2 Administration Guide for more information about managing DB2 connections. correlation-id An identifier of 1 to 12 characters that identifies a process within an address space connection. A correlation ID must begin with a letter. A correlation ID can be one of the following values: v The TSO logon identifier (for DSN processes that run in TSO foreground and for CAF processes). v The job name (for DSN processes that run in TSO batch). v The PST#.PSBNAME (for IMS processes). v The entry identifier.thread_number.transaction_identifier (for CICS processes). See DB2 Administration Guide for more information about correlation IDs. cursor-name An identifier that designates a result set. Cursor names that are specified with the EXEC SQL and LOAD utilities cannot be longer than eight characters. database-name A short identifier that identifies a database. The identifier must start with a letter and must not include special characters. data-set-name An identifier of 1 to 44 characters that identifies a data set. dbrm-member-name An identifier of one to eight letters or digits that identifies a member of a partitioned data set. A DBRM member name should not begin with DSN because of a potential conflict with DB2-provided DBRM member names. If you specify a DBRM member name that begins with DSN, DB2 issues a warning message. dbrm-pds-name An identifier of 1 to 44 characters that identifies a partitioned data set. ddname An identifier of one to eight characters that identifies the name of a DD statement. hexadecimal-constant A sequence of digits or any of the letters from A to F (uppercase or lowercase). hexadecimal-string An X followed by a sequence of characters that begins and ends with the string delimiter, an apostrophe. The characters between the string delimiters must be a hexadecimal number. | index-name A qualified or unqualified name that identifies an index.

xviii

Utility Guide and Reference

| | | | | |

A qualified index name is a schema name followed by a period and an identifier. An unqualified index name is an identifier with an implicit schema name qualifier. The implicit schema is determined by the rules in DB2 SQL Reference. If the index name contains a blank character, the name must be enclosed in quotation marks when specified in a utility control statement. location-name A location identifier of 1 to 16 letters (but excluding the alphabetic extenders), digits, or the underscore that identifies an instance of a database management system. A location name must begin with a letter. luname An SQL short identifier of one to eight characters that identifies a logical unit name. A LU name must begin with a letter. member-name An identifier of one to eight letters (including the three alphabetic extenders) or digits that identifies a member of a partitioned data set. A member name should not begin with DSN because of a potential conflict with DB2-provided member names. If you specify a member name that begins with DSN, DB2 issues a warning message. qualifier-name An SQL short identifier of one to eight letters, digits, or the underscore that identifies the implicit qualifier for unqualified table names, views, indexes, and aliases. string A sequence of characters that begins and ends with an apostrophe. subsystem-name An identifier that specifies the DB2 subsystem as it is known to the operating system.

| | | | | | | | | | | | | |

table-name A qualified or unqualified name that designates a table. A fully qualified table name is a three-part name. The first part is a location name that designates the DBMS at which the table is stored. The second part is a schema name. The third part is an SQL identifier. A period must separate each of the parts. A two-part table name is implicitly qualified by the location name of the current server. The first part is a schema name. The second part is an SQL identifier. A period must separate the two parts. A one-part or unqualified table name is an SQL identifier with two implicit qualifiers. The first implicit qualifier is the location name of the current server. The second is a schema name, which is determined by the rules in DB2 SQL Reference. If the table name contains a blank, the name must be enclosed in quotation marks when specified in a utility control statement. table-space-name A short identifier that identifies a table space of an identified database. The identifier must start with a letter and must not include special characters. If a database is not identified, a table space name specifies a table space of database DSNDB04.About this information

xix

utility-id An identifier of 1 to 16 characters that uniquely identifies a utility process within DB2. A utility ID must begin with a letter. The remaining characters can be uppercase and lowercase letters, numbers 0 through 9, and the following characters: #, $, ., , !, , and @.

How to read syntax diagramsCertain conventions apply to the syntax diagrams that are used in IBM documentation. Apply the following rules when reading the syntax diagrams that are used in DB2 for z/OS documentation: v Read the syntax diagrams from left to right, from top to bottom, following the path of the line. The symbol indicates the beginning of a statement. The symbol indicates that the statement syntax is continued on the next line. The symbol indicates that a statement is continued from the previous line. The symbol indicates the end of a statement. v Required items appear on the horizontal line (the main path).required_item

v Optional items appear below the main path.required_item optional_item

If an optional item appears above the main path, that item has no effect on the execution of the statement and is used only for readability.optional_item required_item

v If you can choose from two or more items, they appear vertically, in a stack. If you must choose one of the items, one item of the stack appears on the main path.required_item required_choice1 required_choice2

If choosing one of the items is optional, the entire stack appears below the main path.required_item optional_choice1 optional_choice2

If one of the items is the default, it appears above the main path and the remaining choices are shown below.

xx

Utility Guide and Reference

default_choice required_item optional_choice optional_choice

v An arrow returning to the left, above the main line, indicates an item that can be repeated.

required_item

repeatable_item

If the repeat arrow contains a comma, you must separate repeated items with a comma., required_item repeatable_item

A repeat arrow above a stack indicates that you can repeat the items in the stack. | | | | | | | | | | | v With the exception of XPath keywords, keywords appear in uppercase (for example, FROM). Keywords must be spelled exactly as shown. XPath keywords are defined as lowercase names, and must be spelled exactly as shown. Variables appear in all lowercase letters (for example, column-name). They represent user-supplied names or values. v If punctuation marks, parentheses, arithmetic operators, or other such symbols are shown, you must enter them as part of the syntax. v Sometimes a diagram must be split into fragments. The syntax fragment is shown separately from the main syntax diagram, but the contents of the fragment should be read as if they are on the main path of the diagram.required_item fragment-name

fragment-name:required_item optional_name

About this information

xxi

xxii

Utility Guide and Reference

Part 1. Introduction to the DB2 utilitiesThese topics provide an overview of the DB2 for z/OS utilities, including the types of utilities and several restrictions when running utilities on certain objects. These topics also include information about utilities packaging and installation.

Copyright IBM Corp. 1983, 2010

1

2

Utility Guide and Reference

Chapter 1. Basic information about the DB2 utilitiesDB2 online and stand-alone utilities have specific authorization rules for coding utility control statements and the data sets that the utilities use.

Types of DB2 utilitiesThere are two types of DB2 utilities: online utilities and stand-alone utilities. DB2 online utilities run as standard batch jobs or stored procedures, and they require DB2 to be running. They do not run under control of the terminal monitor program (TMP); they have their own attachment mechanism and they invoke DB2 control facility services directly. The stand-alone utilities run as batch jobs that are independent of DB2. The only way to run these utilities is to use JCL. See the topics on the individual utilities for information about the ways to run these utilities. Related concepts Chapter 33, Invoking stand-alone utilities, on page 723 Related tasks Chapter 3, Invoking DB2 online utilities, on page 13

Privileges and authorization IDsA command or a utility job can be issued by an individual user, by a program that runs in batch mode, or by an IMS or CICS transaction. The term process describes any of these initiators. A process is represented to DB2 by a set of identifiers (IDs). What the process can do with DB2 is determined by privileges and privileges that can be held by its identifiers. The phrase "privilege set of a process" means the entire set of privileges and authorities that can be used by the process in a specific situation. Three types of identifiers exist: primary authorization IDs, secondary authorization IDs, and SQL authorization IDs. v Generally, the primary authorization ID identifies a specific process. For example, in the process that is initiated through the TSO attachment facility, the primary authorization ID is identical to the TSO logon ID. A trace record identifies the process by that ID. v Secondary authorization IDs, which are optional, can hold additional privileges that are available to the process. A secondary authorization ID is often a SecureWay Security Server Resource Access Control Facility (RACF) group ID. For example, a process can belong to a RACF group that holds the LOAD privilege on a particular database. Any member of the group can run the LOAD utility to load table spaces in the database. DB2 commands that are entered from a z/OS console are not associated with any secondary authorization IDs. v An SQL authorization ID (SQL ID) holds the privileges that are exercised when issuing certain dynamic SQL statements. Generally, this topic does not discuss the SQL ID. Copyright IBM Corp. 1983, 2010

3

Within DB2, a process can be represented by a primary authorization ID and possibly one or more secondary IDs. For DB2 online utilities, the process can be represented by a primary authorization ID, possibly one or more secondary IDs, and role, if running in a trusted connection with an associated role. An administrator can grant or revoke a privilege or authority for an identifier by executing an SQL GRANT or a REVOKE statement. If you use the access control authorization exit routine, that exit routine might control the authorization rules, rather than the exit routines that are documented for each utility. Related information "Processing of sign-on requests" (DB2 Administration Guide)

Utilities that can be run on declared temporary objectsThe REPAIR DBD utility and the STOSPACE utility can be run on declared temporary objects. v You can use the REPAIR DBD utility on declared temporary tables, which must be created in a database that is defined with the AS TEMP clause. v You can use the STOSPACE utility on storage groups that have objects within temporary databases. No other DB2 utilities can be used on a declared temporary table, its indexes, or its table spaces. For detailed information about target object support, see the Concurrency and compatibility topic for each utility.

Effect of utilities on objects that have the DEFINE NO attributeWith DB2 Version 7 or above, you can run certain online utilities on table spaces or index spaces that were defined with the DEFINE NO attribute. When you specify this attribute, the table space or index space is defined, but DB2 does not allocate the associated data sets until a row is inserted or loaded into a table in that table space. You can populate table spaces whose data sets are not yet defined by using the LOAD utility with either the RESUME keyword, the REPLACE keyword, or both. Using LOAD to populate these table spaces results in the following actions: 1. DB2 allocates the data sets. 2. DB2 updates the SPACE column in the catalog table to show that data sets exist. 3. DB2 loads the specified table space. For a partitioned table space, all partitions are allocated even if the LOAD utility is loading only one partition. Avoid attempting to populate a partitioned table space with concurrent LOAD PART jobs until after one of the jobs has caused all the data sets to be created. Online utilities that encounter an undefined target object might issue informational message DSNU185I, but processing continues.

4

Utility Guide and Reference

The following online utilities issue informational message DSNU185I when a table space or index space with the DEFINE NO attribute is encountered. The object is not processed. v CHECK DATA v CHECK INDEX v COPY v MERGECOPY v MODIFY RECOVERY v QUIESCE v REBUILD INDEX v RECOVER v REORG INDEX v REORG TABLESPACE v REPAIR, but not REPAIR DBD v RUNSTATS TABLESPACE INDEX(ALL) 1 v RUNSTATS INDEX 1 v UNLOAD Note: 1. RUNSTATS recognizes DEFINE NO objects and updates the catalog's access path statistics to reflect the empty objects. You cannot use stand-alone utilities on objects whose data sets have not been defined.

Effect of utilities on data that is encrypted through built-in functionsYou can copy and recover encrypted data. You can also move encrypted data between systems. Data remains encrypted throughout these processes. However, running any of the following utilities on encrypted data might produce unexpected results: v CHECK DATA v LOAD v v v v v REBUILD INDEX REORG TABLESPACE REPAIR RUNSTATS UNLOAD

v DSN1PRNT

Chapter 1. Basic information about the DB2 utilities

5

6

Utility Guide and Reference

Chapter 2. DB2 utilities packagingSeveral utilities are included with DB2 at no extra charge. Other utilities are available as a separate product. | | The following utilities are core utilities, which are included (at no extra charge) with Version 9.1 of DB2 for z/OS: v CATENFM v CATMAINT v DIAGNOSE v LISTDEF v OPTIONS v QUIESCE v REPAIR v REPORT v TEMPLATE v All DSN stand-alone utilities All other utilities are available as a separate product called the DB2 Utilities Suite (5655-N97, FMIDs JDB991K), which includes the following utilities: v BACKUP SYSTEM v CHECK DATA v CHECK INDEX v CHECK LOB v COPY v COPYTOCOPY v EXEC SQL v LOAD v MERGECOPY v MODIFY RECOVERY v MODIFY STATISTICS v REBUILD INDEX v RECOVER v REORG INDEX v REORG TABLESPACE v RESTORE SYSTEM v RUNSTATS v STOSPACE v UNLOAD All DB2 utilities operate on catalog, directory, and sample objects, without requiring any additional products.

| |

SMP/E jobs for DB2 utility productsTo load the DB2 utility products, use System Modification Program Extended (SMP/E). SMP/E processes the installation cartridges and creates DB2 distribution target libraries. DB2 provides several jobs that invoke SMP/E. These jobs are on the cartridge that you received with the utility product. The job prologues in these jobs contain directions on how to tailor the job for your site. Follow these directions carefully to ensure that your DB2 Utilities Suite SMP/E process works correctly. Copyright IBM Corp. 1983, 2010

7

| | | | | | | |

The SMP/E RECEIVE job, DSNRECVK, loads the DB2 Utilities Suite Version 9 program modules, macros, and procedures into temporary data sets (SMPTLIBs). If these jobs fail or abnormally terminate, correct the problem and rerun the jobs. The SMP/E APPLY job, DSNAPPLK, copies and link-edits the program modules, macros, and procedures for the DB2 Utilities Suite Version 9 into the DB2 target libraries. The SMP/E ACCEPT job, DSNACCPK, copies the program modules, macros, and procedures for the DB2 Utilities Suite Version 9 into the DB2 distributed libraries. Related information "SMP/E step 4: Run the receive jobs: DSNRECV1, DSNRECV2, DSNRECV3, DSNRECV4" (DB2 Installation Guide) "SMP/E step 6: Run the apply job: DSNAPPL1" (DB2 Installation Guide) "SMP/E step 7: Run the accept job: DSNACEP1" (DB2 Installation Guide)

The operation of DB2 utilities in a mixed-release data sharing environmentThe utilities batch module, DSNUTILB, is split into multiple parts: a release-independent module called DSNUTILB and multiple release-dependent modules, DSNUT910 and the utility-dependent load modules that are listed in the following table. To operate in a mixed-release data sharing environment, you must have the release-dependent modules from both releases and all applicable utility-dependent modules available to the utility jobs that operate across the data sharing group. The procedure for sharing utility modules is explained in DB2 Data Sharing: Planning and Administration. Use the information in the following table and the procedures that are outlined in DB2 Data Sharing: Planning and Administration to implement a mixed-release data sharing environment. | | | | | | | | | | | | | | | | |Table 1. Relationship between utility names and load modules Utility name BACKUP SYSTEM and RESTORE SYSTEM CATMAINT and CATENFM CHECK COPY COPYTOCOPY DIAGNOSE EXEC SQL LISTDEF LOAD MERGECOPY MODIFY RECOVERY and MODIFY STATISTICS OPTIONS QUIESCE REBUILD INDEX Load module name DSNU91LV DSNU91LA DSNU91LB DSNU91LC DSNU91LT DSNU91LD DSNU91LU DSNU91LE DSNU91LF DSNU91LG DSNU91LH DSNU91LI DSNU91LJ DSNU91LK

8

Utility Guide and Reference

| | | | | | | | | | |

Table 1. Relationship between utility names and load modules (continued) Utility name RECOVER REORG INDEX and REORG TABLESPACE REPAIR REPORT RUNSTATS STOSPACE TEMPLATE UNLOAD Load module name DSNU91LL DSNU91LM DSNU91LN DSNU91LO DSNU91LP DSNU91LQ DSNU91LR DSNU91LS

Chapter 2. DB2 utilities packaging

9

10

Utility Guide and Reference

Part 2. DB2 online utilitiesDB2 online utilities run as standard batch jobs or stored procedures, and they require DB2 to be running. They do not run under control of the terminal monitor program (TMP); they have their own attachment mechanism and they invoke DB2 control facility services directly.

Copyright IBM Corp. 1983, 2010

11

12

Utility Guide and Reference

Chapter 3. Invoking DB2 online utilitiesYou can invoke DB2 online utilities using one of five methods. Requirement: In the JCL for all utility jobs, specify a load library that is at a maintenance level that is compatible with the DB2 system. Otherwise, errors can occur. To run DB2 online utilities: 1. Prepare the necessary data sets. 2. Create a utility control statement using the syntax, option descriptions, and samples. 3. Check for any concurrency and compatibility restrictions. 4. Plan for a restart in case the utility job does not complete. 5. Invoke the online utilities using one of the following methods: v Use the DB2 Utilities panel in DB2I. This method involves little involvement with JCL. You can edit the generated JCL to alter or add necessary fields on the JOB or ROUTE cards before you submit the job. Requirement: To use this method you must have TSO and access to the DB2 Utilities Panel in DB2 Interactive (DB2I). v Use the DSNU CLIST command in TSO. This method involves little involvement with JCL. You can edit the generated JCL to alter or add necessary fields on the JOB or ROUTE cards before you submit the job. Requirement: To use this method you must have TSO. v Use the supplied JCL procedure (DSNUPROC). This method involves working with or creating your own JCL. v Use the EXEC statement to create the JCL data set yourself. This method involves working with or creating your own JCL. v Use the DSNUTILS or DSNUTILT stored procedure. This method involves invoking online utilities from a DB2 application program. Related concepts Appendix B, DB2-supplied stored procedures, on page 853 Related reference DSNUTILS stored procedure on page 860 DSNUTILU stored procedure on page 871 DSNACCOR stored procedure on page 874 DSNACCOX stored procedure on page 895

Data sets that online utilities useEvery online utility job requires a SYSIN DD statement to describe an input data set; some utilities also require other data sets. Copyright IBM Corp. 1983, 2010

13

For input data sets The online utilities use the logical record length (LRECL), the record format (RECFM) and the block size (BLKSIZE) with which the data set was created. Variable-spanned (VS) or variable-blocked-spanned (VBS) record formats are not allowed for utility input data sets. The only exception is for the LOAD utility, which accepts unloaded data in VBS format. For output data sets The online utilities determine both the logical record length and the record format. Any specified values for LRECL or RECFM are ignored. If you supply block size, that size is used; otherwise, the utility lets the system determine the optimal block size for the storage device. DB2 supports the large block interface (LBI) that allows block sizes that are greater than 32 KB on certain tape drives. LBI is supported in new function mode (NFM) only. Partitioned data sets (PDS) are not allowed for output data sets. The TAPEBLKSZLIM parameter of the DEVSUPxx member of SYS1.PARMLIB controls the block size limit for tapes. See the z/OS MVS Initialization and Tuning Guide for more details. For both input and output data sets The online utilities use the value that you supply for the number of buffers (BUFNO), with a maximum of 99 buffers. The default number of buffers is 20. The utilities set the number of channel programs equal to the number of buffers. The parameters that specify the buffer size (BUFSIZE) and the number of channel programs (NCP) are ignored. If you omit any DCB parameters, the utilities choose default values. Increasing the number of buffers (BUFNO) can result in an increase in real storage utilization and page fixing below the 16-MB line. Restriction: DB2 does not support the undefined record format (RECFM=U) for any data set.

| | | |

Data set concatenationDB2 utilities let you concatenate unlike input data sets. Therefore, the data sets in a concatenation list can have different block sizes, logical record lengths, and record formats. If you want to concatenate variable and fixed-blocked data sets, the logical record length must be 8 bytes smaller than the block size. You cannot concatenate output data sets.

Controlling data set dispositionMost data sets need to exist only during utility execution (for example, during reorganization). However, you must retain several data sets in certain circumstances: v Retain the image copy data sets until you no longer need them for recovery. v Retain the unload data sets if you specify UNLOAD PAUSE, UNLOAD ONLY, UNLOAD EXTERNAL, or DISCARD for the REORG utility. v Retain the SYSPUNCH data set if you specify UNLOAD EXTERNAL or DISCARD for the REORG utility until you no longer need the contents for subsequent loads. v Retain the discard data set until you no longer need the contents for subsequent loads.

14

Utility Guide and Reference

Because you might need to restart a utility, take the following precautions when defining the disposition of data sets: v Use DISP=(NEW,CATLG,CATLG) or DISP=(MOD,CATLG) for data sets that you want to retain. v Use DISP=(MO