1100
Db2 11 for z/OS Version Utility Guide and Reference IBM SC19-4067-09

Version Db2 11 for z/OS - IBM€¦ · Db2 11 for z/OS Version Utility Guide and Reference IBM SC19-4067-09. Notes Before using this information and the product it supports, be sure

  • Upload
    others

  • View
    43

  • Download
    0

Embed Size (px)

Citation preview

  • Db2 11 for z/OSVersion

    Utility Guide and Reference

    IBM

    SC19-4067-09

  • Notes

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

    Subsequent editions of this PDF will not be delivered in IBM Publications Center. Always download thelatest edition from Db2® 11 for z/OS® Product Documentation.

    2020-05-12 edition

    This edition applies to Db2 11 for z/OS (product number 5615-DB2), Db2 11 for z/OS Value Unit Edition (product number5697-P43), Db2 Utilities Suite for z/OS, Version 11 (product number 5655-W87), and to any subsequent releases untilotherwise 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 captionindicates that the figure has changed. Editorial changes that have no technical significance are not noted.© Copyright International Business Machines Corporation 1983, 2020.US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract withIBM Corp.

    http://www-01.ibm.com/support/docview.wss?uid=swg27039165

  • Contents

    About this information......................................................................................... xvWho should read this information..............................................................................................................xvDb2 Utilities Suite for z/OS.........................................................................................................................xvTerminology and citations......................................................................................................................... xviAccessibility features for Db2 11 for z/OS................................................................................................xviHow to send your comments....................................................................................................................xviiNaming conventions used in this information......................................................................................... xviiHow to read syntax diagrams....................................................................................................................xix

    Part 1. Basic information about Db2 utilities...........................................................1

    Chapter 1. Db2 utilities packaging.............................................................................................................. 3

    Chapter 2. Privileges and authorization IDs for Db2 utilities..................................................................... 5

    Chapter 3. Utilities that can be run on declared temporary objects.......................................................... 7

    Chapter 4. Effect of utilities on objects that have the DEFINE NO attribute..............................................9

    Chapter 5. Effect of utilities on encrypted data ....................................................................................... 11

    Part 2. Db2 online utilities....................................................................................13

    Chapter 6. Invoking Db2 online utilities....................................................................................................15Data sets that online utilities use........................................................................................................ 16Utility control statements.................................................................................................................... 18Invoking an online utility by using the DB2 Utilities panel in DB2I.................................................... 21DB2 Utilities panel...............................................................................................................................22Data Set Names panel.........................................................................................................................23Control Statement Data Set Names panel........................................................................................ 24Invoking a Db2 utility by using the DSNU CLIST command in TSO.................................................... 25

    DSNU CLIST command syntax....................................................................................................... 27DSNU CLIST command output....................................................................................................... 32

    The supplied JCL procedure (DSNUPROC) for invoking a Db2 online utility...................................... 33Invoking a Db2 online utility by creating the JCL data set yourself ...................................................35

    Chapter 7. Monitoring and controlling online utilities.............................................................................. 37Monitoring utilities................................................................................................................................37Monitoring processor use by utilities...................................................................................................38Subsystem parameters for refining DFSMSdss COPY operation with utilities...................................38Determining why a utility failed to complete.......................................................................................40Terminating an online utility................................................................................................................ 41Restarting an online utility................................................................................................................... 42

    Overriding the default utility restart behavior by using the RESTART parameter........................ 45Restarting a utility after the output data set is full........................................................................ 45How utilities restart with templates...............................................................................................46How utilities restart with lists ........................................................................................................46

    Chapter 8. BACKUP SYSTEM..................................................................................................................... 49Syntax and options of the BACKUP SYSTEM control statement.........................................................50

    iii

  • Before running BACKUP SYSTEM........................................................................................................ 52Copy pools.......................................................................................................................................52Data sets that BACKUP SYSTEM uses............................................................................................53Concurrency and compatibility for BACKUP SYSTEM....................................................................53

    Dumping a fast replication copy to tape..............................................................................................54Backups of log copy pools....................................................................................................................54Termination or restart of BACKUP SYSTEM........................................................................................ 55Sample BACKUP SYSTEM control statements.................................................................................... 55

    Chapter 9. CATENFM................................................................................................................................. 57Syntax and options of the CATENFM control statement.....................................................................57Before converting the catalog..............................................................................................................58

    Data sets that CATENFM uses when converting the catalog.........................................................58Concurrency and compatibility for CATENFM................................................................................59

    Converting to new-function mode....................................................................................................... 59Termination or halt of CATENFM......................................................................................................... 59

    Chapter 10. CATMAINT............................................................................................................................. 61Updating the catalog for installation or migration to Db2 11............................................................. 64Renaming the owner, creator, and schema of database objects........................................................64Changing the ownership of objects from an authorization ID to a role.............................................. 65Changing the catalog name used by storage groups or index spaces and table spaces................... 65Identifying invalidated packages after the owner, creator, or schema name of an object is

    renamed.......................................................................................................................................... 66

    Chapter 11. CHECK DATA..........................................................................................................................67Syntax and options of the CHECK DATA control statement............................................................... 68Before running CHECK DATA............................................................................................................... 77

    Data sets that CHECK DATA uses...................................................................................................78Concurrency and compatibility for CHECK DATA.......................................................................... 82

    Exception tables for the CHECK DATA utility...................................................................................... 84Exception processing for tables with auxiliary columns..................................................................... 85Specifying the scope of CHECK DATA..................................................................................................85How violations are identified............................................................................................................... 85Detection and correction of constraint violations............................................................................... 86CHECK DATA XML error detection....................................................................................................... 86Correcting XML data after running CHECK DATA................................................................................ 87Resetting CHECK-pending status........................................................................................................ 87LOB column errors................................................................................................................................87Resetting auxiliary CHECK-pending status......................................................................................... 89Termination and restart of CHECK DATA.............................................................................................89Sample CHECK DATA control statements........................................................................................... 90

    Chapter 12. CHECK INDEX........................................................................................................................ 93Syntax and options of the CHECK INDEX control statement..............................................................94Data sets that CHECK INDEX uses.......................................................................................................97

    Shadow data sets for CHECK INDEX..............................................................................................98Concurrency and compatibility for CHECK INDEX............................................................................ 100Single logical partitions......................................................................................................................101Indexes in parallel..............................................................................................................................102Reviewing CHECK INDEX output....................................................................................................... 105Termination or restart of CHECK INDEX........................................................................................... 105Correcting XML data after running CHECK INDEX............................................................................ 106Sample CHECK INDEX control statements....................................................................................... 106

    Chapter 13. CHECK LOB.......................................................................................................................... 109Syntax and options of the CHECK LOB control statement................................................................110Before running CHECK LOB............................................................................................................... 112

    iv

  • Data sets that CHECK LOB uses...................................................................................................113Concurrency and compatibility for CHECK LOB...........................................................................115

    How CHECK LOB identifies violations................................................................................................116Removing CHECK-pending status for a LOB table space................................................................. 116Resolving media failure......................................................................................................................116Termination or restart of CHECK LOB................................................................................................117Sample CHECK LOB control statements........................................................................................... 117

    Chapter 14. COPY.................................................................................................................................... 119Syntax and options of the COPY control statement..........................................................................121Before running COPY......................................................................................................................... 131

    Data sets that COPY uses............................................................................................................. 131Concurrency and compatibility for COPY.....................................................................................133

    Full image copies................................................................................................................................136Incremental image copies................................................................................................................. 137Multiple image copies........................................................................................................................ 138FlashCopy image copies.................................................................................................................... 140Copies of lists of objects.................................................................................................................... 144Using more than one COPY statement.............................................................................................. 146Copying partitions or data sets simultaneously................................................................................ 146Copies of partition-by-growth table spaces......................................................................................146Copies of XML table spaces............................................................................................................... 147Copying catalog and directory objects.............................................................................................. 147Make copies of XML schema repository objects............................................................................... 148Copies of indexes............................................................................................................................... 148Using DFSMSdss concurrent copy.....................................................................................................148Specifying conditional image copies................................................................................................. 150Allocation of sequential image copy data sets..................................................................................151Preparing for recovery by using the COPY utility.............................................................................. 151Improving performance of the COPY utility...................................................................................... 153Generation data group definitions for the COPY utility.....................................................................153Using Db2 with DFSMS products....................................................................................................... 154Image copies on tape.........................................................................................................................154Termination of COPY..........................................................................................................................154Restart of COPY..................................................................................................................................154Sample COPY control statements..................................................................................................... 155

    Chapter 15. COPYTOCOPY...................................................................................................................... 165Syntax and options of the COPYTOCOPY control statement............................................................166Data sets that COPYTOCOPY uses.................................................................................................... 171Concurrency and compatibility for COPYTOCOPY............................................................................ 172Full or incremental image copies with COPYTOCOPY...................................................................... 173Incremental image copies with COPYTOCOPY................................................................................. 173Using more than one COPYTOCOPY statement................................................................................ 174Copying from a specific image copy.................................................................................................. 174Copying a FlashCopy image copy by using COPYTOCOPY................................................................175Using TEMPLATE with COPYTOCOPY................................................................................................ 175SYSCOPY records that are updated by COPYTOCOPY......................................................................175How COPYTOCOPY determines which input copy to use................................................................. 175Generation data group definitions for the COPYTOCOPY utility.......................................................176Using Db2 with DFSMS products....................................................................................................... 176Image copies on tape.........................................................................................................................176Copies of lists of objects from tape................................................................................................... 177Termination or restart of COPYTOCOPY............................................................................................178Sample COPYTOCOPY control statements....................................................................................... 178

    Chapter 16. DIAGNOSE........................................................................................................................... 183How to force a utility abend...............................................................................................................189

    v

  • Chapter 17. EXEC SQL............................................................................................................................. 191

    Chapter 18. LISTDEF............................................................................................................................... 195Syntax and options of the LISTDEF control statement.....................................................................195Concurrency and compatibility for LISTDEF..................................................................................... 204Creating the LISTDEF control statement...........................................................................................204How to include objects in a list.......................................................................................................... 205Previewing the contents of a list........................................................................................................208Creating LISTDEF libraries.................................................................................................................208Referencing LISTDEF lists in other utility jobs.................................................................................. 209Using the TEMPLATE utility with LISTDEF.........................................................................................211Using the OPTIONS utility with LISTDEF...........................................................................................211Termination or restart of LISTDEF.....................................................................................................212Sample LISTDEF control statements................................................................................................ 212

    Chapter 19. LOAD.................................................................................................................................... 217Syntax and options of the LOAD control statement..........................................................................219Before running LOAD..........................................................................................................................274

    Data sets that LOAD uses............................................................................................................. 275Concurrency and compatibility for LOAD.....................................................................................282Preparing Db2 internal format input records that are not generated by UNLOAD for LOAD..... 284

    When to use SORTKEYS NO...............................................................................................................284Loading variable-length data............................................................................................................. 285How LOAD orders loaded records..................................................................................................... 285Replacing data with LOAD..................................................................................................................285Loading tables with special column types by using generated LOAD statements...........................288Adding more data to a table or partition........................................................................................... 290Deleting all the data in a table space................................................................................................ 290Loading partitions...............................................................................................................................290Loading partition-by-growth table spaces........................................................................................ 293Loading data containing XML columns.............................................................................................. 293Loading delimited files.......................................................................................................................294Loading data with referential constraints..........................................................................................297Referential constraint violations........................................................................................................298Compressing data by using the LOAD utility..................................................................................... 298How to load data from DL/I............................................................................................................... 300Loading data by using the cross-loader function.............................................................................. 301How to use inline COPY with LOAD................................................................................................... 302Creating a FlashCopy image copy with LOAD....................................................................................303Improving LOAD performance...........................................................................................................304Conversion of input data.................................................................................................................... 307Specifying input fields........................................................................................................................309Specifying the TRUNCATE and STRIP options.................................................................................. 309How LOAD builds indexes while loading data................................................................................... 310Building indexes in parallel for LOAD................................................................................................ 310How LOAD leaves free space............................................................................................................. 313Loading with RECOVER-pending, REBUILD-pending, or REORG-pending status............................313Exit procedures.................................................................................................................................. 314Loading ROWID columns................................................................................................................... 314Loading a LOB column....................................................................................................................... 314LOAD LOG on a LOB table space........................................................................................................315Loading an XML column..................................................................................................................... 316LOAD LOG on an XML table space..................................................................................................... 317Running LOAD RESUME YES SHRLEVEL CHANGE without logging.................................................. 317Collecting inline statistics while loading a table............................................................................... 317Inline COPY for a base table space................................................................................................... 318Termination of LOAD..........................................................................................................................318

    vi

  • Restart of LOAD..................................................................................................................................319After running LOAD............................................................................................................................ 321

    Copying the loaded table space or partition................................................................................322Resetting restricted status after running the LOAD utility.......................................................... 322Running CHECK INDEX after loading a table that has indexes................................................... 325Recovering data after a failed LOAD job...................................................................................... 326Reorganization of an auxiliary index after LOAD......................................................................... 327

    Effects of running LOAD..................................................................................................................... 327Sample LOAD control statements..................................................................................................... 328

    Chapter 20. MERGECOPY........................................................................................................................341Syntax and options of the MERGECOPY control statement..............................................................342Data sets that MERGECOPY uses...................................................................................................... 344Concurrency and compatibility for MERGECOPY.............................................................................. 345Full or incremental image copy......................................................................................................... 346How MERGECOPY determines which input copy to use...................................................................346Using MERGECOPY with individual data sets....................................................................................346Using MERGECOPY or COPY.............................................................................................................. 347Avoiding MERGECOPY LOG RBA inconsistencies............................................................................. 347Termination or restart of MERGECOPY............................................................................................. 347Sample MERGECOPY control statements......................................................................................... 348

    Chapter 21. MODIFY RECOVERY............................................................................................................ 351How MODIFY RECOVERY deletes rows.............................................................................................357Reclaiming space in the DBD.............................................................................................................358Improving REORG performance after adding a column................................................................... 358The effect of MODIFY RECOVERY on version numbers.................................................................... 359Sample MODIFY RECOVERY control statements..............................................................................360

    Chapter 22. MODIFY STATISTICS.......................................................................................................... 363Syntax and options of the MODIFY STATISTICS control statement................................................ 364Data sets that MODIFY STATISTICS uses.........................................................................................366Concurrency and compatibility for MODIFY STATISTICS.................................................................366Guidelines for deciding which statistics history rows to delete....................................................... 367Deletion of specific statistics history rows........................................................................................367Termination or restart of MODIFY STATISTICS................................................................................ 367Sample MODIFY STATISTICS control statements............................................................................367

    Chapter 23. OPTIONS..............................................................................................................................369Syntax and options of the OPTIONS control statement................................................................... 369Concurrency and compatibility for OPTIONS....................................................................................372Executing statements in preview mode............................................................................................ 372Specifying LISTDEF and TEMPLATE libraries....................................................................................373Overriding standard utility processing behavior............................................................................... 373Termination or restart of OPTIONS................................................................................................... 373Sample OPTIONS control statements...............................................................................................373

    Chapter 24. QUIESCE.............................................................................................................................. 377Syntax and options of the QUIESCE control statement....................................................................378Before running QUIESCE....................................................................................................................380

    Data sets that QUIESCE uses....................................................................................................... 380Concurrency and compatibility for QUIESCE...............................................................................381

    Use of QUIESCE on catalog and directory objects............................................................................ 382Common quiesce points.................................................................................................................... 383Running QUIESCE on a table space in pending status......................................................................384Reasons why QUIESCE fails to write to disk..................................................................................... 384Termination and restart of QUIESCE.................................................................................................384Sample QUIESCE control statements............................................................................................... 385

    vii

  • Chapter 25. REBUILD INDEX.................................................................................................................. 389Syntax and options of the REBUILD INDEX control statement........................................................ 390Before running REBUILD INDEX........................................................................................................400

    Data sets that REBUILD INDEX uses........................................................................................... 401Concurrency and compatibility for REBUILD INDEX................................................................... 403

    Access with REBUILD INDEX SHRLEVEL.......................................................................................... 405Rebuilding index partitions................................................................................................................ 406Rebuilding indexes on partition-by-growth table spaces.................................................................406How to improve performance when rebuilding index partitions...................................................... 406Rebuilding multiple indexes.............................................................................................................. 407Resetting the REBUILD-pending status............................................................................................ 411Rebuilding critical catalog indexes....................................................................................................412Recoverability of a rebuilt index........................................................................................................ 412Creating a FlashCopy image copy with REBUILD INDEX..................................................................412Termination or restart of REBUILD INDEX........................................................................................ 413The effect of REBUILD INDEX on index version numbers................................................................ 413Sample REBUILD INDEX control statements....................................................................................414

    Chapter 26. RECOVER............................................................................................................................. 417Syntax and options of the RECOVER control statement...................................................................418Before running RECOVER...................................................................................................................428

    Data sets that RECOVER uses...................................................................................................... 428Concurrency and compatibility for RECOVER..............................................................................429

    Recovering with a system-level backup............................................................................................431How to determine which system-level backups Db2 recovers........................................................ 432Determining which recovery base Db2 uses..................................................................................... 432Determining whether the system-level backups reside on disk or tape..........................................433Recovering a table space................................................................................................................... 433Recovering a list of objects................................................................................................................ 434Recovering a data set or partition......................................................................................................435Recovery with incremental copies.....................................................................................................435Recovering with FlashCopy image copies......................................................................................... 436Recovering a page.............................................................................................................................. 437Recovering an error range..................................................................................................................438Effect on RECOVER of the NOT LOGGED or LOGGED table space attributes...................................438Recovering with a data set copy that is not made by Db2................................................................439Recovering catalog and directory objects......................................................................................... 440

    Objects that contain recovery information.................................................................................. 444Point-in-time recovery of the catalog, directory, and all user objects........................................446

    Reinitializing DSNDB01.SYSUTILX.................................................................................................... 448Recovering a table space that contains LOB or XML data................................................................ 448Recovering a table space that contains clone objects......................................................................449Point-in-time recovery....................................................................................................................... 449Avoiding specific image copy data sets during a recovery............................................................... 457How to improve RECOVER performance........................................................................................... 458Optimizing the LOGAPPLY phase.......................................................................................................459Recovering image copies in a JES3 environment............................................................................. 460Resetting RECOVER-pending or REBUILD-pending status.............................................................. 460How the RECOVER utility performs fallback recovery...................................................................... 461How the RECOVER utility retains tape mounts................................................................................. 461Avoiding damaged media...................................................................................................................462Termination or restart of RECOVER...................................................................................................462Effects of running RECOVER.............................................................................................................. 463Sample RECOVER control statements.............................................................................................. 464

    Chapter 27. REORG INDEX......................................................................................................................467Syntax and options of the REORG INDEX control statement........................................................... 468

    viii

  • Before running REORG INDEX........................................................................................................... 484Data sets that REORG INDEX uses ..............................................................................................485Concurrency and compatibility for REORG INDEX...................................................................... 489

    Determining which indexes require reorganization.......................................................................... 491Using the LEAFDISTLIMIT and REPORTONLY options to determine when reorganization is

    needed...........................................................................................................................................492Access with REORG INDEX SHRLEVEL..............................................................................................492Creating a FlashCopy image copy with REORG INDEX..................................................................... 494Temporarily interrupting REORG....................................................................................................... 494Improving performance with REORG INDEX.................................................................................... 495Termination of REORG INDEX........................................................................................................... 495Restart of REORG INDEX................................................................................................................... 496Review of REORG INDEX output........................................................................................................497Effect of REORG INDEX on index version numbers.......................................................................... 498Sample REORG INDEX control statements.......................................................................................498

    Chapter 28. REORG TABLESPACE...........................................................................................................501Syntax and options of the REORG TABLESPACE control statement................................................ 504Before running REORG TABLESPACE................................................................................................ 544

    Data sets that REORG TABLESPACE uses....................................................................................549Concurrency and compatibility for REORG TABLESPACE........................................................... 557

    Determining whether an object requires reorganization.................................................................. 562Access with REORG TABLESPACE SHRLEVEL...................................................................................564Unloading without reloading..............................................................................................................566Reclaiming space from dropped tables.............................................................................................567Reorganizing the catalog and directory.............................................................................................567Changing data set definitions............................................................................................................ 571Temporarily interrupting REORG....................................................................................................... 571How to override dynamic sort work data set allocation................................................................... 571Redistributing data across partitions by using REORG.....................................................................572How partitions can be unloaded and reloaded in parallel................................................................ 573How to use inline copy with REORG TABLESPACE........................................................................... 573Creating a FlashCopy image copy with REORG TABLESPACE.......................................................... 574Improving REORG TABLESPACE performance................................................................................. 575Parallel index building for REORG TABLESPACE...............................................................................577How Db2 unloads data.......................................................................................................................580Failure during the RELOAD phase......................................................................................................580Reorganization of partitioned table spaces.......................................................................................580Reorganization of partition-by-growth table spaces........................................................................ 580Reorganization of segmented table spaces...................................................................................... 581Comparison of the numbers of loaded and unloaded records......................................................... 582Reorganization of a LOB table space.................................................................................................582Reorganization of an XML table space...............................................................................................583Reorganization with pending definition changes.............................................................................. 584Compression after materialization of inline LOB changes................................................................584Termination of REORG TABLESPACE................................................................................................ 585Restart of REORG TABLESPACE........................................................................................................ 586Review of REORG TABLESPACE output.............................................................................................588After running REORG TABLESPACE...................................................................................................589Effects of running REORG TABLESPACE............................................................................................589Sample REORG TABLESPACE control statements............................................................................591

    Chapter 29. REPAIR.................................................................................................................................605Syntax and options of the REPAIR control statement...................................................................... 606Before running REPAIR...................................................................................................................... 624

    Data sets that REPAIR uses......................................................................................................... 624Concurrency and compatibility for REPAIR................................................................................. 625

    Resetting table space status............................................................................................................. 628

    ix

  • Resetting index space status.............................................................................................................629Repairing a damaged page................................................................................................................ 629Repairing DBDs.................................................................................................................................. 629Locating rows by key..........................................................................................................................631Using VERIFY with REPLACE and DELETE operations...................................................................... 631Repairing critical catalog table spaces and indexes......................................................................... 631Termination or restart of REPAIR...................................................................................................... 631Review of REPAIR output...................................................................................................................632After running REPAIR.........................................................................................................................632Sample REPAIR control statements..................................................................................................632

    Chapter 30. REPORT................................................................................................................................637Syntax and options of the REPORT control statement..................................................................... 638Data sets that REPORT uses.............................................................................................................. 642Concurrency and compatibility for REPORT......................................................................................642Running REPORT on the catalog and directory................................................................................. 643Termination or restart of REPORT..................................................................................................... 643REPORT output...................................................................................................................................643Sample REPORT control statements.................................................................................................648

    Chapter 31. RESTORE SYSTEM............................................................................................................... 663Syntax and options of the RESTORE SYSTEM control statement.....................................................664Before running RESTORE SYSTEM.................................................................................................... 665While running RESTORE SYSTEM...................................................................................................... 667After running RESTORE SYSTEM....................................................................................................... 668Sample RESTORE SYSTEM control statements................................................................................ 669

    Chapter 32. RUNSTATS........................................................................................................................... 673RUNSTATS TABLESPACE syntax and options................................................................................... 675RUNSTATS INDEX syntax and options.............................................................................................. 687Statistics profile syntax......................................................................................................................693Data sets that RUNSTATS uses......................................................................................................... 695Concurrency and compatibility for RUNSTATS................................................................................. 697Collecting distribution statistics for column groups......................................................................... 699Updating statistics for a partitioned table space.............................................................................. 700Collection of statistics on the Db2 catalog and directory................................................................. 700Collecting frequency statistics for data-partitioned secondary indexes..........................................701Collecting statistics history................................................................................................................701Collection of statistics on LOB table spaces..................................................................................... 702Collection of statistics on XML objects..............................................................................................702Review of RUNSTATS output............................................................................................................. 703Resetting access path statistics........................................................................................................ 708Sample RUNSTATS control statements............................................................................................ 711

    Chapter 33. STOSPACE............................................................................................................................717Syntax and options of the STOSPACE control statement................................................................. 718Data sets that STOSPACE uses..........................................................................................................718Concurrency and compatibility for STOSPACE..................................................................................719How STOSPACE ensures availability of objects it STOSPACE requires............................................ 719Obtaining statistical information with STOSPACE.............................................................................719Analysis of the values in a SPACE or SPACEF column.......................................................................720Termination or restart of STOSPACE................................................................................................. 720Sample STOSPACE control statement...............................................................................................721

    Chapter 34. TEMPLATE........................................................................................................................... 723Syntax and options of the TEMPLATE control statement................................................................. 723Before running TEMPLATE.................................................................................................................740

    Concurrency and compatibility for TEMPLATE............................................................................ 740

    x

  • Key TEMPLATE operations.................................................................................................................740Choosing data set names...................................................................................................................741Default space calculations for data set templates............................................................................742Guidelines for templates and tape data sets.................................................................................... 743How TEMPLATE supports GDG data sets.......................................................................................... 744Template switching............................................................................................................................745Termination or restart of TEMPLATE................................................................................................. 745Sample TEMPLATE control statements.............................................................................................745

    Chapter 35. UNLOAD............................................................................................................................... 749Syntax and options of the UNLOAD control statement ....................................................................753Unloading partitions...........................................................................................................................786Unloading XML data........................................................................................................................... 786Unloading LOB data............................................................................................................................787Unloading data in spanned record format.........................................................................................788Selecting tables and rows to unload................................................................................................. 789Selecting and ordering columns to unload........................................................................................789Unloading data from image copy data sets.......................................................................................790Data type conversion with the UNLOAD utility..................................................................................792Output field types...............................................................................................................................792Output field positioning and size....................................................................................................... 794Layout of output fields....................................................................................................................... 795Output for special values Infinity, sNaN, or NaN.............................................................................. 797Unloading delimited files................................................................................................................... 797Specifying TRUNCATE and STRIP options for output data...............................................................800LOAD statements that are generated by UNLOAD............................................................................801Unloading compressed data.............................................................................................................. 802Field specification errors................................................................................................................... 802Sample UNLOAD control statements................................................................................................ 802

    Part 3. Db2 stand-alone utilities.........................................................................809

    Chapter 36. Invoking stand-alone utilities............................................................................................. 811Specifying options for stand-alone utilities by using the JCL EXEC PARM parameter.................... 812Stand-alone utility control statements..............................................................................................812

    Chapter 37. DSNJCNVB...........................................................................................................................815

    Chapter 38. DSNJCNVT........................................................................................................................... 817

    Chapter 39. DSNJLOGF (preformat active log).......................................................................................821

    Chapter 40. DSNJU003 (change log inventory)......................................................................................823Making changes for active logs..........................................................................................................837Making changes for archive logs........................................................................................................839A conditional restart control record.................................................................................................. 839Deleting log data sets with errors......................................................................................................839Altering references to log data sets in the BSDS.............................................................................. 841Defining the high-level qualifier for catalog and directory objects...................................................841Renaming Db2 system data sets....................................................................................................... 842Renaming Db2 active log data sets................................................................................................... 842Renaming Db2 archive log data sets................................................................................................. 842Sample DSNJU003 control statements............................................................................................ 843

    Chapter 41. DSNJU004 (print log map).................................................................................................. 847Syntax and options of the DSNJU004 control statement.................................................................848Sample DSNJU004 control statement.............................................................................................. 849

    xi

  • DSNJU004 (print log map) output..................................................................................................... 849

    Chapter 42. DSNJU008 (print CDDS)......................................................................................................861Syntax and options of the DSNJU008 control statement.................................................................862DSNJU008 examples......................................................................................................................... 864

    Chapter 43. DSN1COMP..........................................................................................................................865Syntax and options of the DSN1COMP control statement................................................................867Before running DSN1COMP............................................................................................................... 870How to estimate compression savings achieved with option REORG..............................................870Free space in compression calculations on table space.................................................................. 871Sample DSN1COMP control statements........................................................................................... 871DSN1COMP output.............................................................................................................................873

    Chapter 44. DSN1COPY...........................................................................................................................877Syntax and options of the DSN1COPY control statement ............................................................... 880Before running DSN1COPY................................................................................................................ 885

    Data sets that DSN1COPY uses....................................................................................................886Inconsistent data checks...................................................................................................................891The effects of not specifying the OBIDXLAT option..........................................................................891Requirements for using an image copy as input to DSN1COPY....................................................... 891Copying from an image copy..............................................................................................................892Restoring indexes with DSN1COPY................................................................................................... 893Restoring table spaces with DSN1COPY........................................................................................... 893Printing with DSN1COPY....................................................................................................................895Copying tables from one subsystem to another............................................................................... 895Sample DSN1COPY control statements ........................................................................................... 897

    Chapter 45. DSN1LOGP...........................................................................................................................901Syntax and options of the DSN1LOGP control statement................................................................ 903Determining the PSID for base and clone objects............................................................................ 910Archive log data sets on tape.............................................................................................................910Sample DSN1LOGP control statements............................................................................................ 911DSN1LOGP output..............................................................................................................................913

    Chapter 46. DSN1PRNT...........................................................................................................................919Syntax and options of the DSN1PRNT control statement................................................................ 921Printing with DSN1PRNT instead of DSN1COPY............................................................................... 926Determining the page size and data set size for DSN1PRNT............................................................926Sample DSN1PRNT control statements............................................................................................926

    Chapter 47. DSN1SDMP.......................................................................................................................... 929Syntax and options of the DSN1SDMP control statement................................................................931Assigning buffers................................................................................................................................935Conditions for generating a dump..................................................................................................... 935Stopping or modifying DSN1SDMP traces.........................................................................................935Sample DSN1SDMP control statements........................................................................................... 936

    Appendix A. Supplied stored procedures for utility operations............................ 941

    Appendix B. Advisory or restrictive states.......................................................... 943Auxiliary CHECK-pending status............................................................................................................. 943Auxiliary warning status.......................................................................................................................... 944CHECK-pending status............................................................................................................................ 945COPY-pending status.............................................................................................................................. 947DBETE status........................................................................................................................................... 947Group buffer pool RECOVER-pending status..........................................................................................949

    xii

  • Informational COPY-pending status....................................................................................................... 949PRO restricted status.............................................................................................................................. 950REBUILD-pending status.........................................................................................................................950RECOVER-pending status........................................................................................................................951REFRESH-pending status........................................................................................................................ 952REORG-pending status............................................................................................................................953Restart-pending status............................................................................................................................956

    Appendix C. DSN1SMFP.....................................................................................959Before running DSN1SMFP..................................................................................................................... 961Running DSN1SMFP................................................................................................................................ 961Sample DSN1SMFP control statement................................................................................................... 962DSN1SMFP output................................................................................................................................... 962DSN1SMFP output record structure....................................................................................................... 964

    Standard report header......................................................................................................................964IFCID003: DDF Location.................................................................................................................... 965IFCID004: Trace Start........................................................................................................................966IFCID005: Trace Stop........................................................................................................................ 966IFCID023: Utility Start....................................................................................................................... 967IFCID024: Utility Change...................................................................................................................970IFCID025: Utility End.........................................................................................................................971IFCID083: Identify End......................................................................................................................971IFCID106: System Parameters (security-relevant fields only)........................................................ 972IFCID140: Audit Authorization Failures............................................................................................ 981IFCID141: Audit DDL Grant/Revoke..................................................................................................987IFCID142: Audit DDL Create/Alter/Drop........................................................................................... 988IFCID143: Audit First Write............................................................................................................... 990IFCID144: Audit First Read............................................................................................................... 990IFCID145: Audit DML Statement.......................................................................................................991IFCID269: Trusted Connection......................................................................................................... 993IFCID270: Trusted Context............................................................................................................... 994IFCID350: SQL Statement................................................................................................................. 995IFCID361: Audit Administrative Authorities..................................................................................... 996IFCID362: Trace Start and Stop with AUDITPOLICY......................................................................1000SYSPRINT: Runtime messages and end-of-job summary..............................................................1002

    Appendix D. DSNADMSB.................................................................................. 1003Parameters of the DSNADMSB program...............................................................................................1004Before running DSNADMSB...................................................................................................................1012Data sets that DSNADMSB uses............................................................................................................1013Copying the data that DSNADMSB and ADMIN_INFO_SQL collect to another subsystem................ 1013Examples of DSNADMSB invocation.....................................................................................................1014

    Appendix E. DSNTSMFD...................................................................................1023Before running DSNTSMFD................................................................................................................... 1023Data sets that DSNTSMFD uses............................................................................................................ 1023Examples of DSNTSMFD invocation..................................................................................................... 1024

    Appendix F. How real-time statistics are used by Db2 utilities...........................1027

    Appendix G. Delimited file format.................................................................... 1029Data types in delimited files..................................................................................................................1030Examples of delimited files...................................................................................................................1031

    Information resources for Db2 11 for z/OS and related products....................... 1033

    xiii

  • Notices............................................................................................................1035Programming interface information......................................................................................................1036Trademarks............................................................................................................................................1036Terms and conditions for product documentation...............................................................................1037Privacy policy considerations................................................................................................................1037

    Glossary.......................................................................................................... 1039

    Index.............................................................................................................. 1041

    xiv

  • About this information

    This information contains usage information for the tasks of system administration, databaseadministration, and operation. It presents detailed information about using utilities, specifying syntax(including keyword and parameter descriptions), and starting, stopping, and restarting utilities. This bookalso includes job control language (JCL) and control statements for each utility.

    Throughout this information, "Db2" means "Db2 11 for z/OS". References to other Db2 products usecomplete names or specific abbreviations.

    Important: To find the most up to date content, always use IBM® Knowledge Center, which is continuallyupdated as soon as changes are ready. PDF manuals are updated only when new editions are published,on an infrequent basis.

    This information assumes that Db2 11 is running in new-function mode, and that your application isrunning with the application compatibility value of 'V11R1'.

    Availability of new function in Db2 11

    The behavior of data definition statements such as CREATE, ALTER, and DROP, which embed datamanipulation SQL statements that contain new capabilities, depends on the application compatibilityvalue that is in effect for the application. An application compatibility value of 'V11R1' must be ineffect for applications to use new capability in embedded statements such as SELECT, INSERT,UPDATE, DELETE, MERGE, CALL, and SET assignment-statement. Otherwise, an applicationcompatibility value of 'V10R1' can be used for data definition statements.

    Generally, new SQL capabilities, including changes to existing language elements, functions, datamanipulation statements, and limits, are available only in new-function mode with applications set toan application compatibility value of 'V11R1'.

    Optimization and virtual storage enhancements are available in conversion mode unless statedotherwise.

    SQL statements can continue to run with the same expected behavior as in DB2® 10 new-functionmode with an application compatibility value of 'V10R1'.

    Who should read this informationThis information is intended for system administrators, database administrators, system operators, andapplication programmers of Db2 online and stand-alone utilities.

    Recommendation: Familiarize yourself with Db2 for z/OS prior to using this book.

    Db2 Utilities Suite for z/OSImportant: In Db2 11, the Db2 Utilities Suite for z/OS is available as an optional product. You mustseparately order and purchase a license to such utilities, and discussion of those utility functions in thispublication is not intended to otherwise imply that you have a license to them.

    Db2 11 utilities can use the DFSORT program regardless of whether you purchased a license for DFSORTon your system. For more information, see the following informational APARs:

    • II14047• II14213• II13495

    © Copyright IBM Corp. 1983, 2020 xv

    http://www.ibm.com/support/knowledgecenter/SSEPEK/db2z_prodhome.html

  • Db2 utilities can use IBM Db2 Sort for z/OS (5655-W42) as an alternative to DFSORT for utility SORT andMERGE functions. Use of Db2 Sort for z/OS requires the purchase of a Db2 Sort for z/OS license. For moreinformation about Db2 Sort for z/OS, see Db2 Sort for z/OS.

    Related concepts“Db2 utilities packaging” on page 3Several utilities are included with Db2 at no extra charge. Other utilities are available in the separate Db2Utilities Suite for z/OS product.

    Terminology and citationsWhen referring to a Db2 product other than Db2 for z/OS, this information uses the product's full name toavoid ambiguity.

    About the Db2 brand change: IBM is rebranding DB2 to Db2. As such, there will be changes to all theDb2 offerings. For example, "DB2 for z/OS" is now referred to as "Db2 for z/OS," beginning with Db2 11.While IBM implements the change across the Db2 family of products, you might see references to theoriginal name "DB2 for z/OS" or "DB2" in different IBM web pages and documents. "DB2 for z/OS" and"Db2 for z/OS" refer to the same product, when the PID, Entitlement Entity, version, modification, andrelease information match. For more information, see Revised naming for IBM Db2 family products.

    The following terms are used as indicated:

    Db2Represents either the Db2 licensed program or a particular Db2 subsystem.

    Tivoli® OMEGAMON® XE for Db2 Performance Expert on z/OSRefers to any of the following products:

    • IBM Tivoli OMEGAMON XE for Db2 Performance Expert on z/OS• IBM Db2 Performance Monitor on z/OS• IBM Db2 Performance Expert for Multiplatforms and Workgroups• IBM Db2 Buffer Pool Analyzer for z/OS

    C, C++, and C languageRepresent the C or C++ programming language.

    CICS®Represents CICS Transaction Server for z/OS.

    IMSRepresents 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 ControlProgram (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 11 for z/OSAccessibility features help a user who has a physical disability, such as restricted mobility or limitedvision, to use information technology products successfully.

    Accessibility features

    The following list includes the major accessibility features in z/OS products, including Db2 11 for z/OS.These features support:

    • Keyboard-only operation.

    xvi About this information

    http://www.ibm.com/software/data/db2imstools/db2tools/db2-sort/http://ibm.biz/Rebrand4Db2

  • • Interfaces that are commonly used by screen readers and screen magnifiers.• Customization of display attributes such as color, contrast, and font size

    Tip: The IBM Knowledge Center (which includes information for Db2 for z/OS) and its related publicationsare accessibility-enabled for the IBM Home Page Reader. You can operate all features using the keyboardinstead of the mouse.

    Keyboard navigation

    For information about navigating the Db2 for z/OS ISPF panels using TSO/E or ISPF, refer to the z/OSTSO/E Primer, the z/OS TSO/E User's Guide, and the z/OS ISPF User's Guide. These guides describe how tonavigate each interface, including the use of keyboard shortcuts or function keys (PF keys). Each guideincludes the default settings for the PF keys and explains how to modify their functions.

    Related accessibility information

    IBM and accessibility

    See the IBM Accessibility Center at http://www.ibm.com/able for more information about the commitmentthat IBM has to accessibility.

    How to send your commentsYour feedback helps IBM to provide quality information. Please send any comments that you have aboutthis book or other Db2 for z/OS documentation.

    Send your comments by email to [email protected] and include the name of the product, the versionnumber of the product, and the number of the book. If you are commenting on specific text, please listthe location of the text (for example, a chapter and section title or a help topic title).

    Naming conventions used in this informationWhen you use Db2 commands and utilities, be aware of the applicable naming conventions

    When you use a parameter for an object that is created by SQL statements (for example, tables, tablespaces, and indexes), identify the object by following the SQL syntactical naming conventions.

    In this information, characters are classified as letters, digits, or special characters.

    • A letter is any one of the uppercase characters A through Z (including the three characters that arereserved in the United States as alphabetic extenders for national languages, #, @, and $.).

    • A digit is any one of the characters 0 through 9.• A special character is any character other than a letter or a digit.

    authorization-idA short identifier of one to eight letters, digits, or the underscore that identifies a set of privileges. Anauthorization ID must begin with a letter.

    connection-nameAn identifier of one to eight characters that identifies an address space connection to Db2. Aconnection identifier is one of the following values:

    • 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).

    Related information:

    About this information xvii

    http://www.ibm.com/ablemailto:[email protected]

  • Managing connection requests from local applications (Managing Security)

    correlation-idAn identifier of 1 to 12 characters that identifies a process within an address space connection. Acorrelation ID must begin with a letter.

    A correlation ID can be one of the following values:

    • The TSO logon identifier (for DSN processes that run in TSO foreground and for CAF processes).• The job name (for DSN processes that run in TSO batch).• The PST#.PSBNAME (for IMS processes).• The entry identifier.thread_number.transaction_identifier (for CICS processes).

    cursor-nameAn identifier that designates a result set. Cursor names that are specified with the EXEC SQL andLOAD utilities cannot be longer than eight characters.

    database-nameA short identifier that identifies a database. The identifier must start with a letter and must not includespecial characters.

    data-set-nameAn identifier of 1 to 44 characters that identifies a data set.

    dbrm-member-nameAn 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-providedDBRM member names. If you specify a DBRM member name that begins with DSN, Db2 issues awarning message.

    dbrm-pds-nameAn identifier of 1 to 44 characters that identifies a partitioned data set.

    ddnameAn identifier of one to eight characters that identifies the name of a DD statement.

    hexadecimal-constantA sequence of digits or any of the letters from A to F (uppercase or lowercase).

    hexadecimal-stringAn X followed by a sequence of characters that begins and ends with the string delimiter, anapostrophe. The characters between the string delimiters must be a hexadecimal number.

    index-nameA qualified or unqualified name that identifies an index.

    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 schemais determined by the SQL rules for unqualified types, functions, procedures, global variables, andspecific names.

    If the index name contains a blank character, the name must be enclosed in quotation marks whenspecified in a utility control statement.

    Related information:

    Unqualified type, function, procedure, global variable, and specific names (Db2 SQL)

    location-nameA location identifier of 1 to 16 letters (but excluding the alphabetic extenders), digits, or theunderscore that identifies an instance of a database management system. A location name mustbegin with a letter.

    lunameAn SQL short identifier of one to eight characters that identifies a logical unit name. A LU name mustbegin with a letter.

    xviii About this information

    http://www.ibm.co