0% found this document useful (0 votes)
291 views700 pages

Db2 v8 Db2 Adm Tools

Uploaded by

jbetarello-1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
291 views700 pages

Db2 v8 Db2 Adm Tools

Uploaded by

jbetarello-1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 700

IBM DB2 Administration Tool for z/OS

Version 7 Release 2

User's Guide and Reference



SC18-9552-14
IBM DB2 Administration Tool for z/OS
Version 7 Release 2

User's Guide and Reference



SC18-9552-14
Note:
Before using this information and the product it supports, read the information in “Notices” on page 659.

This edition applies to Version 7, Release 2 of IBM DB2 Administration Tool for z/OS (product number 5697-L90)
and to all subsequent releases and modifications until otherwise indicated in new editions.
This edition replaces SC18-9552-13.
© Copyright IBM Corporation 1995, 2010.
US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract
with IBM Corp.
Contents
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

About this information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv


Service updates and support information . . . . . . . . . . . . xv. . . . . . . . . . . . .
Conventions and terminology used in this information . . . . . . . . xv. . . . . . . . . . . . .
How to use this information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
How to look up message explanations . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Searching an information center . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi
Using a Web search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Using LookAt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
How to send your comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

Part 1. Introducing DB2 Admin . . . . . . . . . . . . . . . . . . . . . . . . 1

Chapter 1. DB2 Admin overview . . . . . . . . . . . . . . . . . . . . . . . . . 3


| What does DB2 Admin do? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
| Database administration and change management solutions . . . . . . . . . . . . . . . . . . . 6
DB2 Admin features and benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
DB2 Admin features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
DB2 Admin benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
DB2 Admin documentation and updates . . . . . . . . . . . . . . . . . . . . . . . . . 15
Accessibility features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Summary of changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Part 2. Getting started with DB2 Admin . . . . . . . . . . . . . . . . . . . . 25

Chapter 2. Activating DB2 Admin . . . . . . . . . . . . . . . . . . . . . . . . 27


Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Tailoring summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Step 1. Create the checkpoint table . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Using two different versions of DB2 Admin on the same DB2 subsystem . . . . . . . . . . . . . . . 32
Step 2. Create a segmented table space in a TEMP database . . . . . . . . . . . . . . . . . . . 32
Step 3. Set up to use Change Management . . . . . . . . . . . . . . . . . . . . . . . . . 33
Step 3(a). Create the Change Management database objects . . . . . . . . . . . . . . . . . . 33
Step 3(b). (Optional) Enable the delete change line command . . . . . . . . . . . . . . . . . . 34
Step 4. Binding application packages and plans . . . . . . . . . . . . . . . . . . . . . . . 34
Using two different versions of DB2 Admin on the same DB2 subsystem . . . . . . . . . . . . . . . 35
Step 5. Copy fixed-block libraries to variable-block libraries . . . . . . . . . . . . . . . . . . . 36
Step 6. Prepare ADBL CLIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Step 7. Verify activation of limited functionality . . . . . . . . . . . . . . . . . . . . . . . 42
Step 8. Customize the ISPF environment. . . . . . . . . . . . . . . . . . . . . . . . . . 44
Step 8(a). Run the customization EXEC . . . . . . . . . . . . . . . . . . . . . . . . . 46
Step 8(b). Supplying information about the customization panels . . . . . . . . . . . . . . . . 47
Step 9. Tailor the Main Menu and DB2 Selection Menu . . . . . . . . . . . . . . . . . . . . . 60
Step 9(a). Specify additional DB2 tools on the Main Menu . . . . . . . . . . . . . . . . . . . 61
Step 9(b). Specify DB2 subsystems on the DB2 Selection Menu . . . . . . . . . . . . . . . . . 61
Step 9(c). Submit jobs to tailor menus. . . . . . . . . . . . . . . . . . . . . . . . . . 64
Step 10. Customize the ADB2UCUS . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Step 11. Tailor the DB2 Admin Launchpad . . . . . . . . . . . . . . . . . . . . . . . . . 66
Step 12. Update the APF Authorization table . . . . . . . . . . . . . . . . . . . . . . . . 67
| Step 13. Prepare to run a work statement online . . . . . . . . . . . . . . . . . . . . . . . 68
Step 14. Create a catalog copy version table . . . . . . . . . . . . . . . . . . . . . . . . 68
Step 15. Create views for your own objects in the catalog . . . . . . . . . . . . . . . . . . . . 69
Step 16. Grant SELECT access on catalog tables . . . . . . . . . . . . . . . . . . . . . . . 69

© Copyright IBM Corp. 1995, 2010 iii


Step 17. Define Reverse Engineering stored procedure for CC/390 . . . . . . . . . . . . . . . . . 69
Step 18. Create additional DB2 catalog indexes . . . . . . . . . . . . . . . . . . . . . . . 69
Step 19. Optimize DSNWZP and DSNZPARM settings . . . . . . . . . . . . . . . . . . . . . 70
Step 20. Run the RUNSTATS utility . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Step 21. Define your own line commands . . . . . . . . . . . . . . . . . . . . . . . . . 70
Step 22. Tailor DB2 Admin Authorization Switching . . . . . . . . . . . . . . . . . . . . . . 71
Step 23. Verify installation of additional functionality . . . . . . . . . . . . . . . . . . . . . 73
Step 24. Make DB2 Admin available to users . . . . . . . . . . . . . . . . . . . . . . . . 74
Step 25. Upgrade to a new release of DB2 . . . . . . . . . . . . . . . . . . . . . . . . . 75
Step 26. Upgrade utility templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

Chapter 3. Using the DB2 Admin Launchpad . . . . . . . . . . . . . . . . . . . 77


Step 1. Create the Launchpad table . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Step 2. Modify the Launchpad table . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Adding tools to the Launchpad table . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Updating tools in the Launchpad table . . . . . . . . . . . . . . . . . . . . . . . . . 81
Deleting tools from the Launchpad table . . . . . . . . . . . . . . . . . . . . . . . . 82
Step 3. Launch tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Chapter 4. Using DB2 Admin panels . . . . . . . . . . . . . . . . . . . . . . . 83


Types of DB2 Admin panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Using table display panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Using BROWSE panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Using SQL error display panels. . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Finding the source code for panels . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Navigating DB2 Admin panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Using DB2 Admin commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Primary commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Line commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Using the DB2 Admin Look Up function . . . . . . . . . . . . . . . . . . . . . . . . . 91
Using search arguments to filter data on DB2 Admin panels . . . . . . . . . . . . . . . . . . . 93
Refreshing data on DB2 Admin panels . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Using scrollable fields on DB2 Admin panels . . . . . . . . . . . . . . . . . . . . . . . . 95
Checking the status of DB2 Admin . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
DB2 Administration Menu panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Chapter 5. DB2 Admin tutorial . . . . . . . . . . . . . . . . . . . . . . . . . 101


Running queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Sorting display data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Running utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Granting authorizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Creating views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Binding plans and packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Displaying detailed information about an object . . . . . . . . . . . . . . . . . . . . . . . 114
Reverse engineering objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

Part 3. Using DB2 Admin . . . . . . . . . . . . . . . . . . . . . . . . . . 119

Chapter 6. Setting DB2 Admin parameters . . . . . . . . . . . . . . . . . . . . 121


Using the DB2 Admin Parameters panel . . . . . . . . . . . . . . . . . . . . . . . . . 122
Changing ISPF settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Changing colors and highlights . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Changing DB2 Admin defaults . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Changing/Allocating print data sets. . . . . . . . . . . . . . . . . . . . . . . . . . 126
Changing DB2 Admin prompt options . . . . . . . . . . . . . . . . . . . . . . . . . 127
| Changing migrate settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Changing the SQL ID. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

Chapter 7. Querying the system catalog . . . . . . . . . . . . . . . . . . . . . 131

iv User's Guide and Reference


Using the System Catalog panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Using a copy of the DB2 catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Selecting a copy of the DB2 catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
| Creating reports from the DB2 catalog . . . . . . . . . . . . . . . . . . . . . . . . . . 134
| Overview of reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
| Generating a report . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
| Redefined columns in the DB2 catalog . . . . . . . . . . . . . . . . . . . . . . . . . . 138
| DB2 Admin restrictions on DB2 object names. . . . . . . . . . . . . . . . . . . . . . . . 139

Chapter 8. Building and running SQL statements . . . . . . . . . . . . . . . . . 141


Selecting a method for building and running SQL statements . . . . . . . . . . . . . . . . . . 142
Running SQL statements from screen input . . . . . . . . . . . . . . . . . . . . . . . . 143
Running SQL statements from a data set . . . . . . . . . . . . . . . . . . . . . . . . . 144
Running or explaining SQL statements from a program file . . . . . . . . . . . . . . . . . . . 144
Building SQL SELECT, INSERT, UPDATE and DELETE prototypes . . . . . . . . . . . . . . . . 147
Issuing CREATE, DROP, LABEL ON, and COMMENT ON statements . . . . . . . . . . . . . . . 152
Creating a database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Creating a table space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Creating a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Creating a materialized query table . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Creating an index on a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Placing a label on a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Placing a comment on a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Dropping a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Granting and revoking privileges on objects panel . . . . . . . . . . . . . . . . . . . . . . 167
| Revoking system authority from an SQLID . . . . . . . . . . . . . . . . . . . . . . . . 168

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) . . . . . . . . . 171


Generating SQL to re-create a DB2 object . . . . . . . . . . . . . . . . . . . . . . . . . 172
| Generating SQL using wildcard characters. . . . . . . . . . . . . . . . . . . . . . . . . 179
Sample output from generating SQL. . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Sample output with the Rebind option . . . . . . . . . . . . . . . . . . . . . . . . . . 186

Chapter 10. Running DB2 Admin performance queries. . . . . . . . . . . . . . . 187


Option 1. Table Spaces Without RUNSTATS Information panel . . . . . . . . . . . . . . . . . . 189
Option 1X. Indexes Without RUNSTATS Information panel . . . . . . . . . . . . . . . . . . . 190
Option 2. Table Spaces With More Than n Percent Relocated Rows panel . . . . . . . . . . . . . . 191
Option 3. Indexes With Clustering Level Problems panel . . . . . . . . . . . . . . . . . . . . 192
Option 4. Table Spaces With More Than n Percent Dropped Space panel . . . . . . . . . . . . . . 194
Option 5. DB2 Table Spaces With Locking Size = 'S' panel . . . . . . . . . . . . . . . . . . . 195
Option 6. Indexes with 2 or More Levels panel . . . . . . . . . . . . . . . . . . . . . . . 196
Option 7. Indexes with 150 or more leaf page distance panel . . . . . . . . . . . . . . . . . . 198
Option 8. Indexes On Tables With Fewer Than n Pages panel . . . . . . . . . . . . . . . . . . 199
Option 9. Indexes Not Used By Any Plan or Package panel . . . . . . . . . . . . . . . . . . . 200
Option 10. Table Spaces Containing More Than One Table panel . . . . . . . . . . . . . . . . . 201
Option 11. Table Spaces Without SPACE Information panel . . . . . . . . . . . . . . . . . . . 202
Option 11X. Indexes Without SPACE Information panel . . . . . . . . . . . . . . . . . . . . 203
Option 12. Table Spaces Exceeding Allocated Primary Quantity panel . . . . . . . . . . . . . . . 205
Option 12X. Indexes Exceeding Allocated Primary Quantity panel . . . . . . . . . . . . . . . . . 206
Option 13. Allocated and Used Space for Table Spaces panel . . . . . . . . . . . . . . . . . . 207
Option 14. Table Space Maintenance Recommendations panel . . . . . . . . . . . . . . . . . . 209
Option 14X. Index Space Maintenance Recommendations panel . . . . . . . . . . . . . . . . . 211

Chapter 11. Using LISTDEFs and TEMPLATEs . . . . . . . . . . . . . . . . . . 215


Managing LISTDEFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Creating the LISTDEF control tables . . . . . . . . . . . . . . . . . . . . . . . . . . 217
| Upgrading the LISTDEF control tables . . . . . . . . . . . . . . . . . . . . . . . . . 218
Adding a LISTDEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Editing a LISTDEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Editing a single LISTDEF clause . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

Contents v
Deleting a LISTDEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Managing TEMPLATEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Adding, editing, or deleting a TEMPLATE . . . . . . . . . . . . . . . . . . . . . . . 226
| Upgrading the TEMPLATE control tables . . . . . . . . . . . . . . . . . . . . . . . . 227
Utility Template panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Utility Template — Dataset Name panel . . . . . . . . . . . . . . . . . . . . . . . . 231
| Substitution variables in utility templates for PUNCHDDN when using a WSL . . . . . . . . . . . 233
TEMPLATE usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
| Using the utility template to unload data from LOBs . . . . . . . . . . . . . . . . . . . . . 236
| Using the utility template to unload data from an XML column . . . . . . . . . . . . . . . . . 237

Chapter 12. Changing DB2 objects . . . . . . . . . . . . . . . . . . . . . . . 239


Overview of changing objects in DB2 Admin . . . . . . . . . . . . . . . . . . . . . . . . 240
Changing databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Altering a database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Renaming a database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Work data sets used by the DB2 Admin Rename Database function . . . . . . . . . . . . . . . 243
Changing table spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Altering a table space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Redefining a table space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Work data sets used by the DB2 Admin Alter Redefine function . . . . . . . . . . . . . . . . 249
Changing tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Altering a table with the AL line command . . . . . . . . . . . . . . . . . . . . . . . 254
Examples of altering a table with the AL line command . . . . . . . . . . . . . . . . . . . 255
Redefining a table with the ALC line command . . . . . . . . . . . . . . . . . . . . . . 257
How the DB2 Admin Alter ALC function works. . . . . . . . . . . . . . . . . . . . . . 272
Changing objects related to a table being changed . . . . . . . . . . . . . . . . . . . . . 276
Changing multiple tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Changing indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Altering an index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
| Renaming an index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Redefining an index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Redefining a partitioning index . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Work data sets used by the DB2 Admin Alter Redefine function . . . . . . . . . . . . . . . . 285
Changing views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Using authorization switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
| Implicit LOB and XML table support . . . . . . . . . . . . . . . . . . . . . . . . . . 289

Chapter 13. Migrating DB2 objects, data, and catalog statistics . . . . . . . . . . . 291
Step 1. Specify the objects to migrate information . . . . . . . . . . . . . . . . . . . . . . 293
Step 2. Generate batch jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Step 3. Run the batch jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Step 4. Optional: Transfer the jobs/work statement list and data to the target system . . . . . . . . . . 299
Step 5. Run the batch define, reload, and optional jobs . . . . . . . . . . . . . . . . . . . . 299
Work data sets used by the DB2 Admin Migrate function . . . . . . . . . . . . . . . . . . . 300
Creating naming conventions for work data sets that are created by the DB2 Migrate function . . . . . . 302

Chapter 14. Using work statement lists . . . . . . . . . . . . . . . . . . . . . 305


Work statement lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Creating work statement lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Where work statement lists are stored . . . . . . . . . . . . . . . . . . . . . . . . . 309
How running a work statement list works. . . . . . . . . . . . . . . . . . . . . . . . 309
Managing work statement lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Viewing a WSL library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Cloning work statement lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Viewing a WSL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Interpreting a WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Validating a WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
| Running a WSL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
| Restarting a WSL that was run by another user . . . . . . . . . . . . . . . . . . . . . . 322

vi User's Guide and Reference


Sample scenario for creating and using a work statement list . . . . . . . . . . . . . . . . . . 323
| Running WSL with the utility template for LOBs . . . . . . . . . . . . . . . . . . . . . . 329
| Running WSL with the utility template for unloading XML data . . . . . . . . . . . . . . . . . 330
Using DB2 High Performance Unload within a work statement list . . . . . . . . . . . . . . . . 332
Invoking HPU within a work statement list . . . . . . . . . . . . . . . . . . . . . . . 332
Using HPU with MIGRATE and work statement lists . . . . . . . . . . . . . . . . . . . . 333
Using HPU in a work statement list that is not created by DB2 Object Comparison Tool, ALTER, or ALC . . 333
How HPU reads the DB2 catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Creating work statement lists manually . . . . . . . . . . . . . . . . . . . . . . . . . 334
Running work statement list entries in parallel . . . . . . . . . . . . . . . . . . . . . . 334
Supplying input to the batch restart program (ADBTEP2) . . . . . . . . . . . . . . . . . . 335

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA . . . . . . 339
Introduction to ADBTEP2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Parameters passed to ADBTEP2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Using ADBTEP2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Dialog support for batch job checkpoint table . . . . . . . . . . . . . . . . . . . . . . . 344
Restarting an ADBTEP2 job. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
| The ADBTEP2 summary report . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
| Using ADBTEP2 with LOBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
Overview of ADBTEPA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Using ADBTEPA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Restarting ADBTEPA after a failure . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
ADBOPT parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Pausing ADBTEP2 and ADBTEPA . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

Chapter 16. Running DB2 utilities. . . . . . . . . . . . . . . . . . . . . . . . 355


Using table space utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Editing generated JCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Changing batch job utility parameters . . . . . . . . . . . . . . . . . . . . . . . . . 358
Specifying utility options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
| Using utility options for XML and LOBs . . . . . . . . . . . . . . . . . . . . . . . . . 362
Using table utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Editing generated JCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Using index utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Editing generated JCL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Running utilities on LISTDEFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Using offline utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369

Chapter 17. Invoking DB2 EXPLAIN . . . . . . . . . . . . . . . . . . . . . . . 371


Using the main EXPLAIN panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Explaining SQL Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
Listing rows from a plan table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Upgrading a plan table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Creating a plan table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Creating an index on a plan table . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Creating a statement table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Creating a function table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377

Chapter 18. Administering DB2 Admin. . . . . . . . . . . . . . . . . . . . . . 379


System Administration panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Displaying threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Displaying or terminating utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Displaying or managing traces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Displaying or updating the owner of Resource Limit (RLIMIT) Tables . . . . . . . . . . . . . . . 386
Stopping DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Displaying group information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Displaying or managing batch checkpoint tables. . . . . . . . . . . . . . . . . . . . . . . 392
Managing system parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
System Parameters — System Parameters panel . . . . . . . . . . . . . . . . . . . . . . 396

Contents vii
System Parameters — Archive Log panel . . . . . . . . . . . . . . . . . . . . . . . . 398
Unrecognized Macro Parameters panel . . . . . . . . . . . . . . . . . . . . . . . . . 398
Displaying buffer pool status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Altering buffer pools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Displaying buffer pool hit ratios . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Displaying archive log information . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Setting archive log parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Archiving the current DB2 log. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Displaying log information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Changing DB2 system checkpoint frequency . . . . . . . . . . . . . . . . . . . . . . . . 405
Displaying or updating communications settings . . . . . . . . . . . . . . . . . . . . . . 405
Displaying or updating the LOCATIONS table . . . . . . . . . . . . . . . . . . . . . . 406
Displaying or updating the LUNAMES table . . . . . . . . . . . . . . . . . . . . . . . 407
Displaying or updating the IPNAMES table . . . . . . . . . . . . . . . . . . . . . . . 408
Displaying or updating the LUMODES table . . . . . . . . . . . . . . . . . . . . . . . 408
Displaying or updating the MODESELECT table . . . . . . . . . . . . . . . . . . . . . 409
Displaying or updating the USERNAMES table . . . . . . . . . . . . . . . . . . . . . . 409
Displaying or updating the LULIST table . . . . . . . . . . . . . . . . . . . . . . . . 410
Displaying or cancelling distributed threads . . . . . . . . . . . . . . . . . . . . . . . . 410
Displaying location details and threads . . . . . . . . . . . . . . . . . . . . . . . . . . 412
Starting DDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Stopping DDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Managing stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
Displaying or altering stored procedures . . . . . . . . . . . . . . . . . . . . . . . . 414
Creating stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
| Creating native SQL procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Displaying stored procedure statistics . . . . . . . . . . . . . . . . . . . . . . . . . 423
Starting all stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Stopping all stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Creating views of stored procedures. . . . . . . . . . . . . . . . . . . . . . . . . . 424
Displaying views of stored procedures . . . . . . . . . . . . . . . . . . . . . . . . . 424
Managing functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Displaying or altering functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Creating functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Displaying function statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Starting all functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Stopping all functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Creating views of functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Displaying views of functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
Backing up and recovering a DB2 subsystem . . . . . . . . . . . . . . . . . . . . . . . . 431
Backing up the DB2 subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
Specifying a point in time to which to recover . . . . . . . . . . . . . . . . . . . . . . 432
Recovering the DB2 subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . 433

Chapter 19. Managing space . . . . . . . . . . . . . . . . . . . . . . . . . . 435


Launching DB2 Admin Space Manager . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Displaying page set statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
Resizing page sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
Moving between STOGROUP- and VCAT-related space . . . . . . . . . . . . . . . . . . . . 439
Table Space Estimator panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Index Space Estimator panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441

Chapter 20. Managing changes to DB2 objects . . . . . . . . . . . . . . . . . . 445


Overview of Change Management . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Change Management terminology . . . . . . . . . . . . . . . . . . . . . . . . . . 446
The Change Management process . . . . . . . . . . . . . . . . . . . . . . . . . . 447
The Change Management main menu panel . . . . . . . . . . . . . . . . . . . . . . . 452
Prerequisites for Change Management . . . . . . . . . . . . . . . . . . . . . . . . . 453
Recommendations for designing a Change Management strategy . . . . . . . . . . . . . . . . 454
Change Management scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454

viii User's Guide and Reference


Scenario: Making a simple change to a database . . . . . . . . . . . . . . . . . . . . . . 455
Scenario: Promoting changes from one system to another. . . . . . . . . . . . . . . . . . . 456
Making changes through Change Management . . . . . . . . . . . . . . . . . . . . . . . 457
Registering a change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Analyzing a change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Running a change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
| Recovering a change made through Change Management . . . . . . . . . . . . . . . . . . . 468
| Modifying a change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
| Deleting a change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Promoting changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Importing changes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Displaying the masks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Creating a mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Editing a mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Deleting a mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Ignores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Overview of ignores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Displaying the ignores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Creating an ignore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Editing an ignore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Deleting an ignore. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Displaying the versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
Creating a version from a version scope . . . . . . . . . . . . . . . . . . . . . . . . 492
Creating a version when running a change . . . . . . . . . . . . . . . . . . . . . . . 493
| Regenerating Change Management versions containing LOBs . . . . . . . . . . . . . . . . . 493
Deleting a version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Version scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Displaying the version scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
Creating a version scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Importing a version file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Editing a version scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Deleting a version scope. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Tracking changes and changed objects . . . . . . . . . . . . . . . . . . . . . . . . . . 498
Displaying changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
Displaying changed objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500

Chapter 21. Using masks . . . . . . . . . . . . . . . . . . . . . . . . . . . 503


Specifying a mask . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Mask definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Mask definition syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
| Specifying a REXX user exit for the overwrite value . . . . . . . . . . . . . . . . . . . . 511
DB2 catalog records that have default masks . . . . . . . . . . . . . . . . . . . . . . . 512
Mask definition examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519

Part 4. Advanced topics. . . . . . . . . . . . . . . . . . . . . . . . . . . 523

Chapter 22. Writing and modifying DB2 Admin applications . . . . . . . . . . . . 525


The application development process . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Sample application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
Types of panels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Controlling DB2 Admin processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
DB2 Admin processing flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Panel naming conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Using the DB2 Admin CLIST to invoke new applications . . . . . . . . . . . . . . . . . . . . 530
Updating rows using SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Using variables in your application . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
General DB2 Admin variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Variables that contain column values . . . . . . . . . . . . . . . . . . . . . . . . . 532

Contents ix
Chapter 23. Using copies of the DB2 catalog . . . . . . . . . . . . . . . . . . . 533
Adding entries to the catalog copy version table. . . . . . . . . . . . . . . . . . . . . . . 534
Catalog copies at remote sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Using previously defined multiple copies of the DB2 catalog . . . . . . . . . . . . . . . . . . 537

Chapter 24. Running DB2 Admin across distributed systems . . . . . . . . . . . . 539


Enabling DB2 Admin distributed support . . . . . . . . . . . . . . . . . . . . . . . . . 540
Using DB2 Admin distributed support . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Example: Accessing a remote subsystem . . . . . . . . . . . . . . . . . . . . . . . . 541

Part 5. Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543

Chapter 25. System catalog panels . . . . . . . . . . . . . . . . . . . . . . . 545


The System Catalog panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
| The trusted contexts panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
Option A. Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
Option C. Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Option D. Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Option DS. Database Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Option DSP. Database Structures with Plans and Packages . . . . . . . . . . . . . . . . . . . 559
Option E. User-Defined Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
Option F. Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Option G. Storage Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
Option H. Schemas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Option J. Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
Option K. Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 567
Option L. Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
Option M. DBRMs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577
Option N. Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
Option O. Stored Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
Option P. Plans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582
Option Q. Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Option S. Table Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591
Option T. Tables, Views, and Aliases. . . . . . . . . . . . . . . . . . . . . . . . . . . 594
Option V. Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Option X. Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Option Y. Synonyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Authorizations for objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
Revoking all authorizations from a user . . . . . . . . . . . . . . . . . . . . . . . . . 606
Granting a set of authorizations to a user . . . . . . . . . . . . . . . . . . . . . . . . . 608

Chapter 26. DB2 Admin commands . . . . . . . . . . . . . . . . . . . . . . . 611


DB2 Admin primary commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
DB2 Admin line commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617

Chapter 27. DB2 Admin data type conversions . . . . . . . . . . . . . . . . . . 627

Chapter 28. DB2 Admin with a large number of objects . . . . . . . . . . . . . . 629


ISPF work data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Output data sets for GEN DDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630
Other recommendations for a large number of objects . . . . . . . . . . . . . . . . . . . . . 630

Part 6. Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . 633

Chapter 29. Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . 635


Gathering diagnostic information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
DB2 Admin messages and codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637
DB2 Admin Reverse Engineering condition codes . . . . . . . . . . . . . . . . . . . . . 637

x User's Guide and Reference


| DB2 Admin messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637

Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665

Contents xi
xii User's Guide and Reference
Tables
1. Significant DB2 Admin concepts and tasks xvi 15. Work data sets for DB2 Admin Redefine 285
2. Overview of steps for tailoring DB2 Admin 30 16. Work data sets for DB2 Admin Migrate 300
3. Libraries to allocate to your TSO LOGON 17. Work data sets for DB2 Admin Migrate with
PROC . . . . . . . . . . . . . . 42 DB2 UNLOAD . . . . . . . . . . . 300
4. Parameters that you can tailor from the 18. Work data sets for DB2 Admin Migrate with
General Customization Parameters panel. . . 44 HPU . . . . . . . . . . . . . . 301
5. Main panels that you can tailor. . . . . . . 61 19. ADBOPT parameters for ADBTEP2 and
6. Controlling the granularity of profiles. . . . 72 ADBTEPA . . . . . . . . . . . . 352
| 7. The keyword values of the request 20. Types of changes . . . . . . . . . . 451
| parameters for each object type . . . . . 179 21. Status of changes . . . . . . . . . . 451
| 8. Replacement values for symbolic variables for 22. The DB2 catalog table ignore fields . . . . 483
| templates for PUNCHDDN . . . . . . . 234 23. Generic ignore specifications . . . . . . 485
| 9. Sequence of applying multiple jobs from a 24. Translation mask names . . . . . . . . 508
| work statement list for renaming a database . 243 | 25. Mask application details . . . . . . . . 512
10. Work data sets for DB2 Admin Rename 26. DB2 Admin primary commands . . . . . 612
Database . . . . . . . . . . . . . 244 27. DB2 Admin special line commands . . . . 617
11. Work data sets for DB2 Admin Redefine 249 28. DB2 Admin utility line command codes 623
12. Work data sets for DB2 Admin Alter Restore 271 29. DB2 Admin data type conversions, part 1 627
13. Work data sets for DB2 Admin Alter ALC 273 | 30. DB2 Admin data type conversions, part 2 628
14. Matrix for data type and length changes that
do not require data conversion. . . . . . 276

© Copyright IBM Corp. 1995, 2010 xiii


xiv User's Guide and Reference
About this information
This information provides instructions for customizing and using IBM® DB2®
Administration Tool for z/OS®, a DB2 catalog administration tool.

This information contains five parts:


v Part 1 introduces DB2 Administration Tool.
v Part 2 describes how to activate the tool and get started using it.
v Part 3 describes how to use DB2 Administration Tool.
v Part 4 includes several advanced topics.
v Part 5 provides reference information, such as a listing of DB2 Admin
commands.

This information is for database administrators, system administrators, and


application developers.

Users of this information should understand basic DB2 concepts and facilities.

The technical changes for this edition are summarized in Summary of changes.
Specific changes since the previous edition of this book are indicated by a vertical
bar (|) to the left of a change. Editorial changes that have no technical significance
are not noted.

Always check the DB2 Tools Product publications page for the most current
version of this publication:

http://www.ibm.com/software/data/db2imstools/db2tools-library.html

Service updates and support information


To find service updates and support information, including software fix packs,
PTFs, Frequently Asked Question (FAQs), technical notes, troubleshooting
information, and downloads, refer to the following Web page:

www.ibm.com/software/data/db2imstools/support.html

Conventions and terminology used in this information


Throughout this information, IBM DB2 Administration Tool for z/OS is referred to
by its short name of DB2 Admin.

This information uses special fonts and labeling conventions for quickly identifying
various types of information:
v Commands are displayed in UPPERCASE.
v Definitions of terminology are displayed using italic font and are introduced
using the label Definition.
v Examples are displayed using monospaced font and are introduced using the
label Example.

© Copyright IBM Corp. 1995, 2010 xv


v Each chapter in this information begins with a summary list of the topics that
are covered in the chapter, with cross-reference links to those topics. The label In
this chapter is used to introduce these summaries.

How to use this information


The following table lists the significant concepts and commonly performed tasks
and refers you to the chapter or chapters that explain the concept or task.
Table 1. Significant DB2 Admin concepts and tasks
Concept or task Chapter
Understanding DB2 Admin v Chapter 1, DB2 Admin overview
v Chapter 5, DB2 Admin tutorial
These chapters introduce the product and provide a tutorial.
Using DB2 Admin v Chapter 1, DB2 Admin overview
v Chapter 4, Using DB2 Admin panels
v Chapter 5, DB2 Admin tutorial
Chapter 4 explains how to use the product.

You also might want to familiarize yourself with the panel


chapters (Chapter 6, Setting DB2 Admin parameters, through
Chapter 19, Managing space) while using the product to
understand the meaning of specific fields on a panel.
Activating and customizing Chapter 2, Activating DB2 Admin, helps you to tailor DB2
DB2 Admin Admin to your environment and assumes that you have a
basic understanding of DB2 Admin.
Using the Launchpad facility Chapter 3, Using the DB2 Admin Launchpad, describes how
to run IBM DB2 tools to launch installed tools that have an ISPF interface directly
from a centralized panel.
Developing new or Chapter 22, Writing and modifying DB2 Admin applications,
extending existing DB2 describes how to use DB2 Admin to create your own
Admin applications applications and tools and how to extend existing
applications. The development process assumes you have a
basic understanding of DB2 Admin.

How to look up message explanations


You can use any of the following methods to search for messages and codes:

Searching an information center


In the search box that is located in the top left toolbar of any Eclipse help system,
such as the IBM Information Management Software for z/OS Solutions Information
Center, enter the number of the message that you want to locate. For example, you
can enter DFS1065A in the search field.

Use the following tips to help you improve your message searches:
v You can search for information on codes by entering the code; for example, enter
-327.
v Enter the complete or partial message number. You can use wild cards (* or ?) in
the message number to broaden your search; for example, DFS20??I.

xvi User's Guide and Reference


The information center contains the latest message information for all of the
information management products that are included in the information center.

Using a Web search


You can use any of the popular search engines that are available on the Web to
search for message explanations. When you type the specific message number or
code into the search engine, you will be presented with links to the message
information in IBM information centers.

Using LookAt
LookAt is an online facility that you can use to look up explanations for most of
the IBM messages you encounter, as well as for some system abends and codes.
Using LookAt to find information is faster than a conventional search because in
most cases LookAt goes directly to the message explanation.

You can use LookAt from the following locations to find IBM message
explanations for z/OS elements and features, z/VM®, VSE/ESA, and Clusters for
AIX® and Linux®:
v The Internet. You can access IBM message explanations directly from the LookAt
Web site at http://www.ibm.com/eserver/zseries/zos/bkserv/lookat/.
v Your z/OS TSO/E host system. You can install code on your z/OS or z/OSe
systems to access IBM message explanations, using LookAt from a TSO/E
command line (for example, TSO/E prompt, ISPF, or z/OS UNIX® System
Services running OMVS).
v Your Microsoft® Windows® workstation. You can install code to access IBM
message explanations on the z/OS Collection (SK3T-4269) using LookAt from a
Microsoft Windows command prompt (also known as the DOS command line).
v Your wireless handheld device. You can use the LookAt Mobile Edition with a
handheld device that has wireless access and an Internet browser (for example,
Internet Explorer for Pocket PCs, Blazer, or Eudora for Palm OS, or Opera for
Linux handheld devices). Link to the LookAt Mobile Edition from the LookAt
Web site.

You can obtain code to install LookAt on your host system or Microsoft Windows
workstation from a disk on your z/OS Collection (SK3T-4269) or from the LookAt
Web site (click Download, and select the platform, release, collection, and location
that suit your needs). More information is available in the LOOKAT.ME files
available during the download process.

How to send your comments


Your feedback is important in helping to provide the most accurate and
high-quality information. If you have any comments about this information or any
other IBM DB2 and IMS Tools documentation:
v Use the online reader comment form located at:
www.ibm.com/software/data/rcf/
v Send your comments by e-mail to comments@us.ibm.com. Be sure to include the
name of the book, the part number of the book, the version of IBM DB2
Administration Tool for z/OS, and, if applicable, the specific location of the text
you are commenting on (for example, a page number or table number).

About this information xvii


xviii User's Guide and Reference
Part 1. Introducing DB2 Admin
DB2 Admin is a DB2 administration product that can greatly increase the
productivity of the entire DB2 staff (database administrators, system
administrators, and application developers).

© Copyright IBM Corp. 1995, 2010 1


2 User's Guide and Reference
Chapter 1. DB2 Admin overview
DB2 Admin is a DB2 administration product that can greatly increase the
productivity of the entire DB2 staff (database administrators, system
administrators, and application developers).

DB2 Admin uses dynamic SQL to access the DB2 catalog tables and to present the
information in an easy-to-use ISPF interface.

DB2 Admin is one of several IBM tools that can help you manage database
administration and the change management process.

Topics:
v “What does DB2 Admin do?” on page 4
v “Database administration and change management solutions” on page 6
v “DB2 Admin features and benefits” on page 7
v “DB2 Admin documentation and updates” on page 15
v “Accessibility features” on page 16
v “Summary of changes” on page 17

© Copyright IBM Corp. 1995, 2010 3


| What does DB2 Admin do?
| DB2 Admin helps you with the day-to-day tasks associated in managing DB2
| environments efficiently and effectively.

| DB2 Admin simplifies the complex tasks associated with safely managing DB2
| objects and schema throughout the application lifecycle with the least possible
| impact to availability. The key attributes of DB2 Admin are:
| v Allows you to navigate the DB2 catalog quickly and easily
| v Builds and executes dynamic SQL statements without requiring you to know the
| exact SQL syntax
| v Manages and tracks changes made to DB2 object definitions, resolving any
| potential conflicts prior to execution
| v Helps build DB2 commands to execute against databases and tables
| v Builds and executes utility jobs, allowing you to take advantage of LISTDEFs
| and TEMPLATEs for increased productivity
| v Enables you to create, alter, migrate, drop and reverse engineer DB2 objects
| For further details, see the following sections in this topic.

| You will appreciate the easy-to-use comprehensive features of DB2 Admin that
| increase your productivity and the reliability of your DB2 objects:

| Object management
| v Provides in-depth DB2 catalog navigation, which can minimize the time that is
| required to review the catalog. Objects in the catalog are displayed and
| interpreted, and relevant catalog information is presented logically. You can issue
| any DB2 command, including BIND, REBIND, and FREE, against selected plans
| and packages.
| DB2 Admin displays the DB2 catalog quickly and logically:
| – Displays any object in the catalog
| – Displays related DB2 objects through the use of special line commands
| – Interprets catalog information
| – Displays the authorization for objects
| – Displays the static SQL statements from application plans and packages
| – Displays the DDL for existing views
| – Runs on one of multiple copies of the DB2 system catalog
| v Integrated with DB2 utilities to simplify the creation of DB2 utility jobs. JCL can
| be generated for DB2 utilities and can be executed. The use of LISTDEFs and
| TEMPLATEs is also supported.
| v Performs tasks such as alter, create, drop and migrate of DB2 objects
| v Allows reverse engineering of DB2 objects
| v Supports DB2 predictive governing
| v Enables you to alter the definition of a DB2 table
| v Enables you to request the Prompt function, which prompts you before a
| statement is executed

| Security management
| v Displays authorizations that have been granted on any type of DB2 object, and
| enables you to REVOKE these authorizations or GRANT new ones
| v Provides REVOKE impact analysis to prevent inadvertent data loss when you
| revoke authorities

4 User's Guide and Reference


| v Displays the list of secondary authorization IDs and manages SQL IDs

| Performance management
| v Allows complex performance and space queries
| v Contains a built-in EXPLAIN function that allows you to EXPLAIN a query, and
| provides an interpretation of the PLAN_TABLE output into an
| easy-to-understand format
| v Comes with a set of performance health check catalog queries
| v Enables you to perform space-related functions such as resizing page sets, lets
| you move page sets to and from STOGROUP- and VCAT-defined space, and
| helps you estimate space allocations for new table spaces and indexes
| v Enables you to create and manage work statement lists (WSLs) and run them in
| batch
| v Enables you to dynamically manage system parameters

| Change management
| v Allows you to manage and track changes to DB2 objects
| v Allows groups of users to collaborate to build changes by managing information
| through a series of DB2 tables
| v Provides a convenient audit trail that can be used to determine the status of
| objects that are being changed and where those changes have been deployed
| v Allows you to recover changes that have been made and restore database objects
| to their previous state

| System management
| v Allows you to display and cancel threads; display and alter buffer pools; display,
| start, and stop DB2 traces; and set and display the logs
| v Performs various system administration functions, such as updating RLIMITs
| and managing DDF tables
| v Provides a convenient way to administer RLF and DDF tables
| v Manages stored procedure operations, such as creating, displaying or altering
| stored procedures, issuing the DB2 START and STOP STORED PROCEDURE
| command, and showing statistics for stored procedures that are accessed by DB2
| applications
| v Displays current dynamic DSNZPARMs change parameters, generates new
| DSNZPARM modules with changes, and activates those changes in DB2

| Application management
| v Builds and executes dynamic SQL statements without requiring you to know the
| exact SQL syntax
| v Runs most DB2 utilities
| v Enables you to extend existing DB2 Admin applications or to rapidly develop
| new applications
| v Allows you to work with a copy of the DB2 catalog to avoid contention and
| other performance problems on the actual catalog
| v Accesses a remote DB2 catalog where a DDF connection exists between systems.
| This feature enables you to centrally manage all of your DB2 subsystems with a
| single DB2 Admin session.
| v Allows you to execute any dynamic SQL statement through DB2 Admin, or to
| invoke SPUFI

Chapter 1. DB2 Admin overview 5


| Related concepts
| “DB2 Admin features and benefits” on page 7

| Database administration and change management solutions


| IBM solutions help IT organizations maximize their investment in DB2 and IMS
| databases while staying on top of some of today's toughest IT challenges. Database
| administration and change management are the core responsibilities of the DBA. If
| they are not managed correctly, database administration and change management
| can monopolize data center resources, waste valuable time, and result in the
| generation of unwanted errors.

| In managing critical database assets and the change management process, DBAs
| are faced with many challenges, such as:
| v Being able to quickly and easily navigate the DB2 catalog
| v Ensuring that all of the necessary steps are completed when making a change
| v Managing and tracking the changes to the definitions of database objects
| v Propagating changes to other database environments
| v Keeping DB2 software versions current
| v Managing a corrupt database

| Many DB2 Tools provide database management features that are not available in
| DB2 itself or that provide enhancements to capabilities that are built into DB2.

| For example, DB2 Admin allows you to navigate the DB2 catalog quickly and
| easily.

| DB2 Admin provides integration with other DB2 Tools to create additional
| functionality with product-specific line commands for editing tables, analyzing the
| cost of SQL statements, and analyzing potential access path changes. DB2 Admin
| offers a central, ISPF-based access point for other DB2 Tools, such as DB2 Table
| Editor, DB2 SQL Performance Analyzer, and DB2 High Performance Unload.

| DB2 Admin is only one of several DB2 Tools products that provide enhancements
| to the process of database administration and change management for your
| databases.

| Other DB2 tools products that can assist with database administration and change
| management include:
| v DB2 Object Comparison Tool
| v DB2 Storage Management Utility
| v Optim Test Data Management
| v DB2 Table Editor
| v DB2 SQL Performance Analyzer
| v DB2 High Performance Unload

6 User's Guide and Reference


DB2 Admin features and benefits
The features of DB2 Admin helps you efficiently and effectively manage DB2
environments.
Related concepts
“What does DB2 Admin do?” on page 4

DB2 Admin features


Display the DB2 catalog tables

DB2 Admin provides extensive support for displaying the DB2 catalog. The scope
of information that can be displayed is described in this information.
Display any object in the DB2 catalog
You can retrieve catalog data for any DB2 data object. You can specify the
data that is retrieved (for example, you might request that data be
retrieved for all databases that are owned by THOMAS and that have the
prefix D402).
DB2 Admin retrieves catalog data using predefined SELECT statements for
the more commonly used queries. The rows retrieved from the catalog are
displayed using the ISPF table-display service. The display panel can be
the DB2 Admin default panel, from which you can issue various DB2
Admin line commands, or a panel tailored by you for the result of a
particular SQL SELECT. In the latter case, you can use line commands to
issue new SQL calls using information from the columns of rows that have
been returned.
Display related DB2 objects using line commands
You can use DB2 Admin line commands to navigate the catalog. For
example, from a display panel that shows databases, you can use a line
command to show all table spaces in one of the databases. Then, from the
table spaces panel, you could issue a line command to show authorizations
for a table space or show the status of image copies for the table space.
Display catalog information
You can request detailed information about any object in the DB2 catalog.
A request for details about an application plan, for example, returns
information such as the plan's owner, latest bind time, and number of
bytes in the base section.
Show the authorization for DB2 objects
You can retrieve information about the authorizations for all DB2 objects.
From an authorization display panel, you can then grant and revoke
privileges.
Display the static SQL from application plans and packages
You can display the static SQL statements in a plan or a package, which is
useful if you do not have access to a program's source code.
Display the DDL for existing views
You can display the SQL source that created a view, which is useful if you
do not have access to the CREATE VIEW SQL (DDL) statement.
Run with multiple copies of the DB2 catalog
This function allows you to use the DB2 system catalog, one of the many
copies of it, or the catalog of a remote site. You might choose to use a
different copy of the catalog for each weekday, thus associating a backup
with each weekday. Or this feature can allow the system administrator to

Chapter 1. DB2 Admin overview 7


work on the actual system catalog, while developers use a copy of the
catalog, thereby decreasing contention for the catalog.

Execute dynamic SQL statements

You can issue any dynamic SQL statement from your screen or from a data set.
You can build and execute an SQL SELECT statement interactively by using line
commands.

In addition, by entering required parameters from a panel, you can execute the
following SQL statements: GRANT, REVOKE, CREATE, DROP, LABEL ON, and
COMMENT ON. This feature allows you to execute the statements without
knowing the exact SQL syntax; DB2 Admin provides guidance for the required
SQL parameters.

Manage changes to DB2 objects

| Use the Change Management function to manage and track the changes that you
| make to the definitions of your DB2 objects. You can use the Change Management
| function to complete all of the steps that are typically involved with changing
| database objects:
| 1. Defining your changes.
| 2. Resolving any conflicts by applying any pending changes for the objects as
| virtual changes.
| 3. Registering the changes.
| 4. Analyzing the changes to generate a work statement list that applies the
| changes.
| 5. Running the changes in the correct order.
| Change Management also makes it easy to back out completed changes. Making
| and managing changes with Change Management provides a convenient audit
| trail.

Issue DB2 commands against databases and table spaces

You can issue any DB2 command against any database or table space that you
have selected using DB2 Admin. For example, you can issue the DISPLAY, START,
and STOP commands against a database.

DB2 commands are passed to the instrumentation facility interface (IFI), and the
result is displayed in ISPF browse.

Run DB2 utilities

You can generate the JCL for DB2 utilities and then run them in batch, or you can
include the utility statements in a work statement list to be run at another time or
on another subsystem. This function applies to the utilities for storage groups,
table spaces, tables, and indexes. For example, you can, generate JCL to run the
COPY, REORG, and RUNSTATS utilities for a table space.

The generated JCL consists of a JOB statement, EXEC statement, and all required
DD statements. When the JCL is generated, DB2 Admin invokes ISPF edit, which
lets you change the JCL, submit it, or copy it to another data set.

You can generate utilities using LISTDEFs and TEMPLATEs.

8 User's Guide and Reference


Issue complex queries

You can run performance and space utilization queries against a database. The
data that is returned can help you to determine whether you need to:
v Run the RUNSTATS or STOSPACE utilities
v Reorganize or redesign parts of your database or indexes
v Change the locking rule for tables
v Drop an index
v Move tables to separate table spaces
v Extend the primary allocation for a table space or index
v Reduce the size of a table space

Use the EXPLAIN function


The DB2 Admin EXPLAIN function supports the EXPLAIN statement and provides
related support. (The EXPLAIN statement gathers information about the access
path DB2 chose to process a query.) By using the EXPLAIN function you can:
v Create a plan table (PLAN_TABLE) in the desired database and table space.
v Issue an SQL EXPLAIN statement and see the resulting rows in the plan table.
v List a plan table to look at rows from previously-executed EXPLAIN statements,
or rows from BIND and REBIND operations that were executed with
EXPLAIN(YES) specified.
With this function, predefined search criteria help you find rows in the plan
table. Predefined search criteria exist for application plans, DBRMs, collections,
and packages. You can see the access path chosen by DB2 to process queries,
and the tables and indexes that are accessed by DB2.
v Upgrade a plan table to the current version of DB2.
v Look at the DB2 calculated cost.
v Create and display the DB2 explain tables.
v Insert and work with DB2 optimizer hints in the plan table.

Manage SQL IDs

You can change the current DB2 SQL ID by entering a new one or by selecting one
from a list of secondary SQL IDs. DB2 Admin displays a list of SQL IDs that you
are allowed to use. The list is created either by simulating or invoking the
authorization exit in your system.

Perform system administration functions

The system administration functions that you can perform using DB2 Admin
include:
v Displaying threads
v Displaying and terminating utilities
v Displaying and managing traces
v Displaying and updating RLIMITs, including the predictive governing limits in
DB2
v Displaying and altering buffer pools
v Displaying and setting archive log parameters and archiving the log
v Displaying DB2 system parameters and updating dynamic parameters
v For DDF (distributed data facility):
– Starting and stopping DDF
– Displaying and updating the communications database (CDB)
– Displaying and canceling distributed threads

Chapter 1. DB2 Admin overview 9


– Displaying active locations
v Dynamically managing system parameters

Reverse engineer DB2 objects

Reverse engineering generates the SQL statements necessary to re-create a DB2


object. You can reverse engineer the DB2 objects in your database catalog.

Typical uses for the DB2 Admin reverse engineering function include:
v Extracting the DDL for an object before changes are made, so that the changes
are applied to the current definition and are available for fallback purposes.
v Moving DB2 objects to another DB2 subsystem. By using the reverse engineering
function (together with the table unload and load functions), objects can be
moved after a few manual modifications to the generated SQL and batch jobs.

The SQL statements can be generated online or with a batch job.

| Alternate forms of syntax

| Certain functions in DB2 Admin and DB2 Object Comparison Tool support or
| produce input and output statements that are used by DB2 or by these two
| products. IBM might provide an alternate statement or alternate form for clauses
| on statements, and might identify one as the preferred syntax, while still
| supporting the alternate form.

| DB2 Admin and DB2 Object Comparison Tool might use preferred or alternate
| forms of syntax. If the statement produced is accepted by the products or by DB2,
| the statement is considered valid. Where it is necessary to produce an accepted
| statement, the products convert to newer syntax. However, the products might
| retain older syntax even if DB2 considers the newer syntax the preferred syntax.
| This might be the case even if no possible use of the older syntax is needed. The
| use of older syntax might persist until IBM deems it is no longer is supported in
| any product form.

Use the DB2 predictive governing

You can use DB2 Admin to display, insert, update, or delete predictive governing
rows in the resource limit tables. Furthermore, if DB2 Admin receives a predictive
governing warning (SQLCODE +495) when running a dynamic SQL statement,
DB2 Admin asks you whether the SQL statement should be executed or cancelled.
If the predictive governing estimates that executing a dynamic SQL statement that
was issued from DB2 Admin will exceed the error limit (SQLCODE -495), DB2
Admin displays an error message, and the SQL statement is not executed.

You can use predictive governing limits to prevent users from running wild queries
on catalog tables or any other tables being displayed using DB2 Admin. By using
predictive governing limits for the DB2 Admin package, this type of query can be
inhibited either by setting up a predictive governing warning or an error limit in
the resource limit table.

Related Reading: For more information on predictive governing, refer to the DB2
UDB for z/OS Administration Guide.

10 User's Guide and Reference


Alter the DB2 table definition

You can alter the definition of a DB2 table. Permissible changes include:
v Changing the database, table space, owner, and the name of the table
v Modifying the definitions of table columns
v Changing the sequence of the columns in the table
v Inserting and dropping columns

| Choose DB2 Version 9 modes

| You can operate DB2 Admin in DB2 Version 8 and in DB2 Version 9 in any of the
| following DB2 Version 9 modes:
| New-function mode
| In this mode, new DB2 Version 9 functions are supported, including
| enhanced XML support.
| Enabling-new-function mode
| In this mode, DB2 Admin runs as if DB2 Version 8 is used.
| Compatibility mode
| In this mode, DB2 Admin runs as if DB2 Version 8 is used.

Migrate DB2 data to other DB2 systems

You can copy DB2 data to another DB2 system. This is a useful function if you
want to create a separate DB2 test system or if you want to move a test system
into production. You can also use this function to consolidate two separate
database systems into one.

Extend existing DB2 Admin applications or develop new


applications

You can extend DB2 Admin to invoke other ISPF applications that you use for DB2
administration and application development. Some applications that you might
want to invoke from DB2 Admin include:
v Security tools
v Vendor DB2 utilities
v Storage management tools

DB2 Admin also enables you to quickly build new ISPF applications for displaying
and maintaining DB2 data. Some of the types of data for which you might build
such applications include:
v Application definition data
v DB2 performance data
v Extra security data

A sample application is included with the product to illustrate how you might use
DB2 Admin to create new applications.

Perform space management functions

DB2 Admin enables you to perform space-related functions such as resizing page
sets, moving page sets to and from STOGROUP- and VCAT-defined space, and
estimating space allocations for new table spaces and indexes.

Chapter 1. DB2 Admin overview 11


Create and run work statement lists

DB2 Admin enables you to create and run work statement lists that include sets of
operations. You can execute the entire set, rerun sets, or capture a set of operations
that you create on one system for use on another system.

Launch installed IBM DB2 Tools that have an ISPF interface

You can invoke installed IBM DB2 tools that have an ISPF interface—directly from
DB2 Admin. The DB2 Admin Launchpad provides a convenient way of creating a
centralized ISPF table with the names of your tools. By subsequently selecting an
entry in this table, you can easily start up one of the tools.

Performance

DB2 Admin is equipped with the following performance features:


v DB2 Admin uses dynamic SQL to access the DB2 catalog, which ensures that
DB2 always uses the most efficient access path to the catalog (provided
RUNSTATS statistics are available for the DB2 optimizer).
v Before DB2 Admin displays information, it does an SQL commit. By doing so,
DB2 Admin ensures that a user cannot lock the catalog for long periods of time.
If an SQL error occurs, DB2 Admin rolls back the unit of work before it displays
any information.
v DB2 Admin has a default limit of 1000 for fetching rows. This limit helps to
prevent time-consuming queries. You can change the default of 1000 for an
execution of DB2 Admin if more rows are needed. You can set this value
permanently or you can set a parameter in the Change DB2 Admin Defaults
panel to reset the default value at the next startup.
v You can use DB2 resource limit facilities (RLF) to limit the amount of CPU time
that a dynamic SQL statement in DB2 Admin can use - either by using the
reactive governor facilities of RLF or by using the predictive governing facilities.
v DB2 Admin can run on a copy of the DB2 catalog. Besides improving
performance, running on a copy of the catalog can reduce contention for the
catalog. DB2 Admin provides commands to generate jobs to create and populate
copies of the DB2 catalog.

Security

DB2 Admin does not expose the security of the DB2 system. All DB2 access is
controlled by the existing security provisions of the DB2 system. You can
optionally configure DB2 Admin to allow users to execute DDL generated to
re-create views dropped as a result of dropping other objects. The user can execute
this DDL even if they do not have the direct authority. This is done by using
auth-switching and has its own safeguards to ensure the DDL is not changed from
that generated by DB2 Admin. A user must have access to a RACF® (or equivalent)
profile to use auth-switching.

DB2 Admin benefits


This section describes a few of the many ways in which DB2 Admin is typically
used, and gives examples of specific applications.

12 User's Guide and Reference


Explore databases

DB2 Admin lets you quickly navigate the DB2 catalog and display tables, table
columns, and indexes. If you are authorized by DB2, you can also display the
content of tables either by doing a simple list of the table or by building SQL
statements and executing them against a table.

You can use the DB2 Admin functions to explore unknown databases rapidly or
get a quick overview of a database. None of these uses require that you remember
the exact syntax of DB2 commands or SQL statements.

Determine and correct problems

You can use DB2 Admin to identify and fix problems with your databases. With its
ability to navigate the catalog and use DB2 commands on objects, DB2 Admin can
help you discover, analyze, and fix database problems in a more user-friendly
fashion than is available with native DB2.

Develop small applications

You can use DB2 Admin to rapidly develop small applications. As you become
familiar with the tool, you might find the time that it takes to develop small DB2
Admin dialogs is greatly reduced.

Examples:
v If you have a tool at your installation that manipulates DB2 tables,
you can develop your own line command to access it from the DB2
Admin panel that displays tables (implementing the line command as
an SMP usermod). Then you can invoke the table tool as a natural
follow-on to using DB2 Admin.
v Perhaps you'd like to generate more DECLARE statements for a PL/I
table than is possible with the DB2 DCLGEN tool. You can write an
application to invoke DCLGEN directly from the DB2 Admin panel
that displays tables. You can also modify the output you receive from
DCLGEN to, for example, meet your installation's standards and
requirements.
v You might want to build prototypes of SQL SELECT statements. You
can build the statements, test them and, when you are satisfied with
them, copy the statements to a data set to include in your application
program.
v DB2 Admin can help you maintain any DB2 tables that you use for
installation standards and special requirements. You can use DB2
Admin to develop a small application that describes all of the
applications that you have in the system. Or you can use it to display
existing tables that, for example, contain information about DB2 plan
performance or batch job execution statistics.

Copy tables from one DB2 system to another

You can use the table utilities that DB2 Admin generates to copy tables from one
DB2 system to another. You will need to make a few modifications to the
generated JCL.

Chapter 1. DB2 Admin overview 13


Start DB2 Tools

You can invoke installed IBM DB2 tools that have an ISPF interface directly from
DB2 Admin. DB2 Admin guides you through the process of creating a central table
with the names of your DB2 utilities. After this table is created, you can simply
select an entry in it to start up one of the DB2 tools.

14 User's Guide and Reference


DB2 Admin documentation and updates
This topic explains where to find DB2 and IMS™ Tools information on the Web,
and explains how to receive information updates automatically.

DB2 Admin information on the Web

The DB2 and IMS Tools Product publications Web page provides current product
documentation that you can view, print, and download. To locate publications with
the most up-to-date information, refer to the following Web page:

http://www.ibm.com/software/data/db2imstools/db2tools-library.html

You can also access documentation for many DB2 for z/OS and IMS Tools from
the Information Management Software for z/OS Solutions Information Center:

http://publib.boulder.ibm.com/infocenter/imzic

Documentation for many DB2 Tools that run on Linux, UNIX, and Windows
systems can be found in the IBM DB2 Tools for Linux, UNIX, and Windows
Information Center:

http://publib.boulder.ibm.com/infocenter/mptoolic/v1r0/index.jsp

IBM Redbooks® publications that cover DB2 and IMS Tools are available from the
following Web page:

http://www.ibm.com/software/data/db2imstools/support.html

The Data Management Tools Solutions Web site shows how IBM solutions can help
IT organizations maximize their investment in DB2 and IMS databases while
staying ahead of today's top data management challenges:

http://www.ibm.com/software/data/db2imstools/solutions/index.html

Receiving documentation updates automatically

To automatically receive a weekly email that notifies you when new technote
documents are released, when existing product documentation is updated, and
when new product documentation is available, you can register with the IBM My
Support service. You can customize the service so that you receive information
about only those IBM products that you specify.

To register with the My Support service:


1. Go to http://www.ibm.com/support/mysupport
2. Enter your IBM ID and password, or create one by clicking register now.
3. When the My Support page is displayed, click add products to select those
products that you want to receive information updates about. The DB2 and
IMS Tools category is located under Software → Data and Information
Management → Database Tools & Utilities.
4. Click Subscribe to email to specify the types of updates that you would like to
receive.
5. Click Update to save your profile.

Chapter 1. DB2 Admin overview 15


Accessibility features
Accessibility features help a user who has a physical disability, such as restricted
mobility or limited vision, to use a software product successfully.

The major accessibility features inDB2 Admin enable users to:


v Use assistive technologies such as screen readers and screen magnifier software.
Consult the assistive technology documentation for specific information when
using it to access z/OS interfaces.
v Customize display attributes such as color, contrast, and font size.
v Operate specific or equivalent features by using only the keyboard. Refer to the
following publications for information about accessing ISPF interfaces:
– z/OS ISPF User's Guide, Volume 1
– z/OS TSO/E Primer
– z/OS TSO/E User's Guide

These guides describe how to use ISPF, including the use of keyboard shortcuts or
function keys (PF keys), include the default settings for the PF keys, and explain
how to modify their functions.

16 User's Guide and Reference


Summary of changes
This topic summarizes the technical changes for this edition.

New and changed information is indicated by a vertical bar (|) to the left of a
change. Editorial changes that have no technical significance are not noted.

Version 7.2, May 2010, SC18-9552-14

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v A new Prompt to run SQL option is available on panel ADB2GEN. See
“Generating SQL to re-create a DB2 object” on page 172.
v REXX user exits are enabled for COMPRESS and SEGSIZE overwrites. See
“Mask definition syntax” on page 505 and “Specifying a REXX user exit for the
overwrite value” on page 511.
v An option has been added to the Manage Versions panel (ADB2C4) to import a
version file. When this option is selected, you can use the Import Version File
panel (ADB2C44) to import a version file. See “Importing a version file” on page
497.
v New GRANT options for authorizations and roles are available on panel
ADB2GEN. See “Generating SQL to re-create a DB2 object” on page 172.
v A new restriction has been added to using HPU. See “Invoking HPU within a
work statement list” on page 332
v A new topic has been added to Chapter 8. Building and running SQL
statements. See “Revoking system authority from an SQLID” on page 168
v Task help has been added on how to find the value for the Unicode translation
technique field on the General Customization Parameters panel (ADB2CUS1).
See “General Customization Parameters panel” on page 47, Unicode Translation
Technique (no tag).
v DB2 Admin and DB2 Object Comparison Tool might use preferred or alternate
forms of syntax. See “DB2 Admin features” on page 7.
v An example was added to the description of the DB2 load library (:bl2llib.) used
in migration customization. See “Step 8(b). Supplying information about the
customization panels” on page 47
v The DB2 Admin ALC, RENDB, RDEF, and MIG functions and DB2 Object
Comparison Tool support changes to implicit LOB and XML table spaces. See
“Implicit LOB and XML table support” on page 289.

Version 7.2, February 2010, SC18-9552-13

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v Support has been added for cloned table. ADD CLONE and DROP CLONE
options are available on panel ADB21TA. See “Altering a table with the AL line
command” on page 254. The template type CLONE has been added to panel
ADB25TU3, see “TEMPLATE usage” on page 234.
v A new job parameter, Per Process, has been added to panel ADB2W1R. See
“Renaming a database” on page 241
v A new primary command, SCHEMA, can be used to change the CURRENT
SCHEMA. See Table 26 on page 612.

Chapter 1. DB2 Admin overview 17


v Two DB2 Admin restrictions were added to DB2 object names. See “DB2 Admin
restrictions on DB2 object names” on page 139.
v There is a new ADBTEP2 parameter, RESTART FORCE. See “Parameters passed
to ADBTEP2” on page 340.
v The primary commands PLANMGMT and QUALIFIER have been added to
panel ADB21K. See “Option K. Packages” on page 567 and Table 26 on page 612
.

Version 7.2, December 2009, SC18-9552-12

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v A new ADBTEP2 summary report of all activity at the end of or during large or
complex work statement list (WLS) run is provided. See “The ADBTEP2
summary report” on page 347.
v A new SSID primary command can be used to switch to another DB2 SSID. See
Table 26 on page 612. Also see “Step 6. Prepare ADBL CLIST” on page 36 (for
the new parameter QTAB),Table 4 on page 44, and “General Customization
Parameters panel” on page 47.
v New utility options have been added. See Figure 224 on page 356, Figure 228 on
page 364, and Figure 230 on page 366.
v There is a new option, DEFER YES, on the ADB2C11A panel. See Figure 337 on
page 464
v The procedure to create additional DB2 catalog indexes is modified. See“Step 18.
Create additional DB2 catalog indexes” on page 69.
v The requirement to put SADBLINK modules into a library that is in the site link
list has been removed. See “Step 11. Tailor the DB2 Admin Launchpad” on page
66 and “Step 12. Update the APF Authorization table” on page 67.
v The procedure to prepare to run utilities online has been changed to prepare to
run a work statement online. See “Step 13. Prepare to run a work statement
online” on page 68.
v An ASUSER parameter has been added to the ADBL CLIST and the ADB CLIST
to allow establishing a trusted context. See “Step 6. Prepare ADBL CLIST” on
page 36 and “Changing DB2 Admin defaults” on page 123
v Performance panels have been improved. The database name filter has been
moved to the top of the ADB23 panel. See Chapter 10, “Running DB2 Admin
performance queries,” on page 187. Also, the Select line command is now
available on panels ADB2314 and ADB2314X. See “Option 14. Table Space
Maintenance Recommendations panel” on page 209 and “Option 14X. Index
Space Maintenance Recommendations panel” on page 211.
v Issuing the REN line command on panel ADB21X displays a new panel where a
new index name can be specified. See “Renaming an index” on page 281.
v There is a new field, Sub Type, on panel ADB2M1S. to display additional
information about the page sets types. See “Displaying page set statistics” on
page 437.
v Enhancements have been added for Trusted Context and Roles.
– The GEN and DDL commands have been added to the Trusted Contexts
panel. See “The trusted contexts panel” on page 548.
– The object types of Trusted Context and Role have been added to table 7 in
“Generating SQL using wildcard characters” on page 179.

18 User's Guide and Reference


– There are new mask types of TCNAME, ROLE, DBROLE, TSROLE, TBROLE,
and IXROLE. See “Mask definition syntax” on page 505. Also see “DB2
catalog records that have default masks” on page 512.
.

Version 7.2, November 2009, SC18-9552-11

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v A new scenario for creating native SQL procedures was added. See “Creating
native SQL procedures” on page 417.
v Fields were added to the generic ignore field PARTITIONING. See “Generic
ignore fields” on page 485.
v A new trace filter is now available. See “Displaying or managing traces” on page
384.
v Support for new plan management features that are retrofitted into DB2 Version
9. See “Option K. Packages” on page 567 and “Option P. Plans” on page 582.
v New panels ADB2Z2RM and ADB2Z2RI have been added to display, insert, and
update column values of the DSNRMTxx table. See “Displaying or updating the
owner of Resource Limit (RLIMIT) Tables” on page 386.
v Panels ADB26CS, ADB21SAR (Create Table Space), ADB21SA, ADB21SAR
(Redefine Table Space), ADB26CX, ADB21XAR, and ADB21XA have been revised
to support new options for CREATE TABLESPACE, ALTER TABLESPACE,
CREATE INDEX, and ALTER INDEX. See “Creating a table space” on page
155,“Altering a table space” on page 245,“Redefining a table space” on page
247,“Creating a plan table” on page 375, and “Redefining an index” on page 282.
v Panels ADB223 and ADB223T revised to support new data types.
v New data type conversions are supported. See Table 30 on page 628.
v Two restrictions were added to columns in the Alter Table panel. See
“Redefining a table with the ALC line command” on page 257.

Version 7.2, September 2009, SC18-9552-10

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v Enhancement to Catalog Copy functionality to support DB2 V9 catalog tables.
See “Adding entries to the catalog copy version table” on page 534
v New panels to create or alter trusted contexts and roles are accessible from panel
ADB26 and by means of a new CRE line command. See “The trusted contexts
panel” on page 548.
v New options are available on panel ADB26 to create, drop, or comment on
trusted contexts and roles. See “Issuing CREATE, DROP, LABEL ON, and
COMMENT ON statements” on page 152.
v New options are available on panels for CREATE TABLE and ALTER TABLE.
See “Creating a table” on page 156 and “Altering a table with the AL line
command” on page 254
v New options are available on panel ADB25 for UL - Upgrade LISTDEF control
table, and UT - Upgrade TEMPLATE control table. See “Upgrading the LISTDEF
control tables” on page 218 and “Upgrading the TEMPLATE control tables” on
page 227.

Chapter 1. DB2 Admin overview 19


Version 7.2, July 2009, SC18-9552-09

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v CREATE and ALTER admin stored procedure functions were enhanced. A third
type of stored procedure, native SQL procedure, has been added, which is
processed in the same dialogues as the other types of stored procedures,
External and SQL. See “Creating stored procedures” on page 416.
v Since native SQL procedures will be a commonly used storage procedure type,
panel ADB21O has been modified so that it displays relevant information for
native SQL procedures, such as version and origin. See “Displaying or altering
stored procedures” on page 414.
v The following native SQL procedure line commands have been added to panel
ADB21O:
– ADDV – to support ALTER PROCEDURE ADD VERSION
– REPV – to support ALTER PROCEDURE REPLACE VERSION
– BIND – to support the BIND DEPLOY command
v A VERSION attribute is provided for an native SQL procedure. The VERSION
attribute indicates which native SQL procedure version or versions to extract.
See “Generating SQL using wildcard characters” on page 179

Version 7.2, June 2009, SC18-9552-08

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v Chapter 1, Chapter 1, “DB2 Admin overview,” on page 3 has been updated, and
a new section, “Database administration and change management solutions” on
page 6 added.
v XML support has been enhanced. A utility template is available to unload data
from an XML column. For more information, see “Using the utility template to
unload data from an XML column” on page 237 and “Running WSL with the
utility template for unloading XML data” on page 330.
v New data types were added to Create and Alter Table administration functions.
See “Altering a table with the AL line command” on page 254.
v There are new Schema mask types of TBSCHEMA and IXSCHEMA, and the
behavior of existing masks OWNER, TBOWNER, and IXOWNER has changed.
See “Mask definition syntax” on page 505.
v Register can insert SET CURRENT SCHEMA statements if they are not provided
by the user. See “Registering a change” on page 457.

Version 7.2, March 2009, SC18-9552-07

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v You can create a change by importing SQL statements from a data set. When
you import the statements, a new change is created and registered. You can now
import multiple delta changes as a group in one change. See “Importing
changes” on page 473.

20 User's Guide and Reference


v DB2 Administration Tool implementation of DB2 Version 9 catalog navigation
provides:
– Authorization enhancements, including Trusted Contexts and Roles. RE and
RR line commands are available on all the authorization panels. See
Chapter 25, “System catalog panels,” on page 545.
– An update of the system catalog panels to incorporate DB2 Version 9 catalog
changes. See See Chapter 25, “System catalog panels,” on page 545.
– Clone table support. See “Viewing clone tables” on page 599.

Version 7.2, December 2008, SC18-9552-06

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar | to the left of the
change. The major additions and changes include:
v Large object (LOB) support has been enhanced. A utility template is available to
unload data from a LOB column. If you use the utility template for LOBs, the
functions ALC, RDEF, RENAME DB, MIG, and Unload Utility will add an
ADMIN LOBTEMPLATE statement to the work statement list (WSL) to indicate
the existence of a LOB column or columns in the table or tablespace that is
involved in the next UNLOAD statement. If the UNLOAD statement is preceded
with an ADMIN LOBTEMPLATE statement, the UNLOAD statement is modified
by ADBTEP2 to enable the unloading of LOB columns before it is passed to DB2
or High Performance Unload (HPU). Unload LOB support for MIG is allowed
for both WSL and non-WSL; for other functions unload LOB support is only for
WSL. Previous restrictions on LOBs have been removed for ALC, MIG, and
Unload Utility. For more information, see “Using the utility template to unload
data from LOBs” on page 236, “Running WSL with the utility template for
LOBs” on page 329, and “Using ADBTEP2 with LOBs” on page 348.
v XML support has been enhanced. Panels ADB21T* support the implicit tables
that are created for XML columns (TYPE=X) and all other new or modified
catalog columns for SYSTABLES. A new XML line command on panel ADB21T
displays the XML table – similar to what the AUX command does for a table
with LOBs. A new line command XMLR on panel ADB21T is analogous to the
AUXR command for LOBs. It shows information on the XML column(s) of an
XML table on panel ADB21TXR and is issued against either the base table or the
XML table. For more information, see “Using utility options for XML and LOBs”
on page 362, “Option T. Tables, Views, and Aliases” on page 594, and “Option X.
Indexes” on page 600.
v Catalog navigation has been enhanced. See “Option X. Indexes” on page 600.
v When you run a work statement list (WSL), a Load Summary Report is
automatically generated when the WSL contains LOAD utilities. The report
helps you ensure that no data was unexpectedly lost by indicated whether any
records were discard. For more information, see “Running a WSL” on page 320
and “Load summary report” on page 321.
v When a work statement list (WSL) is run and does not complete successfully, a
user who is different from the user who originally ran the WSL can now restart
the WSL. This enhancement also applies to running changes through the Change
Management function. Any user can use the ER line command to edit and
resubmit a change in RUNNING status. The change does not have to be edited
and resubmitted by the user who originally ran a change that did not complete
successfully. For more information, see “Restarting a WSL that was run by
another user” on page 322 and “Running a change” on page 465.
v Masking was enhanced to support overwriting the values for the DEFER,
DEFINE, DSSIZE, PRIQTY, and SECQTY attributes for table spaces and indexes.

Chapter 1. DB2 Admin overview 21


In addition, you can define and use REXX user exits to calculate and return the
overwrite value to use. For more information, see “Mask definitions” on page
505.

Version 7.2, July 2008, SC18-9552-05

Information has been added or revised for new enhancements and maintenance.
New and changed information is marked by a vertical bar (|) to the left of the
change. The major additions and changes include:
v A new field, Generate GRANT statements, has been added to the Migrate
Parameters panel (ADB28M) to allow you to control whether GRANT statements
are generated in the DDL when you migrate objects. Previously, the GRANT
statements were always generated. For more information, see “Step 2. Generate
batch jobs” on page 295.
v A new field, BindError, has been added to the Batch Job Utilities Parameter
panel (ADB2UPA) to let you specify how the Batch Restart program (ADBTEP2)
will handle BIND errors. The value of the field is passed to the ADBTEP2
program by using the new BINDERROR parameter. For more information, see
“Parameters passed to ADBTEP2” on page 340.
v The ability to use authorization switching for DCL statements has been added.
When the job submitter has ALTER authority to the RACF profile that protects
the resource, all DDL and DCL statements can be executed by using the
specified authorization switching ID. For more information, see “Step 22. Tailor
DB2 Admin Authorization Switching” on page 71 and “Using authorization
switching” on page 287.
v The ER command has been enhanced to improve restarting a change that did
not run successfully and is in RUNNING state. When the ER command places
the JCL to run the job in edit mode, a RESTART parameter is now automatically
added to the job card so that the job will restart at the appropriate step when
you resubmit it. For more information, see “Running a change” on page 465.
v For ignores, ignore fields can now be specified for DB2 catalog tables
SYSSTOGROUP and SYSVOLUMES. Also, the generic ignore field specification
for STORAGE now includes SYSVOLUMES.VOLID. For more information, see
“Overview of ignores” on page 482 and “Creating an ignore” on page 487.
v A new DB2 Admin parameter, Verify CCSID, has been added to control whether
DB2 Admin checks the coded character set identifier (CCSID) of the TSO
terminal on which you start a DB2 Admin session to determine if it matches the
CCSID of the plan under which DB2 Admin is running. The default behavior is
to check the CCSIDs. You can use the new field, Verify CCSID, on the Change
DB2 Admin Defaults panel (ADB2P2) to change the setting of the parameter so
that the CCSIDs are not verified. For more information, see “Changing DB2
Admin defaults” on page 123.

Version 7.2, January 2008, SC18-9552-04

Information was added or revised for new enhancements and maintenance. These
additions are marked using the revision symbol | (a vertical bar). The major
changes include:
v To make it easier to rename a table, the REN line command was added to the
Tables, Views, and Aliases panel (ADB21T), and the Rename Table panel
(ADB21TR) has been added to carry out the dialog to rename a table. In
addition, DB2 Admin has been enhanced to use the SQL RENAME TABLE
statement whenever possible to rename a table instead of dropping and

22 User's Guide and Reference


re-creating the table. For more information, see “Redefining a table with the ALC
line command” on page 257 and “Using DB2 Admin Smart Alter” on page 269.
v Several enhancements were made to panels that are accessible from the Alter
Table panel (ADB21TA) to add column lookup, constraint name lookup, and
references table lookup:
– Adding a column. Lookup support was added to the Column name field on
the Alter Table panel (ADB21TAB) to allow you to see the names of the
existing columns in the table. The Table owner field can have a null value
unless you are doing a column lookup.
– Adding a primary key or unique constraint. The COLUMNS primary
command was added to the Add Primary Key (or Unique) Constraint panel
(ADB21TAN), which invokes a panel that displays a list of the columns in the
table and allows you to easily select the columns for the constraint and their
sequence. In addition, lookup support was added for the Constraint name
field to allow you to see the names of any existing constraints.
– Adding a foreign key constraint. The COLUMNS primary command was
added to the Alter Table panel (ADB21TAF), which invokes a new panel that
displays a list of the columns in the table and allows you to easily select the
columns for the constraint and their sequence. In addition, lookup support
was added for the Constraint name field and for the references table name.
– Dropping unique and check constraints. Panel ADB21TAL was changed to
support dropping either a unique constraint or a check constraint. Lookup
support was also added for the Constraint name field to allow you to choose
from a list of the existing constraints. The lookup is specific to the type of
constraint.
– Dropping foreign key constraints. Lookup support was added for the
Constraint name field on panel ADB21TAH to allow you to choose from a list
of the existing constraints.
For more information, see “Altering a table with the AL line command” on page
254.
v The following support was added for processing work statement lists (WSLs)
online instead of in batch:
– When you use the Alter Table (ALC) function and specify that the statements
to make the changes are to be put in a WSL, you can specify that the WSL be
generated online. The new field, Generate WSL online, on panel ADB27A
determines whether the WSL is generated online or in a batch job.
– You can run a WSL online. For more information about the new O (Run
online) line command, see Chapter 14, “Using work statement lists,” on page
305.
v Support was added for customizing utility options and using the customized
options for the Alter Table (ALC), Redefine Table spaces (RDEF), and Migrate
(MIG) functions. Specifically, the following two fields were added to the
respective panels for these functions (ADB27A, ADB21SAJ, and ADB28M):
– Use customized utility options
– UO - Customize utility options
v A new field, Generate MIG jobs in batch, was added to the Migrate Parameters
panel (ADB28M) to allow you to specify that the jobs to migrate objects, data, or
statistics should be generated in a batch job instead of online. For more
information, see Chapter 13, “Migrating DB2 objects, data, and catalog statistics,”
on page 291.
v You can generate reports about objects in the DB2 catalog that can be saved and
printed. For more information, see “Creating reports from the DB2 catalog” on
page 134.

Chapter 1. DB2 Admin overview 23


v Masking was enhanced to support overwriting the COMPRESS and SEGSIZE
attributes for table spaces. Masking fields DBOWNER, TSOWNER, and
TBOWNER, and IXOWNER were also added to provide the ability to specify
different owners for databases, table spaces, tables, and indexes. For more
information, see “Mask definitions” on page 505.

Version 7.2, January 2007, SC18-9552-03

Information was added to the book for Version 7 Release 2 enhancements and for
maintenance. These additions are marked using the revision symbol | (a vertical
bar). The major enhancement for this release is support for Change Management.
Chapter 20, “Managing changes to DB2 objects,” on page 445 has been added to
describe how to use this new feature. Other changes include:
v Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171
has been updated to describe how to use wildcard characters to generically
specify which objects should be extracted when you run GEN in batch mode.
v Chapter 16, “Running DB2 utilities,” on page 355 has been updated to show that
the CHECK LOB utility for SHRLEVEL REFERENCE and SHRLEVEL CHANGE
has been added to the Tables Space Utilities panel (ADB2US) and is available if
you are using DB2 z/OS Version 8 or higher.
v Chapter 13, “Migrating DB2 objects, data, and catalog statistics,” on page 291 has
been updated with the changes to the Migrate Table Spaces panel (ADB28S). If
the migrate parameter is set to NO, the space information will not be shown
automatically, and you can use the SPACE line command to display the
information if needed. “Changing migrate settings” on page 129 describes how
to set the migrate parameter.
v The Create Table panel (ADB26CTF), the ALC Alter Table panel (ADB27C), and
the AL Alter Table panel (ADB21TAB) panel have been modified to provide
support for defining columns with the default Unicode string in tables that have
a Unicode encoding scheme.
v Over twenty panels that have been changed to use a scrollable title field when
the title is longer than the display space.

24 User's Guide and Reference


Part 2. Getting started with DB2 Admin
The topics in this part provide information for installing and tailoring DB2 Admin
to your environment.

© Copyright IBM Corp. 1995, 2010 25


26 User's Guide and Reference
Chapter 2. Activating DB2 Admin
After DB2 Admin has been installed, complete the following steps to activate DB2
Admin.

The following topics assume that you have completed the installation instructions
found in the Program Directory for IBM DB2 Administration Tool for z/OS (GI10-8684).

For every DB2 subsystem on which you want to use DB2 Admin, several tailoring
steps must be completed. Before beginning this tailoring process, gather the names
of all DB2 subsystems on which you want to run DB2 Admin.

| It is recommended that you never modify the SMPE target libraries or run jobs
| from the target libraries. Normally you create run-time libraries based on these
| target libraries. There is also a mechanism in ADBL CLIST to allow you to
| integrate their modifications into a set of separate user libraries that are
| concatenated to the run-time libraries. This way you never lose your modifications.

| Examine these members in your user libraries against the new run-time libraries
| and see if you need to redo your modifications. You can do this manually by
| looking for differences, or by installing a USERMOD so that SMPE tracks your
| changes and notifies you. Using USERMOD is best, then you can examine the new
| member and integrate the new lines of code into your customized version.

Topics:
v “Prerequisites” on page 29
v “Tailoring summary” on page 29
v “Step 1. Create the checkpoint table” on page 31
v “Step 2. Create a segmented table space in a TEMP database” on page
32
| v “Step 3. Set up to use Change Management” on page 33
v “Step 4. Binding application packages and plans” on page 34
v “Step 5. Copy fixed-block libraries to variable-block libraries” on page
36
v “Step 6. Prepare ADBL CLIST” on page 36
v “Step 7. Verify activation of limited functionality” on page 42
v “Step 8. Customize the ISPF environment” on page 44
v “Step 9. Tailor the Main Menu and DB2 Selection Menu” on page 60
v “Step 10. Customize the ADB2UCUS” on page 64
v “Step 11. Tailor the DB2 Admin Launchpad” on page 66
v “Step 12. Update the APF Authorization table” on page 67
| v “Step 13. Prepare to run a work statement online” on page 68
v “Step 14. Create a catalog copy version table” on page 68
v “Step 15. Create views for your own objects in the catalog” on page 69
v “Step 16. Grant SELECT access on catalog tables” on page 69
v “Step 17. Define Reverse Engineering stored procedure for CC/390” on
page 69
v “Step 18. Create additional DB2 catalog indexes” on page 69
v “Step 19. Optimize DSNWZP and DSNZPARM settings” on page 70
v “Step 20. Run the RUNSTATS utility” on page 70
v “Step 21. Define your own line commands” on page 70
v “Step 22. Tailor DB2 Admin Authorization Switching” on page 71
v “Step 23. Verify installation of additional functionality” on page 73

© Copyright IBM Corp. 1995, 2010 27


v “Step 24. Make DB2 Admin available to users” on page 74
v “Step 25. Upgrade to a new release of DB2” on page 75
v “Step 26. Upgrade utility templates” on page 75

28 User's Guide and Reference


Prerequisites
DB2 Admin has both hardware and software requirements.

Hardware requirements

DB2 Admin requires the same hardware configuration that is required for DB2
Universal Database™ for OS/390® and z/OS Version 7 Release 1 (5675-DB2) or
later.

Software requirements

DB2 Admin requires the following software (or later versions and releases):
v The following operating systems:
| – z/OS Version 1 Release 6 (5694-A01)
– IBM SMP/E for z/OS and OS/390 Version 3 Release 2 (5655-G44) (for
installation only)
v One of the following versions of DB2:
– DB2 for z/OS and OS/390 Version 7 Release 1 (5675-DB2)
– DB2 for z/OS Version 8 Release 1 (5625-DB2)
| – DB2 Version 9.1 for z/OS (5635-DB2)
| v DB2 Object Comparison Tool Version 7.2 if you plan to use the Change
| Management function.

| If you plan to install DB2 Object Comparison Tool Version 7.2 with DB2 Admin
| Version 7.2, install DB2 Object Comparison Tool Version 7.2 in the same SMP/E
| zones as that for DB2 Admin Version 7.2. (DB2 Object Comparison Tool Version 7.2
| requires DB2 Admin Version 7.2.)

| Tip: Some of the functions in DB2 Admin, such as generating SQL statements to
| reverse engineer DB2 catalog objects, can be run in either the TSO foreground
| or batch. Running in the foreground might require a larger TSO region size. If
| storage allocation fails when you run in the foreground causing an abend
| 4038, increase your TSO region size. To increase the region size, change the
| value of the Size parameter during TSO log-on.

Tailoring summary
After you install DB2 Admin, you must tailor DB2 Admin to your system.

DB2 Admin provides the following items to help you tailor your DB2 Admin
environment:
v Sample batch jobs
v The customization ISPF application (ADB2CUST EXEC)
v SMP/E usermods

The following table summarizes each of the installation steps required to tailor
DB2 Admin to your system.

Chapter 2. Activating DB2 Admin 29


Table 2. Overview of steps for tailoring DB2 Admin
Step Description Job Library For more information:
1 Creating the checkpoint table. ADBCHKPT SADBSAMP “Step 1. Create the checkpoint
table” on page 31
2 Creating a segmented table space in ADBTMPDB SADBSAMP “Step 2. Create a segmented table
a TEMP database. space in a TEMP database” on page
32
|| 3 Preparing to use Change v “Step 3. Set up to use Change
| Management: ADBCHANG SADBSAMP Management” on page 33
| v Create the Change Management ADBCDCH SADBSAMP
| v “Step 3(a). Create the Change
|| database objects. Management database objects”
| v Enable the delete change line on page 33
|| command. v “Step 3(b). (Optional) Enable the
| delete change line command” on
| page 34
4 Binding application packages and ADBBIND SADBSAMP “Step 4. Binding application
plans. packages and plans” on page 34
5 Copying fixed-block libraries to ADBFB2VB SADBSAMP “Step 5. Copy fixed-block libraries
variable-block libraries. to variable-block libraries” on page
36
6 Preparing ADBL CLIST. ADBL SADBCLST “Step 6. Prepare ADBL CLIST” on
page 36
7 Verifying activation of limited “Step 7. Verify activation of limited
functionality. functionality” on page 42
8 Customizing the ISPF environment: ADB2CUST SADBEXEC v “Step 8. Customize the ISPF
v Run the customization EXEC. environment” on page 44
v Supplying information on the v “Step 8(a). Run the customization
customization panels. EXEC” on page 46
v “Step 8(b). Supplying
information about the
customization panels” on page 47
9 Tailoring the Main Menu and the v “Step 9. Tailor the Main Menu
DB2 Selection Menu: ADBU001 SADBSAMP and DB2 Selection Menu” on
v Specify additional DB2 tools on ADBAPPLY SADBBASE page 60
the Main Menu. ADBRECEV SADBBASE
v “Step 9(a). Specify additional
v Specify accessible DB2 DB2 tools on the Main Menu” on
subsystems. page 61
v Submit jobs to tailor menus. v “Step 9(b). Specify DB2
subsystems on the DB2 Selection
Menu” on page 61
v “Step 9(c). Submit jobs to tailor
menus” on page 64
10 Customizing the ADB2UCUS ADBU002 SADBSAMP “Step 10. Customize the
skeleton to align with your data set ADB2UCUS” on page 64
and utility ID (UID) naming
conventions.
11 Tailoring the DB2 Admin “Step 11. Tailor the DB2 Admin
Launchpad. Launchpad” on page 66
12 Updating APF Authorization table. “Step 12. Update the APF
Authorization table” on page 67

30 User's Guide and Reference


Table 2. Overview of steps for tailoring DB2 Admin (continued)
Step Description Job Library For more information:
| 13 Preparing to run utilities online “Step 13. Prepare to run a work
| statement online” on page 68
14 Creating a catalog copy version ADBCATVT SADBSAMP “Step 14. Create a catalog copy
table. version table” on page 68
15 Create views for your own objects ADBRUNSV SADBSAMP “Step 15. Create views for your
in the catalog. own objects in the catalog” on page
69
16 Granting SELECT access on catalog “Step 16. Grant SELECT access on
tables. catalog tables” on page 69
17 Defining Reverse Engineering stored “Step 17. Define Reverse
procedure for CC/390. ADBREST SADBSAMP Engineering stored procedure for
CC/390” on page 69
18 Creating additional DB2 catalog ADBCX SADBSAMP “Step 18. Create additional DB2
indexes. catalog indexes” on page 69
19 Optimizing DSNWZP and “Step 19. Optimize DSNWZP and
DSNZPARM settings. DSNZPARM settings” on page 70
20 Running the RUNSTATS utility on “Step 20. Run the RUNSTATS
the DB2 catalog. utility” on page 70
21 Defining your own line commands. ADB21D SADBEXEC “Step 21. Define your own line
commands” on page 70
22 Tailoring Authorization Switching “Step 22. Tailor DB2 Admin
support. Authorization Switching” on page
71
23 Verifying activation of full “Step 23. Verify installation of
functionality. additional functionality” on page 73
24 Making DB2 Admin available to “Step 24. Make DB2 Admin
users. available to users” on page 74
25 Upgrading to a new release of DB2. “Step 25. Upgrade to a new release
ADBBIND SADBSAMP of DB2” on page 75
ADBREST SADBSAMP
ADBCHAM8 SADBSAMP
26 Upgrading utility templates. “Step 26. Upgrade utility
templates” on page 75

Step 1. Create the checkpoint table


The DB2 Admin Batch Restart program, ADBTEP2, provides the ability to restart or
resume the execution of an input stream of SQL statements, utilities, and DB2
commands in a batch job at an intermediate point, in the event that any one of the
statements in that input stream should fail.

The information to monitor the execution of the input stream is stored in a DB2
table referred to as the checkpoint table.

After DB2 Admin is successfully installed, create the checkpoint table, ADBCHKPT,
on each DB2 subsystem where ADBTEP2 is to be used in batch mode. Sample
statements to create this table are provided in member ADBCHKPT in the
SADBSAMP library.

Chapter 2. Activating DB2 Admin 31


Before submitting sample job ADBCHKPT, modify the job card and the following
items to meet your site naming standards:
v Data set names for your DB2 libraries: RUNLIB, SDSNEXIT, SDSNLOAD
v DB2 subsystem name
v Current SQLID value
v CREATE STOGROUP parameters
v VCAT name
v Database name
v Table space name
v Plan name

Be sure to submit sample job ADBCHKPT on each DB2 subsystem that runs DB2
Admin.
Related concepts
“Using ADBTEP2” on page 343

Using two different versions of DB2 Admin on the same DB2


subsystem
Each version of DB2 Admin that you install requires its own checkpoint table. If
you want to use two or more different versions of DB2 Admin on the same DB2
subsystem, you must tailor sample job ADBCHKPT to use unique owners for each
checkpoint table.

Complete the following steps to create a second checkpoint table:


1. Remove all DROP statements.
2. Change the name of the database that contains the checkpoint table from
ADBDCH to some other database name.
3. Change the user ID in the SET SQLID statement to something other than the
owner of the existing DB2 Admin checkpoint table.
4. Remove the CREATE STOGROUP "ADBGCH" statement.

This user ID should also be specified as the QUALIFIER in “Step 4. Binding


application packages and plans” on page 34.

Step 2. Create a segmented table space in a TEMP database


Each DB2 subsystem that runs DB2 Admin must have a database that is defined as
TEMP that contains a segmented table space to support the use of declared
temporary tables.

| Attention: Perform this step only if you are using DB2 for z/OS Version 8 or
| earlier. Do not perform this step if you are using DB2 Version 9.1 for z/OS.

DB2 Admin uses DECLARE GLOBAL TEMPORARY TABLE statements to


implement some features. For DB2 Version 8, the page size of the segmented table
space must be at least 8 KB.

After DB2 Admin is successfully installed, create a database that is defined as


TEMP and a segmented table space in this database on each DB2 subsystem that
runs DB2 Admin and that is not already set up to support the use of declared

32 User's Guide and Reference


temporary tables. Sample statements to create the objects necessary to support
declared temporary tables are provided in member ADBTMPDB in the
SADBSAMP library.

Before submitting sample job ADBTMPDB, modify the job card and the following
items to meet your site naming standards:
v Data set names for your DB2 libraries: RUNLIB, SDSNEXIT, SDSNLOAD
v DB2 subsystem name
v Plan name
v Current SQLID value
v Database name
v Table space name
v SEGSIZE parameter
v BUFFERPOOL parameter

Be sure to submit sample job ADBTMPDB on each DB2 subsystem that runs DB2
Admin and is not set up to support the use of declared temporary tables.

Step 3. Set up to use Change Management


The Change Management function provides the ability to record and track the
changes that are made to DB2 objects.

For each DB2 subsystem for which you plan to use Change Management, you
must do the following tasks:
v Create a special database that stores the Change Management information.
v Ensure that you define a qualifier for the database objects in the :cmown. tag
when you run the ADB2CUST EXEC.
Related concepts
“Prerequisites for Change Management” on page 453
“Step 8. Customize the ISPF environment” on page 44

Step 3(a). Create the Change Management database objects


Sample jobs are provided in member ADBCHANG (for DB2 for z/OS Version 8) or
ADBCHAN7 (for DB2 for z/OS Version 7) in the SADBSAMP library to create the
Change Management database objects.

The sample jobs set the default Change Management level to NONE. The default
value will need to be changed later to REQUIRED or OPTIONAL for users to
register changes in the Change Management database.

Before submitting the sample job to create the Change Management database
objects, modify the job card and the following items to meet your requirements:
v The storage group name. The default is ADBGCHG.
v The database name. The default is ADBDCHG.
v The table space names. By default, the names are prefixed with ADBSC
v The owner of the objects in the Change Management database. The default is
ADB. If you change this value, you should also change the corresponding
QUALIFIER on the BIND PACKAGE commands in SAMP member ADBBIND
where indicated in the member and set the customization parameter CMOWN
to the new value.

Chapter 2. Activating DB2 Admin 33


Step 3(b). (Optional) Enable the delete change line command
The delete change (DEL) line command allows a change to be deleted from the
Change Management database.

By default, this line command is disabled.

A sample job is provided in member ADBCDCH in the SADBSAMP library to


enable the delete change line command. Run this sample job member after the
Change Management database objects are created to enable the delete change line
command.

When the delete change line command is enabled, only the following types of
changes can be deleted:
v Changes that have a status of CANCELED
v Changes that have a type of FAST and a status of FAILED
v Changes that have a type of COMPARE

| Although this criteria for deleting a change cannot be modified, additional


| constraints can be added. You can customize the WHERE clause of the view with
| the name of ADBCHGV1 that is defined in the ADBCDCH sample member to
| control which changes a user can delete. If you run DB2 Admin without specifying
| a PLAN parameter or with a PLAN parameter without a value, for example
| PLAN(), you can also customize who has access to the ADBCDCH plan to control
| which users have access to use the delete change line command.

| Before submitting the sample job to enable the Change Management delete change
| feature, modify the job card and the following items to meet your requirements:
v The owner of the objects in the Change Management database. The default is
ADB.
v The definition of the ADBCHGV1 view. Either accept the default or customize.
v If DB2 Admin will be run with the PLAN parameter, the ADBCDCH package
must be included in the specified plan.

Step 4. Binding application packages and plans


To run DB2 Admin, you must bind the DB2 Admin application packages and
plans.

A sample job is provided in member ADBBIND in the SADBSAMP library. Submit


sample job ADBBIND on each DB2 subsystem that runs DB2 Admin for TSO or
batch jobs.

DB2 Admin sample jobs use the DB2 program DSNTIAD to run GRANT
statements. If DSNTIAD is not available at your site, run the required GRANT
statements using SPUFI.

Before submitting sample job ADBBIND, modify the job card and the following
items to meet your site naming standards:
v Data set names for DB2 Admin data sets.
v Data set names for your DB2 libraries: RUNLIB, SDSNEXIT, SDSNLOAD.
v DB2 subsystem name.
v Plan name.

34 User's Guide and Reference


v The value specified as the QUALIFIER of the BIND PACKAGE(ADBL)
MEMBER(ADBTEP2). The value specified as the QUALIFIER should match the
owner of the checkpoint table. This is the owner that is specified on the SET
SQLID statement in the sample job ADBCHKPT.

Be sure to submit sample job ADBBIND on each DB2 subsystem that runs DB2
Admin.

When you run sample job ADBBIND for a DB2 Version 7 subsystem, delete the
BIND statement for ADB8SQL. The BIND statement for ADB8SQL is not valid for
a DB2 Version 7 subsystem and will fail with return code 8 and message
DSNT207I.

When running sample job ADBBIND, return code 0 indicates a successful bind.
Non-zero return codes will occur in the following situations:
v A return code of 4 occurs if you are binding on a lower release level of DB2.
DB2 issues error messages when binding DBRMs that contain SQL statements
that reference any DB2 catalog tables or columns that do not exist. These error
messages and the return code of 4 are expected, and no action is required.
| v A return code of 8 occurs if you do not plan to use Change Management and
| did not create the Change Management database objects. Bind failures for the
| following packages are expected:
| – ADBCDTW
| – ADBCEST
| – ADBCIMU
| – ADBCMRQ
| – ADBCPRE
| – ADBCRCC
| – ADBCRCM
| – ADBCRCP
| – ADBCRCR
| – ADBCSRV
| – ADBCUPC
| – ADBCVCP
| – ADBCVEX
| – ADBCVIC
| – ADBCVSX
| No other action is required after you verify that the bind failures are for these
| packages only.
Related concepts
“Introduction to ADBTEP2” on page 340

Using two different versions of DB2 Admin on the same DB2


subsystem
Each version of DB2 Admin that you install requires its own application package
and plan. If you want to use two or more different versions of DB2 Admin on the
same DB2 subsystem, you must tailor sample job ADBBIND to use unique names
for packages and plans.

Chapter 2. Activating DB2 Admin 35


The supplied defaults are collection ADBL and plan ADB. The following
instructions assume that the first version of DB2 Admin has been installed using
these supplied defaults, and that the second version uses collection ADBLTEST and
plan ADBTEST for all programs.
1. Make the following changes to sample job ADBBIND:
v Change all occurrences of BIND PACKAGE(ADBL)... to BIND
PACKAGE(ADBLTEST)....
v Change BIND PLAN(ADB) PKLIST(*.ADBL.*)... to BIND PLAN(ADBTEST)
PKLIST(*.ADBLTEST.*) ....
v Remove all other BIND PLAN statements.
2. Specify PLAN(ADBTEST) when invoking the ADBL CLIST.

When using a copy of the DB2 catalog, the DB2 Admin batch programs
(ADB2GEN, ADB27AC, and so on) require you to use the ADB DB2 PLAN name. If
you change the plan name in sample job ADBBIND to something other than ADB,
DB2 Admin uses the specified plan name for all batch programs and these batch
programs are unable to use a copy of the DB2 catalog.

Step 5. Copy fixed-block libraries to variable-block libraries


DB2 Admin is shipped with the CLIST and EXEC libraries in fixed-block format
(FB 80).

The CLIST library name is SADBCLST and the EXEC library name is SADBEXEC.
If you use CLIST and EXEC libraries that are variable blocked (VB), create VB
versions of these libraries. Member ADBFB2VB in library SADBSAMP contains a
sample job to create VB 255 copies of the EXEC and CLIST libraries. The data set
names of the new VB libraries are the same as the FB libraries, but are suffixed
with .VB.

Before submitting the job, modify the job card and the following items to meet
your site requirements:
| ADB.V720
High-level qualifier for data sets
VLSRNM
Volume-serial (not necessary for SMS)
SYSDA
DASD unit (not necessary for SMS)
Related concepts
“Step 6. Prepare ADBL CLIST”
Related tasks
“Step 7. Verify activation of limited functionality” on page 42

Step 6. Prepare ADBL CLIST


The ADBL CLIST in the SADBCLST library is provided for running DB2 Admin.

The ADBL CLIST in the SADBCLST library is provided for running DB2 Admin.
The ADBL CLIST brings up the DB2 Admin Main Menu.

36 User's Guide and Reference


You can invoke the ADBL CLIST from any ISPF panel or from the ISPF command
processor panel (usually ISPF option 6). You can add the % prefix to the beginning
of the CLIST name to ensure that TSO/E only searches the CLIST libraries.

Several CLIST parameters are available for your use:


| ASUSER
| Allows you to establish a trusted context. This parameter is passed to the DSN
| command. This parameter can also be used in ADB CLIST. If ASUSER is
| specified, then all additional connects made online should also be made using
| the specified ASUSER.

| Restriction:
| v ASUSER is only used in DSN connections.
| v If the trusted context does not include the job name submitted,
| the trusted context will not be established.
| CMOWN
| The owner (qualifier) of the Change Management database objects. If you use a
| minus sign with this parameter, the value that is set for the :cmown tag on the
| General Customization Parameters panel is overridden by the DB2 Admin
| default, which is null.
| The following examples show how you can use the CMOWN parameter:
| CMOWN(CMDBADM)
| CMOWN(-)
DASD
The unit name for batch work data sets. If you use a minus sign with this
parameter, the value in the Unit name for batch data sets field on the General
Customization Parameters panel is overridden by the DB2 Admin default,
which is SYSDA.
The following examples show how you can use the DASD parameter:
DASD(SYSALLDA)
DASD(-)
DB2LLIB
List of the DB2 product load module libraries where DB2 is installed if DB2 is
not in the linklist.
DEBUG
Use this parameter only at the request of your IBM service representative.
DMT
You can use the DMT parameter to access the DB2 Tools Launchpad panel.
From this panel, you can either invoke a DB2 tool or you can continue to use
the DB2 Admin functions that are described in this information. If you do not
use the DMT parameter, you go directly to the DB2 Admin functions, but you
cannot launch other DB2 tools from within DB2 Admin.
| DMTID
| Indicates which library from the DB2 Tools Launchpad TLIB list you want to
| select by default. You can specify this parameter from your local front-end
| panel, CLIST, or from a REXX exec that invokes the ADBL CLIST. You will
| specify a number in parenthesis, for example, dmtid(2). An S will be placed in
| the Sel field for the row that you indicate (in this example, the second row) for
| the library that you want to be the default. This library is displayed in the

Chapter 2. Activating DB2 Admin 37


| panel to show where the update will be written. If the number you enter
| exceeds the number of rows, an S will be placed in the last row. If Launchpad
| is not active, then DMTID is ignored.
DUMP
Use this parameter only at the request of your IBM service representative.
INSTALL
Installation name.
JES
The JES environment name. For JES3 environments, specify JES(JES3).
Otherwise, use the default (null).
LIBAPRE
The prefix for PRODADD() libraries. The default is none. See the LIBPRE
parameter for an example of how data set names are generated from the
LIBAPRE parameter.
LIBPRE
The prefix for DB2 Admin libraries. This prefix designates the first set of
characters (up to four) in the final qualifier of the DB2 Admin libraries.
The default is SADB.
The following example shows how you can use the LIBPRE parameter to
generate dataset names ADB.SAMP.ISPPLIB and ADB.SAMP.ISPLLIB:
PROD(ADB.SAMP) LIBPRE(ISP)
LIBDEF(YES|NO)
If you allocate the DB2 Admin libraries in your TSO logon procedure, it is not
necessary for the ADBL CLIST to issue ISPF LIBDEF statements for those
libraries. LIBDEF(YES) is the default. Specify LIBDEF(NO) to bypass the ISPF
LIBDEFs.
LIST
High-level qualifiers of additional libraries to allocate before PROD(),
PRODADD(), and USERADD(). No default exists. If you specify LIST, you
must also specify LISTPRE. The entries that are specified in LIST and LISTPRE
have a one-to-one correspondence.
LISTPARM
Use this parameter, which causes a list of the initialization parameters to be
displayed, only at the request of your IBM service representative.
LISTPRE
List of prefixes for LIST() libraries. No default exists. If you specify LISTPRE,
you must also specify LIST. The entries that are specified in LIST and LISTPRE
have a one-to-one correspondence.
NEWAPPL
The ISPF application ID. NEWAPPL identifies the member name in which the
ISPF profile variables are saved for DB2 Admin. The default value for
NEWAPPL is null with an application ID of ISR. If you use a minus sign with
this parameter, the value set for the :newappl. tag is overridden by the DB2
Admin default, which is ISR.
The following examples show how you can use the NEWAPPL parameter:
NEWAPPL(ADB)
NEWAPPL(-)

38 User's Guide and Reference


PANEL
The panel name for the DB2 Admin panel that is displayed first. The default is
ADB2.
PGM
The name of the DB2 Admin main program. The default is ADBMAIN.
PLAN
The plan name to use. If you do not specify a plan name, the following plan
names are used: ADB, ADB2GEN, and ADB27AC. If you specify a plan name,
it is used for all programs.
PROD
You can use the PROD parameter to override the high-level qualifier for all
DB2 Admin product libraries, or you can edit the ADBL CLIST and specify the
high-level qualifier in the PROD parameter. On this parameter, you must
specify the correct value for the DB2 Admin libraries, including libraries that
are allocated in your TSO logon procedure. Specify a period to disable,
PROD(.). TSO does not allow PROD().
PRODADD
The high-level qualifier for additional product libraries to allocate in front of
PROD(). The default is none.
| QTAB
| Use this parameter, which lists open ISPF tables at the beginning and end of a
| DB2 Admin session, only at the request of your IBM service representative.
SECEXIT
The DB2 security exit type. The possible values are STD (the default),
SAMPLE, AUTH, OWN, and NOCALL. If you use a minus sign with this
parameter, the value set for the :secexit. tag or the DB2 Security exit type field
on the General Customization Parameters panel is overridden by the DB2
Admin default, which is STD.
The following examples show how you can use the SECEXIT parameter:
SECEXIT(AUTH)
SECEXIT(-)
SHOW
Use the SHOW parameter to start your DB2 Admin session with a panel that
shows all of the active DB2 subsystems that are available to you.
SYSTEM(ssid)
Use the SYSTEM(ssid) parameter to directly access a specific DB2 subsystem.
This parameter is ignored if the SHOW parameter is specified.
USER
To activate the CLIST and EXEC libraries that are allocated to the SYSUPROC
and SYSUEXEC DD names, issue an ALTLIB USER statement after ALTLIB
APPLICATION. These libraries are then searched before searching the DB2
Admin libraries.
USERADD
The high-level qualifier for additional user-development libraries to allocate in
front of PROD() and PRODADD(). The default is none.
USERPRE
The prefix for USERADD() libraries. The default is none. See the LIBPRE
parameter for an example of how data set names are generated from the
USERPRE parameter.

Chapter 2. Activating DB2 Admin 39


VB
If your site uses variable-length CLIST and EXEC libraries, you can use the VB
parameter to access the SADBCLST.VB and SADBEXEC.VB libraries that are
created during installation.
VIO
The unit name for TSO work data sets. If you use a minus sign with this
parameter, the value in the Unit name for TSO work data sets field on the
General Customization Parameters panel is overridden by the DB2 Admin
default, which is VIO.
The following examples show how you can use the VIO parameter:
VIO(SYSALLDA)
VIO(-)

When using the ADBL CLIST to define the DB2 Admin libraries (using the ISPF
LIBDEF command), the data set naming convention must include the following
components:
v A high-level qualifier specified using PROD, PRODADD, and USERADD.
v A prefix specified using LIBPRE, LIBAPRE, and USERPRE.
v A suffix that must include the following information:
– LLIB load library
– MLIB message library
– PLIB panel library
– SLIB skeleton library
– TLIB table library
– CLIST library CLIST or CLST
– EXEC library

Three pairs of keyword parameters are used to specify up to three levels of


concatenation for product libraries:
PROD and LIBPRE
Used for the DB2 Admin libraries.
PRODADD and LIBAPRE
Used for any additional products, such as DB2 Object Comparison Tool.
USERADD and USERPRE
Used for user-private development libraries when adding your own panels
to DB2 Admin.

The following example shows how you can use the three pairs of keyword
parameters:
ADBL PROD(ADB.VR01) LIBPRE(SADB)
PRODADD(GOC.VR10) LIBAPRE(ISP)
USERADD(USER01) USERPRE(ISP)

Using these parameter values results in allocating libraries as follows:


load library USER01.ISPLLIB,GOC.VR10.ISPLLIB,ADB.VR01.SADBLLIB
message library USER01.ISPMLIB,GOC.VR10.ISPMLIB,ADB.VR01.SADBMLIB
panel library USER01.ISPPLIB,GOC.VR10.ISPPLIB,ADB.VR01.SADBPLIB
skeleton library USER01.ISPSLIB,GOC.VR10.ISPSLIB,ADB.VR01.SADBSLIB
table library USER01.ISPTLIB,GOC.VR10.ISPTLIB,ADB.VR01.SADBTLIB
CLIST library USER01.CLIST,GOC.VR10.CLIST,ADB.VR01.SADBCLST
exec library USER01.EXEC,GOC.VR10.EXEC,ADB.VR01.SADBEXEC

40 User's Guide and Reference


In general, the last data set name qualifier is composed of the prefix (for example,
SADB), followed by the library type (for example, LLIB). The exception to this
convention is the prefix ISP, which generates data set names that use the qualifiers
CLIST and EXEC for the CLIST and EXEC libraries, respectively.

The following sample REXX EXEC runs DB2 Admin:


| /* REXX */
| /* Sample REXX EXEC ADBRUN */
| trace "O"
| parse upper arg rel userparms
| prod = "PROD(.)"; libpre = ""
| adblclst = "'ADB.V720.CLIST(ADBL)'"
| plan = "PLAN(ADB)"
| select
| when rel = "PROD" then do
| list = "LIST(''ADB.V720'')"
| listpre = "LISTPRE(''ISP'')"
| end
| when rel = "TEST" then do
| list = "LIST(''USER.V720 ADB.V720'')"
| listpre = "LISTPRE(''SADB ISP'')"
| end
| otherwise do
| say "Invalid parameter:" rel "TEST assumed."
| list = "LIST(''USER.V720 ADB.V720'')"
| listpre = "LISTPRE(''SADB ISP'')"
| end
| end /* select */
| say "CLIST =" adblclst
| say "LIST =" list listpre
| say "PARMS =" plan userparms
| cmd = "EXEC" adblclst "'" prod list listpre plan userparms "'"
| say "CMD =" cmd
| cmd
| exit

Example:
| %ADBRUN TEST
|
| will ISPF LIBDEF the following data sets:
|
| ISPLLIB DATASET USER.V720.SADBLLIB
| ADB.V720.ISPLLIB
|
| ISPMLIB DATASET USER.V720.SADBMLIB
| ADB.V720.ISPMLIB
|
| ISPPLIB DATASET USER.V720.SADBPLIB
| ADB.V720.ISPPLIB
|
| ISPSLIB DATASET USER.V720.SADBSLIB
| ADB.V720.ISPSLIB
|
| ISPTLIB DATASET USER.V720.SADBTLIB
| ADB.V720.ISPTLIB
|
| and ALTLIB ACTIVATE the following data sets:
|
| APPLICATION(CLIST) DATASET USER.V720.SADBCLST
| ADB.V720.CLIST
|
| APPPLICATION(EXEC) DATASET USER.V720.SADBEXEC
| ADB.V720.EXEC

Chapter 2. Activating DB2 Admin 41


Related concepts
“Step 5. Copy fixed-block libraries to variable-block libraries” on page 36
Related information
Chapter 3, “Using the DB2 Admin Launchpad,” on page 77

Step 7. Verify activation of limited functionality


To use DB2 Admin you must check your TSO LOGON PROC and your link list
definition to verify that the DB2 libraries are available to your TSO session.

At this point, you can use DB2 Admin with limited functionality. However, to use
DB2 Admin, the DB2 libraries must be allocated to your TSO session.

Before proceeding to enable DB2 Admin for additional functionality, verify that
DB2 Admin is operational by completing the following steps:
1. Determine where the DB2 DSN command is installed.
2. Make the DB2 Admin ISPF and TSO libraries available to your ISPF session.
You can do this in one of the following ways:
v A. Copy the ADBL CLIST to your standard ISPF and TSO libraries.
v B. Add the DB2 Admin product libraries to your TSO LOGON PROC. The
following table shows the libraries you can allocate to your TSO LOGON
PROC.
Table 3. Libraries to allocate to your TSO LOGON PROC
DDNAME Library DSN Suffix
ISPLLIB SADBLLIB
ISPMLIB SADBMLIB
ISPPLIB SADBPLIB
ISPSLIB SADBSLIB
ISPTLIB SADBTLIB
SYSPROC CLIST or SADBCLST
SYSPROC EXEC or SADBEXEC

v C. Write a small CLIST that runs the ADBL CLIST.


3. Start DB2 Admin according to the option you chose in 2.
v If you chose option A or B, issue the following command:
TSO %ADBL
v If you chose option A or B and the DB2 DSN command is not in the linklist,
you need to specify the data set name of the DB2 load module library in
which the DSN command resides as a parameter when you issue the
following command:
TSO %ADBL DB2LLIB(''DSN8.SDSNEXIT DSN8.SDSNLOAD'')
v If you chose option C, issue the following command to run the ADBRUN
CLIST that you created:
%ADBRUN DB2LLIB(''DSN8.SDSNEXIT DSN8.SDSNLOAD'')
If more than one DB2 subsystem is active, the Active DB2 Systems panel
(ADB2SYS) that shows all DB2 subsystems, as shown in the following figure, is
displayed.

42 User's Guide and Reference


DB2 Admin ------------------- Active DB2 Systems --------------- Row 1 from 18
Command ===> Scroll ===> PAGE

This is a list of the active DB2 systems on this MVS system.

Enter:
DB2 system name ===> DB2X Retain DB2 system name ===> YES (Yes/No)

Or select the one you wish to use, or press END to exit.

Sel DB2 System Description Group


--- ---------- ---------------------------------------------------------- -----
DB2A Basic system 1
DB2B Local business system
DB2C Data sharing system

Figure 1. The Active DB2 Systems panel (ADB2SYS)

4. Select the DB2 subsystem that you want to use and press Enter. The DB2
Admin Main Menu panel, as shown in the following figure, is displayed.

| DB2 Admin -------------- DB2 Administration Menu 7.2.0 ------------------ 01:03


| Option ===>
|
| 1 - DB2 system catalog DB2 System: DB2X
| 2 - Execute SQL statements DB2 SQL ID: ISTJE
| 3 - DB2 performance queries Userid : ISTJE
| 4 - Change current SQL ID DB2 Rel : 810
| 5 - Utility generation using LISTDEFs and TEMPLATEs
| P - Change DB2 Admin parameters
| DD - Distributed DB2 systems
| E - Explain
| Z - DB2 system administration
| SM - Space management functions
| W - Manage work statement lists
| X - Exit DB2 Admin
| CC - DB2 catalog copy version maintenance
| CM - Change management
|
| Interface to other DB2 products and offerings:
| I - DB2I DB2 Interactive
| C - DB2 Object Comparison Tool
||
| Figure 2. The DB2 Admin Main Menu panel (ADB2)
|
Attention: If an SQL error occurs, ensure that the application plan (ADB) and
the packages (ADBMAIN, ADB2GET, and ADB2CON) are bound correctly on
the DB2 subsystem that you are using. Also, verify that you have granted
EXECUTE on the application plan ADB to the user IDs that are running DB2
Admin. Restart from 2 on page 42.
5. Verify that DB2 Admin is available with limited functionality by completing the
following steps:
a. Select option 1 to go to the DB2 System Catalog.
b. Select option T to go to the Tables, Views, and Aliases panel. Specify
SYSDUMMY1 for the name and specify SYSIBM for the owner.
c. Verify that DB2 Admin can retrieve rows from the DB2 catalog. You should
see a row that describes the table SYSDUMMY1 owned by user SYSIBM.
d. Use the DDL line command on the row for SYSDUMMY1. You should see a
CREATE TABLE statement that can be used to create the table.

To invoke DB2 Admin for DB2 subsystem ABCD, enter the following command on
the command line of the ISPF main menu:

Chapter 2. Activating DB2 Admin 43


TSO %ADBL SYSTEM(ABCD)

To invoke the DB2 Admin Launchpad panel, which enables you to continue using
DB2 Admin functions or to invoke another DB2 tool, enter the following command
on the command line of the ISPF command processor panel (usually ISPF option
6):
%ADBL DMT

To directly invoke DB2 Admin and display all of the active DB2 subsystems that
are available to you, enter the following command on the command line of the
ISPF command processor panel (usually ISPF option 6):
%ADBL SHOW
Related concepts
“Step 5. Copy fixed-block libraries to variable-block libraries” on page 36

Step 8. Customize the ISPF environment


DB2 Admin uses customizable variables that are stored in ISPF tables to define the
execution environment.

These environmental variables sometimes require tailoring to your site naming


standards. The ADB2CUST EXEC is an ISPF dialog application used to tailor these
environmental variables. Run ADB2CUST during your DB2 Admin tailoring
process to provide values for these environment variables. You can use the
ADB2CUST EXEC at any time if you want to change these values.

To access the DB2 Admin customization panels, run the ADB2CUST EXEC. Invoke
the ADB2CUST EXEC in ISPF option 6, as shown in the following example:
| EXEC 'ADB.V720.SADBEXEC(ADB2CUST)'

The values that are used at execution time are assigned in the following sequence
until a value is located:
1. Keyword parameters that are specified in the ADBL CLIST at execution time.
2. DB2 subsystem-specific customization parameters (specified in panel
ADB2CUS2, DB2 Subsystem Customization Parameters).
3. DB2 subsystem default customization parameters (specified with DB2
subsystem name of *).
4. DB2 Admin general customization parameters (specified in panel ADB2CUS1,
General Customization Parameters).
5. DB2 Admin default parameters (built into DB2 Admin).

You can tailor the parameters listed in the following table. The numbers in the
table refer to the numbers in the previous list.
Table 4. Parameters that you can tailor from the General Customization Parameters panel
ADBL Subsystem Subsystem General
Item to customize CLIST specific default parameters Tag Default
DB2 subsystem name 2 :nick. N/A
DB2 subsystem description 2 :desc. null
text
DB2 security exit type 1 2 3 4 :secexit. STD

44 User's Guide and Reference


Table 4. Parameters that you can tailor from the General Customization Parameters panel (continued)
ADBL Subsystem Subsystem General
Item to customize CLIST specific default parameters Tag Default
Copy version control table 2 3 4 :cvtown. null
qualifier
System identification method 1 2 3 4 null
Job parameter SYSAFF for 1 2 3 4 : jsysaff. null
batch DB2 utility jobs
Job class to be used for batch 2 3 :jclass. A
DB2 utility jobs
Unit name for TSO work data 1 4 ISPF V4 unit
sets name
(ZCUNIT)
or VIO
Unit name for batch data sets 1 4 ISPF V4 unit
name
(ZCUNIT)
or SYSDA
Installation name 1 2 3 4 :instparm. null
Node name 2 3 4 :nodnam. null
ISPF load libraries (LLib1 and 4 null
LLib2)
ISPF message library 4 null
ISPF table library 4 null
DB2 Admin APF Library 4 null
Unicode translation technique 4 null
DB2 started task name 2 :stcnam. null
DB2 group name 2 :grpnam. null
DB2 utility data set prefix 2 3 :utilpre. USERID
DB2 remote subsystem name 2 3 :ssid. null
DB2 remote subsystem 2 3 :locnam. null
location name
Authorization Switching 2 3 :authsw. Disabled
enabled
ISPF Application ID 1 2 3 :newappl. null
Prompt options 2 3 :prompt. null
Reset to Default at Startup 2 3 :resetopt. null
DSNUPROC step count 2 3 :nstuproc. 1
| Change Management objects 1 2 3 :cmown. null
| owner
| Allow switch of SSID 2 3 :swssid. yes
DB2 High Performance 2 3 :hpu. Disabled
Unload enabled
DB2 High Performance 2 3 :hpullib. null
Unload load library
REXX user exit libraries 2 3 :uexelib. null
DB2 load library 2 3 :bl2llib. null

Chapter 2. Activating DB2 Admin 45


Table 4. Parameters that you can tailor from the General Customization Parameters panel (continued)
ADBL Subsystem Subsystem General
Item to customize CLIST specific default parameters Tag Default
DB2 run library 2 3 :bl2rlib. null
DB2 message library 2 3 :bl2mlib. null
DB2 panel library 2 3 :bl2plib. null
DB2 skeleton library 2 3 :bl2slib. null
DB2 table library 2 3 :bl2tlib. null
DB2 REXX exec library 2 3 :bl2elib. null
DB2 CLIST library 2 3 :bl2clib. null
JES3 1 4 no

Related concepts
“Step 3. Set up to use Change Management” on page 33
“Step 12. Update the APF Authorization table” on page 67
Chapter 24, “Running DB2 Admin across distributed systems,” on page 539
“Step 8(a). Run the customization EXEC”
“Step 8(b). Supplying information about the customization panels” on page 47
Related tasks
“Step 22. Tailor DB2 Admin Authorization Switching” on page 71
Related information
IBM Publications Center

Step 8(a). Run the customization EXEC


Put your short description here; used for first paragraph and abstract.

Invoke the ADB2CUST EXEC in ISPF option 6 (TSO) with the following command:
| EXEC 'ADB.V720.SADBEXEC(ADB2CUST)'

| The customization EXEC uses the ISPF LIBDEF command to make additional
| product libraries available. The following algorithm is used to find the data sets for
| these libraries:
1. The high level qualifier for the data set names is generated by removing the
last qualifier from the data set name that contains the customization EXEC.
2. These library types are searched, prefixed with the high level qualifier, until the
data set is found:
CLIST SADBCLST
EXEC SADBEXEC
ISPLLIB SADBLLIB LOAD
ISPMLIB SADBMLIB MSGS
ISPPLIB SADBPLIB PANELS
ISPTLIB SADBTLIB TABLES

| You can use the LIBPRE value when you invoke the customization EXEC to specify
| the first set of characters (up to four) in the final qualifier of the LLIB, MLIB, PLIB,
| and TLIB library types. LLIB, MLIB, PLIB, and TLIB are appended to the LIBPRE
| value, and those are the data sets that must be found. For example, assume that
| you invoke the customization EXEC with the following command:
| EXEC 'ADB.V720.SADBEXEC(ADB2CUST)' 'LIBPRE(MY99)'

46 User's Guide and Reference


| The following data sets are searched for:
| ADB.V720.CLIST ADB.V720.SADBCLST
| ADB.V720.EXEC ADB.V720.SADBEXEC
| ADB.V720.MY99LLIB
| ADB.V720.MY99MLIB
| ADB.V720.MY99PLIB
| ADB.V720.MY99TLIB
Related concepts
“Step 8. Customize the ISPF environment” on page 44
Related tasks
“Step 22. Tailor DB2 Admin Authorization Switching” on page 71

Step 8(b). Supplying information about the customization


panels
This section describes the panels that you use to supply the customization
information.

DB2 Admin Customization panel

The DB2 Admin Customization panel is displayed, as shown in the following


figure, when you invoke the ADB2CUST EXEC.

To ensure that tables are stored in the correct library, specify the name of the ISPF
table library to use when DB2 Admin is started. Specify the SADBTLIB library and
select additional customization steps on this panel.

| DB2 Admin ------------ DB2 Administration - Customization -------------- 00:36


| Option ===>
|
| Options:
| 1 - General parameters for DB2 Admin
| 2 - DB2 subsystem parameters for DB2 Admin
| 3 - Copy general parameters and DB2 subsystem parameters
|
| Library to be used for DB2 Admin customization ISPF tables:
| ISPF table library ==> 'ADB.V720.SADBTLIB'
||
| Figure 3. The DB2 Admin Customization panel (ADB2CUS0)
|
General Customization Parameters panel
The General Customization Parameters panel is displayed, as shown in the
following figure, when you select option 1 on the DB2 Admin Customization
panel.

The general customization parameters are stored in ISPF table member


ADB2PARM in the ISPF table library, which is specified on the DB2 Admin
Customization panel.

Chapter 2. Activating DB2 Admin 47


DB2 Admin ----------- Customization - General Parameters --------------- 00:37
Option ===>

General parameters for DB2 Admin:

Press ENTER to save parameters, or END to leave without saving parameters.

DB2 security exit type ==> SAMPLE (STD,SAMPLE,AUTH,NOCALL,OWN)


Copy version control table qualifier ==> (table owner ID)
System identification method ==> (JESID,SMFID,SYSNAME,NONE)
Unit name for TSO work data sets ==> VIO
Unit name for batch data sets ==> SYSALLDA
Installation name ==>
Node Name ==>
JES3 system ==> N (Yes/No)
Unicode translation technique ==> ER ('ER ', etc)
ISPF LLib1(not lnklst'd) ==> ISP.SISPLOAD
ISPF LLib2(not lnklst'd) ==> ISP.SISPLPA
ISPF Message Lib ==> ISP.SISPMENU
ISPF Table Lib ==> ISP.SISPTENU
DB2 Admin APF Library ==>

Current SYSAFF information for this MVS system:


JES ID: NONE (found via JESID method)
SMF ID: MVSB (found via SMFID method)
MVS system name: MVSB (found via SYSNAME method)

Figure 4. General Customization Parameters panel (ADB2CUS1)

DB2 Subsystem Customization Parameters panel

The DB2 Subsystem Customization Parameters panel is displayed, as shown in the


following figure when you select option 2. You can specify DB2 subsystem
parameters on this panel. The DB2 subsystem parameters are stored in ISPF table
member ADB2DB2D in the table library specified on the DB2 Admin
Customization panel.

| DB2 Admin -------- Customization - DB2 Subsystem Parameters ------------- 14:12


| Option ===>
|
| Options:
| 1 - Merge list of active DB2 subsystem(s) into ISPF table
| 2 - Edit ISPF table
|
| Currently active DB2 subsystem(s) on this MVS system:
| DB2 subsystem(s): DB2M DB2T DB2X DB2W
| Data sets to be used for DB2 Admin customization:
| ISPF table library: 'ADB.V720.SADBTLIB'
||
| Figure 5. DB2 Subsystem Customization Parameters panel (ADB2CUS2)
|
Each DB2 subsystem can have one ISPF table row that contains a text description
and default values for that DB2 subsystem. This specification overrides the general
customization parameters set for DB2 Admin.
Option 1. Merge list of active DB2 subsystems into ISPF table
Adds to the ISPF table one row with null values for each of the currently
active DB2 subsystems. DB2 subsystems that have already been added are
not replaced. This merge allows repeated use of option 1 without losing
information about DB2 subsystems that have already been described.
Option 2. Edit ISPF table
Unloads the ISPF table to a sequential data set, and allows you to edit the
sequential data set using ISPF edit. If modified during editing, the
sequential data set is reloaded into the ISPF table. The ISPF table is
48 User's Guide and Reference
replaced with the edited data. This option can also be used to delete old
data for inactive DB2 subsystems. The following figure shows an example
of the panel that is displayed when you choose option 2.

Chapter 2. Activating DB2 Admin 49


| File Edit Edit_Settings Menu Utilities Compilers Test Help
| -------------------------------------------------------------------------------
| EDIT SYS01311.T003754.RA000.ISTJE.R0215440 Columns 00001 00072
| Command ===> Scroll ===> PAGE
| ****** ***************************** Top of Data ******************************
| 000001
| 000002 *
| 000003 * Tags recognized by ADB2CUST exec:
| 000004 * ----------------------------------------------------------------------
| 000005 * :nick. Name of DB2 subsystem or group being described
| 000006 * :desc. Text to be displayed for this DB2 subsystem or DB2 group
| 000007 * :secexit. DB2 security exit type (STD,SAMPLE,AUTH,OWN,NOCALL)
| 000008 * :cvtown. Copy version table owner
| 000009 * :stcnam. Started task name of this DB2 subsystem
| 000010 * :grpnam. DB2 group name of this DB2 subsystem or DB2 group
| 000011 * :jclass. Job class to be used for batch DB2 utility jobs
| 000012 * :jsysaff. SYSAFF to be used for batch DB2 utility jobs
| 000013 * :instparm. Installation name
| 000014 * :utilpre. Utility data set prefix (USERID, OWNER, CREATEDBY, name)
| 000015 * :ssid. Subsystem name of the remote subsystem (blank if local)
| 000016 * :nodenam. Node name of the remote system (blank if local)
| 000017 * :locnam. Location name of the remote subsystem (blank if local)
| 000018 * :authsw. Authorization Switching enabled (YES,NO)
| 000019 * :newappl. ISPF application ID
| 000020 * :prompt. Default value for Prompt Options (YES,NO)
| 000021 * :resetopt. Default value for Reset to Default at Startup (YES,NO)
| 000022 * :nstuproc. Number of job steps in the DSNUPROC procedure
| 000023 * :cmown. Owner (qualifier) of Change Management database objects
| 000024 * :swssid Allow switch of SSID (YES,NO)
| 000025 * :hpu. High Performance Unload (HPU) enabled (YES,NO)
| 000026 * :hpullib. High Performance Unload (HPU) load library
| 000027 * :uexelib. REXX user exit libraries
| 000028 *
| 000029 * :bl2llib. DB2 load library
| 000030 * :bl2rlib. DB2 run library
| 000031 * :bl2mlib. DB2 message library
| 000032 * :bl2plib. DB2 panel library
| 000033 * :bl2slib. DB2 skeleton library
| 000034 * :bl2tlib. DB2 table library
| 000035 * :bl2elib. DB2 REXX EXEC library
| 000036 * :bl2clib. DB2 CLIST library
| 000037 *
| 000038 * Main menu option tags (prefixed by letter a-j)
| 000039 *
| 000040 * :aopt. Option
| 000041 * :adescr. Option description
| 000042 * :aispf. ISPF statement for option
| 000043 * :apan. ISPF panel for option
| 000044 * :asql. SQL statement for option
| 000045 * :acmd. DB2 Admin command for option
| 000046 * :anewat. New DB2 attachment (YES,NO)
| 000047 *
| 000048
| 000049 :nick.DB2X :desc.DB2 Version 8
| 000050 :jclass.9
| 000051 :bl2llib.'SYS1.DSNDB2X.SDSNEXIT'
| 000052 'SYS1.DSNDB2X.SDSNLOAD'
| 000053 'USER.SYS.LOADLIB'
| 000054 :bl2mlib.'DB2.DSN810.SDSNSPFM'
| 000055 :bl2plib.'DB2.DSN810.SDSNPFPE'
| 000056 'DB2.DSN810.SDSNSPFP'
| 000057 :bl2slib.'DB2.DSN810.SDSNSPFS'
| 000058 :bl2tlib.'DB2.DSN810.SDSNSPFT'
| 000059 :bl2clib.'DB2.DSN810.SDSNCLST.VB'
| 000060 :bl2rlib.'DB2.DSN810.RUNLIB.LOAD'
| 000061
| .
| .
| .
||
| Figure 6. Example of using ISPF Edit to specify DB2 subsystem parameters (Part 1 of 2)
|

50 User's Guide and Reference


| .
| .
| .
| 000062 :nick.* :desc.
| 000063 :aopt.I
| 000064 :adescr.- DB2I DB2 Interactive
| 000065 :aispf.SELECT CMD(%DSNECPRI SSID(DB2X)) NEWAPPL(DSNE) PASSLI
| 000066 :anewat.YES
| 000067 :bopt.C
| 000068 :bdescr.- DB2 Object Comparison Tool
| 000069 :bpan.GOCMENU
| 000070
| 000071 * File created on 9 Jul 2008 00:40:07 by ISTJE
|
|
| Figure 7. Example of using ISPF Edit to specify DB2 subsystem parameters (Part 2 of 2)
|
The sequential data set uses free-form tags and values, which can be written on
one or more lines for each DB2 subsystem. A tag is a name with a value. It must
begin with a colon, and the tag name and its associated value must be separated
by a period. For example: :name.value

The tag value can have any length and any content, but it cannot contain a colon.
The following tag names are recognized by DB2 Admin:
:nick. Name of the DB2 subsystem being described.
:desc. Description to be displayed for this DB2 subsystem.
:secexit.
DB2 security exit type.
:cvtown.
Copy version table owner.
:stcnam.
Started task name of this DB2 subsystem. This tag should be specified only
for a subsystem whose started task name does not follow DB2 conventions.
:grpnam.
DB2 group name of this DB2 subsystem or group. Leave this value blank if
it is not a member of a data sharing group.
:jclass. Job class to be used for batch DB2 utility jobs.
:jsysaff.
SYSAFF job parameter to be used for batch DB2 utility jobs. Specify the
same value that you would specify on a /*JOBPARM S=cccc JECL
statement.
:instparm.
Installation name.
:utilpre.
High-level qualifier (HLQ) or prefix of the data sets that are used in DB2
utility jobs.
:ssid. DB2 subsystem name of the remote DB2 subsystem (blank if local).
:nodenam.
JES node name of the remote DB2 subsystem (blank if local). Specify the
same value that you would specify on either a JES2 /*XMIT or a JES3 //
XMIT DEST=nnnn JECL statement.
:locnam.
DB2 DDF location name of the remote DB2 subsystem (blank if local).

Chapter 2. Activating DB2 Admin 51


Specify the value that is defined in the LOCATION column of the
SYSIBM.LOCATIONS table in your DB2 catalog.
:authsw.
Specify YES to enable the Authorization Switching function for the current
DB2 subsystem. Specify NO to disable Authorization Switching.
:newappl.
The ISPF application ID. NEWAPPL identifies the member name in which
the ISPF profile variables are saved for DB2 Admin. The default value for
NEWAPPL is null with an application ID of ISR. If you use a minus sign
with this parameter, the value set for the :newappl. tag is overridden by
the DB2 Admin default, which is ISR.
:prompt.
The installation default value for Prompt Options. Specify YES or NO.
:resetopt.
The installation default value for the Reset to Default at Startup parameter.
Specify YES or NO.
:nstuproc.
Number of steps in your DNSUPROC. The default is 1.
| :cmown.
| The owner (qualifier) of the Change Management database objects. The
| value that is specified must match the package qualifier in the bind job for
| the Change Management database objects.
| :swssid.
| Allows switch of SSID for DB2 subsystems.
:hpu. Specify YES to enable support for DB2 High Performance Unload (HPU).
Specifying NO disables this support.
:hpullib.
| The data set name for the DB2 High Performance Unload (HPU)
| SINZLINK load library when HPU is enabled. If the :hpu. tag is set to No,
| the :hpullib. tag is ignored. When specifying the HPU load library in the
| :nick. tag, do not specify the HPU SINZLOAD data set, which causes an
| abend because of APF-authorization issues.
| :uexelib.
| The data set names for the REXX user exits used to specify overwrite
| values for masking fields DSSIZE, PRIQTY, SECQTY, DEFER, and DEFINE.

The following DB2 release-specific tags enable you to use DB2 Admin on different
versions of DB2 using the same TSO logon procedure in the same LPAR. The tags
are required when a DB2 subsystem needs libraries that are different from the ones
in the TSO logon procedure and link list. The number of DB2 libraries,
user-defined libraries, and libraries that are specified in the ADBL CLIST must not
exceed 15.
:bl2llib.
DB2 libraries and user-defined libraries.
:bl2rlib.
Run library for DB2 sample program DSNTIAUL.
:bl2mlib.
Message library.

52 User's Guide and Reference


:bl2plib.
Panel library.
:bl2slib.
Skeleton library.
:bl2tlib.
Table library.
:bl2elib.
REXX EXEC library.
:bl2clib.
CLIST library.

The following Main Menu option tags enable you to tailor the Main Menu without
modifying the panel (ADB2). The tags are prefixed with a letter, from a to j, which
indicates the position of the tag on the Main Menu (a is the first option on the
menu).
:aopt. First option that will be displayed on the Main Menu
:adescr.
Description of the option
:aispf. The ISPF statement that DB2 Admin should execute for this option
:apan. The panel that DB2 Admin should display for this option
:asql. The SQL statement that DB2 Admin should execute for this option
:acmd. The DB2 Admin command for this option
:anewat.
Specifies whether this option should start a new DB2 attachment
(YES/NO)
:bopt. Second option that will be displayed on the Main Menu
:b. The parameters for the second option on the Main Menu

Each of the following DB2 Admin environment variables is listed with its tag in
parentheses. Two levels of specifying tag values exist.
v Use the :nick.* indicator to specify tag values that apply to all subsystems. If a
tag is left blank, the DB2 Admin default value is used.
v Specify subsystem-specific values on tags to override the values that are
specified using :nick.*. You can also use the minus sign (-) to indicate that you
want to use the DB2 Admin default values.
DB2 subsystem name (:nick.)
Name of the DB2 subsystem or the group name of a data sharing group.
An entry with an asterisk (*) as its DB2 subsystem name provides the
default values for all of the DB2 subsystem-specific parameters, except for
the DB2 subsystem started task name and group name. No default values
exist for the started task name and group name. The name specified should
be defined only once.
DB2 subsystem description text (:desc.)
A text description should exist for each DB2 subsystem. The text
description is displayed on panel ADB2SYS when a user by default (as
determined from the specifications made on panel ADB2DB2X) has access
to multiple active DB2 subsystems.
DB2 security exit type (:secexit.)
Selecting option 4 on the DB2 Administration Menu panel displays a list of
alternate SQL IDs that a user can use. To create this list, DB2 Admin
invokes or simulates the DB2 connection exit (DSN3@ATH), and requires
information about the type of exit that is installed.

Chapter 2. Activating DB2 Admin 53


The following security exit type value can be specified generally, or it can
be specified for each DB2 subsystem.
STD Standard DB2 security exit (the default). In this case, you have not
installed any DB2 security exit.
SAMPLE
Sample DB2 security exit (logic being simulated). In this case, you
have installed the sample DB2 security exit that is shipped in the
SDSNSAMP data set.
AUTH
Your DB2 security exit, which needs to run as authorized. In this
case, you have written your own DB2 security exit, and it must
execute as APF-authorized.
If you specify AUTH, DB2 Admin calls your DB2 connection exit
from an authorized program in supervisor state, key 7. In this case,
you need to authorize ADB2ATH. Similarly, if you want to run
DB2 utilities from a work statement list or using the Batch Restart
Program (ADBTEP2), you must authorize ADB2UTIL.
OWN Your own DB2 security exit, which can run unauthorized. In this
case, you have written your own DB2 security exit and it does not
require APF authorization.
NOCALL
Specifies that you do not want to call the security exit. To set this
value one time only for use by all DB2 subsystems, select option 1
on the DB2 Admin Customization panel (ADB2CUS0). To specify
different values depending on the DB2 subsystem, select option 2
on the DB2 Admin Customization panel (ADB2CUS0).
If you specify NOCALL, DB2 Admin cannot show the secondary
SQL IDs that a user can use in option 4 of the DB2 Administration
Menu panel.
Copy version control table qualifier (:cvtown.)
DB2 Admin can use a copy of the DB2 subsystem catalog or use the
catalog of a remote DB2 subsystem. The DB2 catalog copy version table,
ADBACTVT, is used to keep track of the copies that are available to users.
The copy version control qualifier is the authorization ID of the owner of
the version control table. To set this value one time only for use by all DB2
subsystems, select option 1 on the DB2 Admin Customization panel
(ADB2CUS0). To specify different values depending on the DB2 subsystem,
select option 2 on the DB2 Admin Customization panel (ADB2CUS0).
System identification method (no tag)
If job parameter SYSAFF is needed for batch utility jobs, you must specify
which method to use to determine the system ID (no programming
interface exists to obtain the system ID). Use one of the following
keywords to specify which method you want DB2 Admin to use:
JESID
Use the JES2 name (valid only on JES2 systems).
SMFID
Use the SMF ID (valid only if SMF is active).
SYSNAME
Use the first 4 bytes of the MVS™ system name in the CVT.

54 User's Guide and Reference


NONE
Do not find the system ID.
name
Use this name for the SYSAFF name on the job parameter.
blank
This is the same as the JESID.
Job parameter SYSAFF for batch DB2 utility jobs (:jsysaff.)
Job parameter SYSAFF ensures that batch DB2 utility jobs are run on the
same operating system as the DB2 subsystem. You can specify SYSAFF
generally or specify it for each DB2 subsystem. Specify requirements for
SYSAFF by using one of the following values:
NONE
Does not generate a SYSAFF parameter on the JOB statement for
utilities. You can use the NONE value if your location has a dedicated
job class for batch DB2 utility jobs.
ANY
Indicates any system in the JES2 multi-access spool configuration.
name
Use this name for the SYSAFF name on the job parameter.
blank
Use the name found by using the system identification method above.
This is the default.
Job class to be used for batch DB2 utility jobs (:jclass.)
The default setting is A. You can specify this value generally or specify it
for each DB2 subsystem.
Unit name for TSO work data sets (no tag)
The default is VIO. You can only specify this value generally.
Unit name for batch data sets (no tag)
The default is SYSDA. You can only specify this value generally.
Installation name (:instparm.)
This parameter is fetched and stored for your use in modified or new DB2
Admin panels. The default is null. You can specify this value generally or
specify it for each DB2 subsystem.
Node name (:nodnam.)
VTAM® node name of the system running the remote DB2 subsystem
(blank if local).
ISPF load libraries (no tag)
Specifies the data set names of your ISPF load libraries. DB2 Admin uses
these data set names when building JCL to run ISPF in batch. You can
specify a maximum of two data set names.
ISPF message library (no tag)
Specifies the data set name of your ISPF message library. DB2 Admin uses
this data set name when building JCL to run ISPF in batch.
ISPF table library (no tag)
Specifies the data set name of your ISPF table library. DB2 Admin uses this
data set name when building JCL to run ISPF in batch.
DB2 Admin APF library (no tag)
If you are enabling Authorization Switching on any DB2 subsystem, you

Chapter 2. Activating DB2 Admin 55


must APF-authorize program ADBTEPA (in the distribution library
SADBLINK). If ADBTEPA is not located in the link list, specify the
APF-authorized data set that contains ADBTEPA for use as a STEPLIB data
set.
| Unicode Translation Technique (no tag)
| An 8-byte field that contains the technique for Unicode translation, where
| xxxxxx is the local screen CCSID (for example, 00037) and yyyyyyyy is the
| technique.
| To find the values you need to specify in the Unicode translation
| technique field on the General Customization Parameters panel
| (ADB2CUS1):
| 1. Find the 3270 emulation CCSID xxxxxx value (037 in this example) on
| the Session Parameters - 3270 Host panel, in the HostCode-Page field.
|
|

|
| Figure 8. Session Parameters - 3270 Host panel
|
| 2. From the MVS log, run /display uni,all . Find 01208-xxxxx
| (01208-00037 in this example) in the /D UNI,ALL output (at the bottom
| of this example). The suffix on the string 01208-00037 provides the
| value (E in this case) you need to specify in panel ADBCUS1.
|

56 User's Guide and Reference


| DISPLAY UNI,ALL
| CUN3000I 12.11.38 UNI DISPLAY 216
| ENVIRONMENT: CREATED 10/01/2009 AT 07.41.34
| MODIFIED 10/01/2009 AT 07.48.28
| IMAGE CREATED --/--/---- AT --.--.--
| SERVICE: CHARACTER CASE NORMALIZATION COLLATION
| STRINGPREP BIDI
| STORAGE: ACTIVE 273 PAGES
| FIXED 0 PAGES
| LIMIT 1280 PAGES
| CASECONV: ENABLED
| CASE VER: UNI300 NORMAL
| NORMALIZE: DISABLED
| NORM VER: NONE
| COLLATE: DISABLED
| COLL RULES: NONE
| STRPROFILES: NONE
| CONVERSION: 00850-01200(13488)-R 01200(13488)-00037-E
| 01200(13488)-00367-E 01047-01200(13488)-R
| 01047-01200(13488)-L 01200(13488)-00500-E
| 01047-01200(13488)-L 01200(13488)-00500-E
| 01200(13488)-00819-E 01200(13488)-00850-E
| 01208-00037-E 01200(13488)-01047-E
|
|
| Figure 9. /D UNI,ALL output
|
| 3. Type the yyyyyyyy value (E) in the Unicode translation technique field
| on the General Customization Parameters panel (ADB2CUS1).
DB2 Started task name (:stcnam.)
Specifies the started task name of the DB2 subsystem. Specify this tag only
for a DB2 subsystem on which the started task name does not follow DB2
conventions. Otherwise, leave it blank. DB2 Admin assumes that the DB2
subsystem is running if the started task name is active.
DB2 Group name (:grpnam.)
Specifies the group name if the DB2 subsystem is a member of a data
sharing group. Otherwise, leave it blank.
DB2 Admin installation allows you to specify a DB2 data sharing group
instead of a specific DB2 subsystem when invoking DB2 Admin. To
support group connect, use the :grpnam. tag on the ISPF Edit session of
the DB2 Subsystem Parameters panel to specify the name of the group to
which this DB2 subsystem belongs. If this DB2 subsystem is not a member
of any group, leave :grpnam. blank.
For group connect, specify :grpnam. for each of the members of the group
and create an entry for the group itself with the name specified on the DB2
subsystem name tag. For this entry, specify the group name for both the
DB2 subsystem name and DB2 group name tags. If the group name is
selected when invoking DB2 Admin, the libraries specified for the group
entry are used.
When migrating from one release of DB2 to another, and the group
members belong to different releases, select a specific DB2 subsystem and
not the group. If a group name is used under these circumstances, the
libraries used might not match the DB2 subsystem selected by the group
connect.
DB2 Utility data set prefix (:utilpre.)
High-level qualifier (HLQ) or prefix of the data sets used in DB2 utility
jobs. Special values are:
USERID
TSO user ID. This is the default value.

Chapter 2. Activating DB2 Admin 57


OWNER
The owner of the object.
CREATEDBY
The creator of the object.
name
Any high-level qualifier.
Remote DB2 subsystem name (:ssid.)
DB2 subsystem name of the remote DB2 subsystem (blank if local). This
name is used when generating batch jobs that are run on a remote DB2
subsystem.
Remote DB2 Location name (:locnam.)
DB2 DDF location name of the remote DB2 subsystem (blank if local). This
name is used when connecting to a remote DB2 subsystem to locate
information about that subsystem and for generating batch jobs that are
run on that subsystem.
Authorization Switching enabled (:authsw.)
Specify Yes to enable DB2 Admin Authorization Switching for the current
DB2 subsystem. Specifying No disables Authorization Switching. The
default is No.
ISPF Application ID (:newappl.)
The ISPF application ID. NEWAPPL identifies the member name in which
the ISPF profile variables are saved for DB2 Admin. The default value for
NEWAPPL is null with an application ID of ISR. Values that are saved in
ISPF profile variables when using one value for NEWAPPL are not
available after switching to a different value for NEWAPPL.
If you have specified values under one NEWAPPL profile and want to use
this profile to initialize another profile, you can create a new profile by
copying the original profile. Profile variables are saved in the user ISPF
profile data set. The naming convention for members of the ISPF profile
data set is the value that is specified in the NEWAPPL tag, followed by
PROF. For example, the member name for :newappl.ADB is ADBPROF.
DB2 Admin saves the user-specified values for PROMPT (ON/OFF) in the
ISPF PROFILE data set. When using more than one ISPF PROFILE
member, it is possible for a user to set PROMPT ON while using one
profile, and then set PROMPT OFF in a different profile. This can cause
problems when, for example, a user issues a DROP command and expects
the prompt to be on, but because the new profile sets prompt off, the
object is dropped without first displaying the prompt panel.
DB2 High Performance Unload enabled (:hpu.)
Specify Yes to enable DB2 Admin to support DB2 High Performance
Unload for the current DB2 subsystem. Specifying No disables support for
DB2 High Performance Unload. The default is No.
DB2 High Performance Unload load library (:hpullib.)
The data set name of the DB2 High Performance Unload load library. This
tag is ignored if DB2 High Performance Unload is disabled. The default is
null.
Default values for Prompt Options (:prompt.)
The installation default values for each of the five prompt options. Specify
Yes to set the installation default values to Yes. Specify No to set them to
No. The default is No.

58 User's Guide and Reference


DB2 Admin Tool saves user-specified values for the prompt options in the
ISPF PROFILE data set. If all five prompt option values for the user in the
current ISPF PROFILE data set are null during DB2 Admin initialization,
the five option values are set to the installation default.
Default value for the Reset to Default at Startup parameter (:resetopt.)
The installation default value for the Reset to Default at Startup parameter.
Specify Yes to set the installation default value to Yes. Specify No to set it to
No. The default is Yes.
DB2 Admin saves user-specified values for the Reset to Default at Startup
parameter in the ISPF PROFILE data set. If the value of the parameter for
the user in the current ISPF PROFILE data set is null during DB2 Admin
initialization, the value of the parameter is set to the installation default.
| DB2 load library (:bl2llib.)
| Load module libraries for DB2 programs (for example, DSN commands).
| Usually, the following two data set names must be specified for this
| parameter (and other appropriate DSN commands can follow):
| v A data set name for the SDSNEXIT library
| v A data set name for the DSNLOAD library
| The following example shows how the two data set names and other
| libraries are specified:
| :nick.V91A :desc.(V91A SUBSYSTEM)
| :ssid.V91A
| :nodenam.STLVM27
| :locnam.STLEC1
| :authsw.YES
| :cmown.SYSADM
| :hpu.YES
| :hpullib.'DB2TOOL.HPU310.SINZLINK'
| :bl2llib.'DB2A.SDSNEXIT'
| 'DB2A.SDSNLOAD'
| 'USER.RUNLIB.LOAD'
| 'USER.TESTLIB'
| 'DB2A.TESTLIB'
| 'DB2A.SDSNLOAD'
| :bl2rlib.'DB2A.TESTLIB'
| :aopt.I
| :adescr.DB2I
| :aispf.SELECT CMD(%DSNECPRI SSID(&DB2SYS)) NEWAPPL(DSNE) PAS
| A default value does not exist for this tag. If you do not specify a value,
| DB2 Admin uses the standard operating system search for DB2 modules.
| When generating utility jobs that use the DB2-supplied JCL procedure
| DSNUPROC, DB2 Admin sets the symbolic parameter LIB to the second
| library that is specified on this tag.
| If you have modified the DSNUPROC JCL procedure such that LIB is no
| longer a valid parameter, you must omit this tag. In addition, DB2 must be
| installed so that the DSNUPROC JCL procedure and TSO users can execute
| DB2.
DB2 run library (:bl2rlib.)
Run library for DB2 sample programs (for example, DSNTIAUL and
DSNTIAD).
The following example shows how this variable is used:
:bl2rlib.'SYS1.DSN.RUNLIB.LOAD'.

Chapter 2. Activating DB2 Admin 59


A default value does not exist for this tag. If you do not specify a value,
DB2 Admin uses the library that is specified in the ISPF skeleton (member
ADB2UTU in SADBSLIB).
DB2 message library (:bl2mlib.)
Message library. Used for invoking DB2 SPUFI.
DB2 panel library (:bl2plib.)
Panel library. Used for invoking DB2 SPUFI.
DB2 skeleton library (:bl2slib.)
Skeleton Library. Used for invoking DB2 SPUFI.
DB2 table library (:bl2tlib.)
Table library. Used for invoking DB2 SPUFI.
DB2 REXX exec library (:bl2elib.)
REXX EXEC library. Used for invoking DB2 SPUFI.
DB2 clist library (:bl2clib.)
CLIST library. Used for invoking DB2 SPUFI.
JES3 (no tag)
Enables you to use distributed support.

Copy Customization Parameters panel

The Copy Customization Parameters panel is displayed, as shown in the following


figure, when you select option 3. On this panel, you can specify whether general
customization parameters and DB2 subsystem customization parameters are to be
copied from another installation of DB2 Admin.

| DB2 Admin --------------- Customization - Copy Parameters -------------- 00:37


|
| Copy DB2 Admin customization parameters
| To : ISPF table library : 'ADB.V720.SADBTLIB'
| From : ISPF table library ==> 'ADB.V710.SADBTLIB'
|
| Replace general parameters ==> NO (Yes/No)
| Replace DB2 Subsys parameters ==> NO (Yes/No)
||
| Figure 10. Copy Customization Parameters panel (ADB2CUS3)
|
Related concepts
“Step 8. Customize the ISPF environment” on page 44
Related tasks
“Step 14. Create a catalog copy version table” on page 68

Step 9. Tailor the Main Menu and DB2 Selection Menu


You can add DB2 tools that you want to invoke from the Main Menu, and if you
are using multiple DB2 subsystems, you can hide the DB2 subsystems that you do
not want to display.

Two main panels are provided for you to tailor. The following table shows a
summary of what you can tailor.

60 User's Guide and Reference


Table 5. Main panels that you can tailor.
Panel name: Purpose: What you can tailor:
ADB2 Main Menu You can add additional DB2 tools to be
invoked from the Main Menu.
ADB2DB2X Controls display of Users with multiple DB2 subsystems can hide
all active DB2 those DB2 subsystems that they do not want
subsystems displayed.

An SMP/E usermod is used to tailor these two panels. The source for the usermod
is provided in member ADBU001 in the SADBSAMP library.

Step 9(a). Specify additional DB2 tools on the Main Menu


The lower portion of the DB2 Administration Menu panel ADB2 can invoke other
DB2 tools.

You can add DB2 tools (for example, IBM QMF™ and IBM DB2 Performance
Monitor) by modifying the Main Menu panel or by using the customization EXEC
ADB2CUST. If you simply want to add DB2 tools to the menu, do so by using the
ADB2CUST EXEC. If you want to make other changes to the menu, do so by using
an SMP/E usermod.

For example, to add a new DB2 product to the DB2 Administration Menu panel,
modify the set of variables &B, &BOPT, &BDESCR, &BISPF, &BPAN, &BSQL,
&BCMD, and &BNEWAT.

The following figure shows an example of how the Main Menu can appear.

| DB2 Admin -------------- DB2 Administration Menu 7.2.0 ------------------ 01:03


| Option ===>
|
| 1 - DB2 system catalog DB2 System: DB2X
| 2 - Execute SQL statements DB2 SQL ID: ISTJE
| 3 - DB2 performance queries Userid : ISTJE
| 4 - Change current SQL ID DB2 Rel : 810
| 5 - Utility generation using LISTDEFs and TEMPLATEs
| P - Change DB2 Admin parameters
| DD - Distributed DB2 systems
| E - Explain
| Z - DB2 system administration
| SM - Space management functions
| W - Manage work statement lists
| X - Exit DB2 Admin
| CC - DB2 catalog copy version maintenance
| CM - Change management
|
| Interface to other DB2 products and offerings:
| I - DB2I DB2 Interactive
| C - DB2 Object Comparison Tool
||
| Figure 11. DB2 Administration Main Menu panel (ADB2)
|
Step 9(b). Specify DB2 subsystems on the DB2 Selection
Menu
If your site has multiple DB2 subsystems you can tailor panel ADB2DB2X to mask
DB2 subsystems that they do not want to display.

Chapter 2. Activating DB2 Admin 61


If your site has only one DB2 subsystem, panel ADB2DB2X does not require
tailoring. DB2 Admin skips panel ADB2DB2X and displays the main DB2 Admin
panel when starting a DB2 Admin session.

The following variables are available in panel ADB2DB2X. Except for DB2ADB2N,
you can modify these variables to match your site naming standards:
DB2ADB2N
Number of active DB2 subsystems.
DB2ADB2S
DB2 subsystem names that are valid for the user. This variable is initialized
to the DB2 subsystems that are active. If more than one default DB2
subsystem is active for the user, this variable should be set to the DB2
subsystems that the user requires.
DB2ADEFS
Default DB2 subsystems for the user. This variable should be set to the
default DB2 subsystem that the user enters. If only one of these DB2
subsystems is active, it is automatically selected. Otherwise, the DB2
subsystems in DB2ADB2S are displayed to the user.

This tailoring step does not prevent users from using the SYS(nnn) keyword on the
ADBL CLIST to access other DB2 subsystems. Panel ADB2DB2X is only a
productivity aid; not a security definition.

62 User's Guide and Reference


)attr
/* Database 2 Administration Tool. */
/* 5655-E64 (C) Copyright IBM Corporation 1995, 2001. */
/* All rights reserved. Licensed materials - property of IBM. */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP schedule contract with IBM Corp. */
/* */
/* Change Activities: */
/* APAR PQ49419 */
/* */
/* */
' type(text) color(&ichco) hilite(&ichhi) /*Headlines
? type(output) color(&ichco) hilite(&ichhi) /*Headlines
; type(text) color(&iccco) hilite(&icchi) /*Command text
¬ type(text) color(&icfco) hilite(&icfhi) attn(on) /*Selection parameter
| type(input) color(&icico) hilite(&icihi) /*Function/command input
¢ type(output) color(&iceco) hilite(&icehi) caps(off) /*Error messages etc.
+ type(text) color(&icnco) hilite(&icnhi) /*Normal text
% type(text) color(&icsco) hilite(&icshi) /*Emphasized text
_ type(input) color(&icico) hilite(&icihi) caps(on) /*Normal input field
\ type(output) color(&icoco) hilite(&icohi) caps(off) /*Normal output field
.
.
.

.
.
.
)body cmd(zcmd) expand(!!) smsg(emsg) lmsg(emsg)
'&adb2name !-! &adb2name DB2 Subsystem Selection Exit Panel !-!
;Command ===>|zcmd ! !+
¢emsg
+
% This panel is only shown in DEBUG mode
+
+ DB2 systems: _db2adb2n

+ DB2 names : _db2adb2s

+ User : _user
)INIT
VGET (ZVERB) SHARED
IF (&ZVERB=RETURN)
&DB2ADB2S = NONE
.RESP=END
IF (.RESP=&Z)
IF (&DEBUG¬=DEBUG)
.resp = ENTER
&user=&zuser
&DB2ADEFS = &DB2ADB2S
)PROC
if (&DB2AINST=DKIBMX) /* For installation DKIBM */
&uu = Trunc(&user,2) /* uu=user prefix (2 char)*/
&sf = .trail
if (&uu=CC) /* CC user ? */
&DB2ADB2S = 'DB2T DB2X DB2P DB2M DB2D DB2W'
&DB2ADEFS = 'DB2T DB2X DB2P'
if (&uu=IS) /* IS user ? */
&DB2ADB2S = 'DB2T DB2X DB2P DB2M'
&DB2ADEFS = 'DB2T DB2X DB2P'
if (&user=ISTJE,ISTJE2,ISTFL,ISTFL2,ISOKN,DPCHR,DPGROTH)
&DB2ADB2S = 'DB2T DB2X DB2P DB2M DB2D DB2W'
&DB2ADEFS = 'DB2T DB2X DB2P DB2M DB2D DB2W'
if (&uu=DK) /* DK user ? */
&u3=trunc(&sf,3)
if (&u3=BAL,NYK) /* DKBAL or DKNYK user ? */
&DB2ADB2S = 'DB2D'
else /* Normal DK user */
&DB2ADB2S = 'DB2T DB2X DB2P DB2M'
&DB2ADEFS = 'DB2T DB2X DB2P'
if (&uu=DP) /* DP user ? */
&u2=trunc(&sf,2)
if (&u2=EC) /* DPEC user ? */
&DB2ADB2S = 'DB2M'
else /* Normal DP user */
&DB2ADB2S = 'DB2M'
if (&uu=DC) /* DC user ? */
&DB2ADB2S = 'DB2M'
)END

Figure 12. Source code for panel ADB2DB2X


Chapter 2. Activating DB2 Admin 63
Step 9(c). Submit jobs to tailor menus
The SMP/E JCL to receive and apply usermod ADBU001 is provided in member
ADBU001 in the SADBSAMP library.

You need to modify this JCL to match your site naming standards.

Step 10. Customize the ADB2UCUS


DB2 Admin provides you with the ability to align the product with your local data
set and utility ID (UID) naming conventions.

To do so, modify the ADB2UCUS skeleton, which resides in the ISPSLIB library.
When you subsequently run SMP/E to receive and apply SMP/E usermod
ADBU002, the updated ISPF JCL skeletons will be added to the SADBSLIB library.

The following variables are some of the variables that are available for use (see
skeleton member ADB2UCUT for a complete list):
Variable:
Description:
&AJDATE
Julian date (YYDDD)
&AJDAY
Julian day (DDD)
&AYEAR4
4-digit year (YYYY)
&AGDATE
Gregorian date (YYMMDD)
&ANMON
Numeric month (MM)
&ADAY
Day (DD)
&AYEAR
2-digit year (YY)
&ACMON
3-character month (XXX)
&ATIME
Time (HHMMSS)
&ATIME7
Time with tenths of seconds (HHMMSST)
&ATIME4
Time without seconds (HHMM)
&AHOUR
Hour (HH)
&AMIN
Minute (MM)

64 User's Guide and Reference


&ASEC
Seconds (SS)

All lines that might require tailoring are preceded by SET statements (indicated by
)SET).

Example: This example demonstrates several different types of data set naming
changes using the variable ASYCPY1:

The variable ASYCPY1 is shipped as:


)SET ASYCPY1 = &PREFIX..&DB2SYS..IC.&DBNAME..&NAME(+1)

To change the high-level qualifier from the current TSO PREFIX to MYHLQ, specify:
)SET ASYCPY1 = MYHLQ.&DB2SYS..IC.&DBNAME..&NAME(+1) /* CHANGE HLQ TO FIXED STRING

To change the second-level qualifier from the DB2 subsystem ID to TEST, specify:
)SET ASYCPY1 = &PREFIX..TEST.IC.&DBNAME..&NAME(+1) /* CHANGE SUBSYSTEM TO 'TEST'

To insert a high-level qualifier of MYHLQ in front of the current TSO PREFIX and to
remove the DB2 database name, specify:
)SET ASYCPY1 = MYHLQ.&PREFIX..&DB2SYS..IC.&NAME(+1)
/* CHANGE HLQ TO FIXED STRING,
/* INCLUDE PREFIX, REMOVE DBNAME

To use sequential data sets rather than a GDG data set, specify a data set name
that contains date and time values to generate unique data set names:
)SET ASYCPY1 = &PREFIX..IC.&DBNAME..&NAME..D&AJDATE..T&ATIME

Example: This example demonstrates several different types of utility ID (UID)


naming changes using the variables PREFXUID, LOADUID, and UNLODUID.

The variables PREFXUID, LOADUID, and UNLODUID are shipped as:


)SET PREFXUID = &Z
)SET LOADUID = &PREFXUID
)SET UNLODUID = &PREFXUID

To change the LOAD and UNLOAD UIDs such that they contain the TSO user ID,
a time stamp, and a utility type identifier, specify:
)SET PREFXUID = &ZUSER.&ATIME
)SET LOADUID = &PREFXUID.LD
)SET UNLODUID = &PREFXUID.UL

This setup sets the value of LOADUID to &ZUSER.&ATIME.LD and UNLODUID to


&ZUSER.&ATIME.UL. So, if the user ID is 'JOE' and the JCL for the LOAD utility is
generated at time '095344', the UID in the JCL for the LOAD utility is set to
'JOE095344LD'.

The maximum size of &ZUSER is 8 bytes, the size of &ATIME (HHMMSS) is 6


bytes, and the size of the literal is 2 bytes. The total maximum size is 16 bytes,
which is the maximum UID size.

To change the LOAD and UNLOAD UIDs such that they contain the TSO user ID
and a time stamp with tenths of seconds (USERID.HHMMSST), specify:
)SET PREFXUID = &ZUSER..&ATIME7
)SET LOADUID = &PREFXUID
)SET UNLODUID = &PREFXUID

Chapter 2. Activating DB2 Admin 65


This setup sets the value of LOADUID and UNLODUID to &ZUSER..&ATIME7. So, if
the user ID is 'JOE' and the JCL for the LOAD utility is generated at time '0953446',
the UID in the JCL for the LOAD utility is set to 'JOE.0953446'.

The maximum size of &ZUSER is 8 bytes, the size of a period is 1 byte, and the
size of the &TIME7 (HHMMSST) is 7 bytes. The total maximum size is 16 bytes,
which is the maximum UID size.

Restrictions:
v When modifying data set names, be sure that no data set names run beyond
column 71 in the ADB2UCUS data set. Any characters beyond column 71 are
truncated.
v Data set names, including the periods, cannot be greater than 44 bytes in length.
Be sure that generated data set names are not longer than 44 bytes.
v Utility IDs (UIDs), including the periods, cannot be greater than 16 bytes in
length. Be sure that generated UIDs are not longer than 16 bytes.
v Utility ID (UID) customization does not apply to UIDs in work statement lists
(WSL).

For testing purposes, copy the ADB2UCUS skeleton to a private skeleton library
and make your changes. This private skeleton library must first be allocated in the
ISPSLIB concatenation (using the USERADD parameter of the ADBL CLIST).

After testing is complete, you can use an SMP/E USERMOD to update the DB2
Administration Tool product libraries. A sample SMP/E USERMOD is provided in
member ADBU002 in the SADBSAMP library. Instructions for completing this step
are provided in sample job ADBU002.
Related concepts
“Running WSL with the utility template for LOBs” on page 329

Step 11. Tailor the DB2 Admin Launchpad


The DB2 Admin Launchpad enables you to launch all installed IBM DB2 tools that
have an ISPF interface directly from a centralized panel.

To tailor the DB2 Admin Launchpad, run the ADBL CLIST with the DMT option,
which creates the Launchpad table.

| Be sure to update SYS1.PARMLIB to authorize the ADB2ATH and ADB2UTIL


| programs and the ADB2ATH and ADB2UTIL TSO commands. Copy authorized
| programs ADB2ATH and ADB2UTIL from your high-level.SADBLINK to an
| APF-authorized library OR an APF-authorized library in the system link list.

| Note: This APF-authorized library must either be in the system link list, or must
| be registered as the "DB2 Admin APF Library" on customization panel
| ADB2CUS1.

If you intend to use DB2 High Performance Unload (HPU) within work statement
lists, the INZUTILB program must be authorized in a similar manner and should
reside in an APF-authorized library in the system link list.

| Before using HPU within a work statement list, be sure to enable HPU. The main
| HPU program (INZUTILB) needs to be authorized in the IKJTSOnn member of
| PARMLIB.

66 User's Guide and Reference


Related concepts
“Invoking HPU within a work statement list” on page 332
Related information
Chapter 3, “Using the DB2 Admin Launchpad,” on page 77

Step 12. Update the APF Authorization table


You must update SYS1.PARMLIB to authorize the ADB2ATH and ADB2UTIL
programs and the ADB2ATH and ADB2UTIL TSO commands.

| Copy authorized programs ADB2ATH and ADB2UTIL from high-level.SADBLINK


| to an APF-authorized library OR an APF-authorized library in the system link list

| Note: This APF-authorized library must either be in the system link list, or must
| be registered as the "DB2 Admin APF Library" on customization panel
| ADB2CUS1.
| The TSO service facility must invoke ADB2ATH and ADB2UTIL as authorized
| programs. Modify SYS1.PARMLIB(IKJTSOxx) and add programs ADB2ATH and
| ADB2UTIL, as shown in the following figure. Adding ADB2ATH and ADB2UTIL
| to SYS1.PARMLIB (IKJTSOxx) will allow the TSO service facility to invoke them as
| authorized.

The ADB2ATH program is used when the DB2 security exit type (:secexit.) is
specified as AUTH. The ADB2UTIL program is used when ADBTEP2 runs DB2
utilities.

AUTHPGM NAMES( /* AUTHORIZED PROGRAMS */ +


........ +
ADB2ATH /* CALLS DSN3@ATH */ +
ADB2UTIL /* CALLS DSNUTILB */ +
........) /* */ +
AUTHTSF NAMES( /* PROGRAMS TO BE AUTHORIZED */ +
/* WHEN CALLED THROUGH THE TSO */ +
/* SERVICE FACILITY. */ +
........ /* */ +
ADB2ATH /* CALLS DSN3@ATH */ +
ADB2UTIL /* CALLS DSNUTILB */ +
........) /* */

Figure 13. Adding programs ADB2ATH and ADB2UTIL

Activate the changes immediately or at the next IPL by issuing the following
TSO/E command:

PARMLIB UPDATE(xx)

Before using HPU within a work statement list, be sure to enable HPU. The main
HPU program (INZUTILB) needs to be authorized in the IKJTSOnn member of
PARMLIB.

Using two different versions of DB2 Admin on the same DB2


subsystem

If you are installing and running two or more different releases of DB2 Admin on
the same DB2 subsystem, ensure that you use the ADB2ATH and ADB2UTIL
authorized programs from the product tape for the higher release when you copy
Chapter 2. Activating DB2 Admin 67
them to the APF-authorized library in your system link list.
Related concepts
“Step 8. Customize the ISPF environment” on page 44
“Invoking HPU within a work statement list” on page 332

| Step 13. Prepare to run a work statement online


| A work statement list (WSL) can be run either in batch or online.

| A WSL that invokes a DB2 command or a DB2 utility can be run online only if the
| DB2 libraries are set up properly. If the DB2 load library data set does not reside in
| the system LINKLIST, the data set must be added to the STEPLIB of the TSO logon
| procedure. A WSL that invokes a HPU utility can be run online only if the HPU
| libraries are set up properly. If the HPU load library data set does not reside in the
| system LINKLIST, the data set must be added to the STEPLIB of the TSO logon
| procedure.

| Important: Ensure that all of the data sets in the STEBLIB are APF-authorized;
| otherwise, the entire STEBLIB is not considered to be APF-authorized,
| and the utility jobs will fail.

Step 14. Create a catalog copy version table


The catalog copy version table, ADBCATVT, is required when you use one of the
multiple copies of the DB2 system catalog — or the catalog of a remote site —
when selecting any of the options on the System Catalog panel (ADB21).

This table is used to keep track of which DB2 copies are available for use.

If you do not require a copy of the DB2 system catalog or a DB2 catalog of a
remote site, you can ignore this step. Also, you can perform this step later if you
determine that you require a copy of the DB2 system catalog or a remote catalog.

To prepare for running with multiple copies of the DB2 catalog:


1. Execute the ADB2CUST EXEC to specify the default qualifier for the catalog
copy version table. This default value is entered on the Customization —
General Parameters panel. Specify this value only if all of the DB2 subsystems
on this system support the multiple copy option. Otherwise, leave it blank.
You can override the copy version table qualifier for each subsystem by
entering a different catalog copy version table owner (for the tag name
:cvtown.) when you edit the DB2 subsystem parameters..
2. If you are using copies of the DB2 catalog, you must enable catalog copy only
for subsystems that use catalog copy.
a. Locate the member ADBCATVT in the sample library, SADBSAMP and
replace the default owner name (ADB). The name of the table itself,
ADBCATVT, cannot be changed.
b. Submit the job to create your catalog copy version table, ADBCATVT.
c. Start DB2 Admin. A new option, CC — DB2 catalog copy version
maintenance, is added to the Administration Menu panel.
3. Add entries into the ADBCATVT table.

68 User's Guide and Reference


Related concepts
“Step 8(b). Supplying information about the customization panels” on page 47
Chapter 23, “Using copies of the DB2 catalog,” on page 533
Related tasks
“Adding entries to the catalog copy version table” on page 534
“Using previously defined multiple copies of the DB2 catalog” on page 537
Related reference
“The System Catalog panel” on page 546

Step 15. Create views for your own objects in the catalog
To create views that allow the creators to update the RUNSTATS information of
their own objects in the catalog, submit job ADBRUNSV in SADBSAMP.

Step 16. Grant SELECT access on catalog tables


DB2 Admin uses dynamic SQL against the catalog.

If you plan to make DB2 Admin available to a large number of users, you might
want to grant SELECT on the catalog to PUBLIC AT ALL LOCATIONS, or specify
those IDs that are authorized to see the catalog. To complete this step, run sample
job ADBGC, which is located in SADBSAMP.

Step 17. Define Reverse Engineering stored procedure for CC/390


To use Reverse Engineering from additional software products, such as Control
Center for OS/390 (CC/390), define the Reverse Engineering stored procedure
ADB2RE and the required temporary tables.

You must also bind the package for the stored procedure on each DB2 subsystem
that will use this facility.

To bind the package for the stored procedure:


1. Run job ADBREST that is located in SADBSAMP. This job will create the
temporary tables and bind the package on each DB2 subsystem that will use
the facility.
2. Copy load module members ADB2RE and ADB2LM from the SADBLLIB load
library to one of the libraries defined as STEPLIB in the Work Load Manager
(WLM)-managed stored procedure address space.

The ADB2RE stored procedure dynamically allocates output data sets, as specified
by the CC/390 user. This requires the stored procedure to be defined with
EXTERNAL SECURITY USER. Procedures with this security parameter cannot run
in the non-WLM-managed stored procedure address space (ssidSPAS), but must
run in a WLM-managed stored procedure address space.

Step 18. Create additional DB2 catalog indexes


You can create DB2 catalog indexes on tables that don't have indexes.

The following DB2 catalog tables don't have indexes:


v SYSIBM.SYSDBRM
v SYSIBM.SYSSTMT

Chapter 2. Activating DB2 Admin 69


v SYSIBM.SYSFIELDS
v SYSIBM.SYSFOREIGNKEYS
v SYSIBM.SYSRELS

To create indexes on these tables:

| Run sample job ADBCX to create indexes on these tables. ADBCX is located in the
| SADBSAMP library. ADBCX also contains the recommended DB2 catalog indexes
| for improving the performance of the Reverse Engineering functions (GEN).
Related concepts
“Other recommendations for a large number of objects” on page 630
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Step 19. Optimize DSNWZP and DSNZPARM settings


DB2 Admin Reverse Engineering uses the DSNWZP stored procedure to read
values from DSNZPARM.

If DSNWZP does not complete normally, Reverse Engineering waits until


DSNWZP times out. In this case, the GEN or DDL commands might run longer
than necessary as a result of DB2 waiting for the timeout value for stored
procedures to be reached.

To optimize performance, verify that the DSNWZP stored procedure is operational


and that the DSNZPARM STORTIME(DSN6SYSP) parameter is set at a proper
level. You might want to lower the value of the DSNZPARM
STORTIME(DSN6SYSP) parameter.

Step 20. Run the RUNSTATS utility


DB2 Admin makes extensive use of the DB2 catalog.

It is recommended that you run the RUNSTATS utility on the DB2 catalog to
optimize performance.
Related concepts
“Other recommendations for a large number of objects” on page 630
Related information
IBM Publications Center

Step 21. Define your own line commands


You can define your own DB2 Admin line commands for each panel.

You might want to define commands that do the following actions:


v Start another ISPF-based tool with parameters from the current row
v Display the contents of related tables
v Change the contents of the displayed row by using an SQL statement

When encountering an unknown line command, DB2 Admin attempts to open an


ISPF DB2 Admin line commands table with the same name as the panel that is
being displayed. If the table is found, DB2 Admin opens it and searches for the
definition of the line command. If the line command is found, it is run.

70 User's Guide and Reference


Tip: The Tables, Views, and Aliases panel (ADB21T) can display multiple object
types. The name of the line command table that is used for this panel
depends on the object type that the line command is issued against. If you
define your own line commands for panel ADB21T, be sure to read the
comments in the EXEC about the different style that is used to defined the
ISPF table.

Contents of the line command table

The DB2 Admin line command table contains the following columns:
CMD The line command. The line command must be the key in the table.
DESCR
A description of the line command. This description is displayed if you
enter a question mark (?) to request further information.
SQL The SQL statement that is run for this line command.
PAN The panel to be displayed as a result of this line command.
ISPF The ISPF statement that is run for this line command.
ACMD
The DB2 Admin command that is run for this line command.

Creating a line command table

Create a line command table by writing a small REXX EXEC that defines the ISPF
table. A sample REXX EXEC, ADB21D REXX, is provided in the SADBEXEC
library. This EXEC provides a description of all possible line commands for DB2
Admin option 1.D (panel ADB21D). It also defines four sample user-defined
commands (USERI, USERS, USERC, and USERP). You can refer to this sample REXX
EXEC when writing your own EXEC.

Some EXEC parts (such as ADB21T) use a different style to define the ISPF table
than the style that is used in ADB21D EXEC. Be sure to read any comments in the
EXEC in case the style that is used is different from the ADB21D sample REXX
EXEC.
Related concepts
“Line commands” on page 88
“The application development process” on page 526
Related reference
“DB2 Admin line commands” on page 617

Step 22. Tailor DB2 Admin Authorization Switching


DB2 Admin Authorization Switching is a facility within DB2 Admin to run DDL
under the authority of another user.

This other user is called the auth-switch ID, and the ID that submits the job is
called the submitter.

Two DB2 Admin functions, Alter Tablespace RDEF and Alter Table ALC, make use
of authorization switching. These functions allow table spaces and tables to be
redefined, which requires that they, and any dependent objects, be dropped and
re-created. However, the job submitter might not have the necessary authority to
rebuild all the objects and authorizations. Authorization switching allows the job
submitter to use an ID that does have the authority to run the DDL to rebuild the
objects.

Chapter 2. Activating DB2 Admin 71


Before DB2 Admin Authorization Switching can be used, some additional
installation steps must be performed to enable and protect it.

To complete the installation of DB2 Admin Authorization Switching:


1. Ensure that all requirements for using this facility or for OS/390 RRS services
are met to use Authorization Switching. These requirements must be met
because DB2 Admin Authorization Switching uses the DB2 RRS Attach Facility.
2. Place the ADBTEPA program in an APF-authorized library or link list.
3. Run the ADB2CUST EXEC.
v If ADBTEPA is not in the link list, specify the DB2 Admin APF Library
(SADBLINK) using option 1 on the General parameters for DB2 Admin
panel.
v Enable DB2 Admin Authorization Switching for the desired subsystems
using option 2 on the DB2 Subsystem Parameters for DB2 Admin panel.
– Add the :authsw. tag to the desired subsystems section.
– Provide the YES value on the tag, as shown in the following example:
:authsw.YES.
4. Create RACF profiles or equivalent (as required) to protect the facility.

| Tip: When DB2 Admin Authorization Switching is enabled for a DB2


| subsystem, create a RACF profile to protect the facility from unauthorized
| use. When DDL that is enabled with DB2 Admin Authorization Switching
| capability is run, a RACF access check is made to a resource that is
| intended to protect the use of a given Authorization Switching ID on the
| DB2 subsystem. The resource is within the IBM-supplied RACF FACILITY
| class in the following form:
| ADBAUTHS.<ssid>.<auth-switch-id>

If the DB2 subsystem is DSN and the desired authorization ID to use is


SYSADMZ1, the RACF resource name that DB2 Admin generates is:
FACILITY ADBAUTHS.DSN.SYSADMZ1

| For DB2 Admin Authorization Switching to proceed, the job submitter requires
| READ authority to the profile that protects this resource. The standard RACF
| profile rules apply for this resource. An installation can use general or more
| granular profile controls, as listed in the following table.
Table 6. Controlling the granularity of profiles.
Granularity Example
A single profile that protects all FACILITY ADBAUTHS.*
subsystem/user ID combinations
A more granular profile FACILITY ADBAUTHS.DSN.*
The finest degree of control FACILITY ADBAUTHS.DSN.SYSADMZ1

If the FACILITY class is a RACLIST profile, the profiles must be refreshed after
each change using the RACF SETROPTS command.

Restriction: DB2 Admin Authorization Switching requires that the RRS Attach
Facility (RRSAF) of DB2 for OS/390 and z/OS is available.

72 User's Guide and Reference


Related concepts
“Step 8. Customize the ISPF environment” on page 44
“Overview of ADBTEPA” on page 350
“Using authorization switching” on page 287
“Step 8(a). Run the customization EXEC” on page 46
“Using ADBTEPA” on page 351

Step 23. Verify installation of additional functionality


You can verify that DB2 Admin is available with additional functionality.
1. On the DB2 Admin Main Menu, select option 1 to go to the DB2 System
Catalog.
2. Specify option T to go to the Tables, Views, and Aliases panel.
3. Specify SYSDUMMY1 for the name and specify SYSIBM for the owner.
4. Verify that DB2 Admin can retrieve rows from the DB2 catalog. A row that
describes the table SYSDUMMY1 owned by user SYSIBM is displayed.
5. Use the GEN line command on the row for SYSDUMMY1. The Generate SQL
from DB2 Catalog panel is displayed, as shown in the following figure.

DB2 Admin -------------- DB2X Generate SQL from DB2 catalog ------------- 15:52
Option ===>

Generate SQL statements for table SYSIBM.SYSDUMMY1 DB2 System: DB2X


DB2 SQL ID: ISTJE
More: +
SQL statement types to be generated from the DB2 catalog:

CREATE TABLE . . . . . . : Y (Y,N) GRANT access ON TABLE. . . : Y (Y,N)


CREATE VIEW. . . . . . . : Y (Y,N,D) GRANT access ON VIEW . . . : Y (Y,N)
CREATE INDEX . . . . . . : Y (Y,N) ALTER TABLE ADD FOREIGN KEY: Y (Y,N,D)
CREATE SYNONYM . . . . . : Y (Y,N) LABEL ON . . . . . . . . . : Y (Y,N)
CREATE ALIAS . . . . . . : Y (Y,N) COMMENT ON . . . . . . . . : Y (Y,N)
CREATE TRIGGER . . . . . : Y (Y,N,D) REBIND PLAN/PACKAGE. . . . : Y (Y,N,D)
CREATE STORAGE GROUP . . : N (Y,N) GRANT use OF STORAGE GROUP : N (Y,N)

New names/values for generated SQL: (leave blank to use current values)
Object owner. . . . . : > Run SQLID. . . . . . . . . :
Object grantor. . . . : >
Alloc TS size as. . . : DEFINED (DEFINED, USED, or ALLOC)
Database name . . . . :
Storage group for TS. : > Storage group for IX . . . : >
Target DB2 version. . : (Current DB2 version: 815)
Use Masking . . . . . : NO (Yes/No)
Generate catalog stats: NO (Yes/No/Only)
Target cat qualifier: > (Default is SYSIBM)

Output file and execution mode:


Add to work stmt list : YES (Yes or No)
Data set name . . . . :
Data set disposition: OLD (OLD, SHR, or MOD)
Execution mode . . . .: TSO (BATCH or TSO)
Commit statements per : (Db, tS, Tb, All, None. Default is All)
DB2 defaults handling : (Keep, or Remove. Default is Keep)

DB2 Command output file:


Data set name . . . . :
Data set disposition: OLD (OLD, SHR, or MOD)

BP - Change batch job parameters

Figure 14. The Generate SQL from DB2 Catalog panel (ADB2GEN)

Chapter 2. Activating DB2 Admin 73


6. Specify data on panel ADB2GEN and press Enter. The Specify Work Statement
List pop-up panel is displayed.
7. Specify the work statement list data set name and work statement list name,
as shown in the following figure.
After the GEN line command completes, the Tables, Views, and Aliases panel
DB2 Admin --------------- Specify Work Statement List --------------------

Work stmt list dsn ===> WORKSTMT


Work stmt list name ===> GENTST1

Figure 15. The Specify Work Statement List pop-up panel

is displayed again.
8. Press PF3 twice to return to the DB2 Admin Main Menu.
9. Specify option W to manage work statement lists. The Manage Work
Statements Listspanel, as shown in the following figure, is displayed.

DB2 Admin --------------- DB2X Manage Work Statement Lists -------------- 15:5
Option ===>

1 - Show work statement list library DB2 System: DB2X


2 - Show work statement list DB2 SQL ID: ISTJE

Work stmt list dsn ===> WORKSTMT


Work stmt list name ===> GENTST1

Figure 16. The Manage Work Statement Lists panel (ADB2W)

10. Specify option 1 to display a list of members in the work statement list data
set.
11. Issue the R line command on member GENTST1 to enter an edit session
where you can create a job that re-creates the SYSDUMMY1 table.
a. Examine this JCL for completeness and press PF3 to exit without
submitting the job.
12. Repeat step 5 on page 73 with the following changes:
v On the ADB2GEN panel, specify BATCH in the Execution mode field.
v On the Specify Work Statement List pop-up panel, specify GENTST2 in the
Work stmt list name field.
13. Submit the batch job.
14. After the batch job completes, repeat step 9 and verify that the GENTST2
member of the work statement list data set matches the GENTST1 member.

Step 24. Make DB2 Admin available to users


You can make DB2 Admin available to users.

Use one of the following methods to improve performance when invoking DB2
Admin:
v Copy the DB2 Admin ISPF and TSO libraries to your standard libraries. Your
standard libraries are allocated in your TSO LOGON procedure or are allocated
dynamically before you invoke ISPF.
v Allocate the DB2 Admin target libraries in the TSO LOGON procedure or
dynamically before you invoke ISPF.

74 User's Guide and Reference


Using one of these methods eliminates the need for performing ISPF LIBDEFs each
time that DB2 Admin is invoked, and significantly reduces DB2 Admin start-up
time.

Tip: If possible, define the libraries that you are using for DB2 Admin (and all of
the libraries allocated on the same DD statements before the ones that you are
using for DB2 Admin) to LLA with the FREEZE option. This approach will
significantly reduce the number of input/outputs (I/Os) and the I/O time
used when ISPF and TSO perform a search for DB2 Admin members in the
concatenation sequence.

To make DB2 Admin available while reducing the tailoring effort, use the ADBL
CLIST to allocate the libraries, and invoke DB2 Admin by calling the ADB CLIST.

Step 25. Upgrade to a new release of DB2


You can migrate from one release or mode of DB2 to another.

| For example, you can migrate from DB2 version 8 compatibility mode to
| new-function mode.
| 1. If you are migrating from DB2 for z/OS Version 7 to Version 8 and you use
| Change Management, submit the ADBCHAM8 job in SADBSAMP on all new
| DB2 subsystems to migrate the Change Management database objects.
2. Submit the ADBBIND job in SADBSAMP on all new DB2 subsystems. Doing
this ensures that the changes to the DB2 catalog are reflected in the product's
behavior.
3. If you have defined Reverse Engineering as a stored procedure for DB2 Control
Center for OS/390 and z/OS (CC/390), submit the BIND in member ADBREST
in SADBSAMP.
| 4. If the names of the DB2 load libraries have been changed during the DB2
| migration or if you use Change Management, run the ADB2CUST EXEC. Before
| running the customization procedure, review the DB2 subsystem parameters to
| update the parameters that define the DB2 load libraries or the parameter that
| defines the qualifier for the Change Management database objects.
| 5. If you have defined multiple copies of the DB2 catalog before upgrading to a
| new release or mode, re-run the bind steps for the catalog copies that were
| created in “Using previously defined multiple copies of the DB2 catalog” on
| page 537.

Step 26. Upgrade utility templates


DB2 Admin requires that all existing utility template tables be updated to add a
new column (VOLCNT) to the end of the table.

The default utility template table is named DSNACC.UTTEMPLATE. DB2 Admin


users can have their own private utility template tables.

You can generate a list of utility template tables by running the following query:
SELECT TBCREATOR,TBNAME
FROM SYSIBM.SYSCOLUMNS
WHERE COLNO = 28
AND NAME = 'TRTCH'

Chapter 2. Activating DB2 Admin 75


For each table that does not already have a column named VOLCNT, each table
owner should use the following ALTER TABLE statement to add the new column
VOLCNT to the end of the table:
ALTER TABLE owner.name ADD VOLCNT SMALLINT NOT NULL DEFAULT -1;

where owner is the table owner and name is the table name.

76 User's Guide and Reference


Chapter 3. Using the DB2 Admin Launchpad
The DB2 Admin Launchpad provides a convenient way to run DB2 tools.

The topics in this information describes how to prepare and use the DB2 Admin
Launchpad. Use the DB2 Admin Launchpad to launch installed IBM DB2 tools
directly from a centralized panel. When you launch a tool, you are presented with
the tool's first panel.

Restriction: Only tools that have an ISPF interface can be launched from the DB2
Admin Launchpad function.

Using the Launchpad consists of the following steps:


v Create an ISPF table that contains an entry for each tool you want to launch.
v Modify the ISPF table to add, delete, or update tool entries.
v Launch the tools by displaying the ISPF table and selecting the tools.

Topics:
v “Step 1. Create the Launchpad table” on page 78
v “Step 2. Modify the Launchpad table” on page 79
v “Step 3. Launch tools” on page 82
Related concepts
“Step 6. Prepare ADBL CLIST” on page 36
“Step 11. Tailor the DB2 Admin Launchpad” on page 66

© Copyright IBM Corp. 1995, 2010 77


Step 1. Create the Launchpad table
The table is created the first time you run the ADBL CLIST with the DMT option,
and resides in the table library data set.

The Launchpad table, named ADBDMT, must contain an entry for each tool that
you want to launch. After the table is created, you need to populate it with the
tools that you want to launch from the launchpad.

After you have created the Launchpad table, run the ADBL CLIST with the DMT
parameter to display it. The following figure shows the table immediately after it
has been created.

DB2 Admin ------------------- DB2 Tools Launchpad ------------------ Row 1 from 8


Command ===> Scroll ===> PAGE

Specify DB2 SSID (opt) ===> (Enter '?' for a list of active SSIDs)

Select the DB2 tool you wish to launch or enter its code in the command line.

Sel Code Tool Name Rel Prog No.


--- ------------ ADMINISTRATION TOOLS ------------- --- --------
ADM DB2 Administration Tool 810 5697-L90
--- --------- APPLICATION MANAGEMENT TOOLS -------- --- --------
No table entries in this category
--- --------- PERFORMANCE MANAGEMENT TOOLS -------- --- --------
No table entries in this category
--- -- RECOVERY AND REPLICATION MANAGEMENT TOOLS -- --- --------
No table entries in this category
******************************* Bottom of data ********************************

Figure 17. Launchpad Table panel (ADBDMT)

This panel groups the DB2 tools into the following four categories:
v Administration
v Application Management
v Performance Management
v Recovery and Replication Management
These categories make it easier to locate a tool on the panel. The following fields
are shown on this panel:
Specify DB2 SSID (opt)
You can specify a valid DB2 SSID, which makes it available to any and all
tools that are invoked from the Launchpad. The SSID is stored in variable
DMTSSID. The last SSID specified persists across ISPF sessions.
Sel This column is used to specify the following actions that you wish to
perform:
v ADD to add a new entry
v DEL to delete the entry on that row
v UPD to update the entry on that row
v S or / to start the tool
Code Enter the tool code on the command line at the top of the panel.
Tool name
The name of the tool.
Rel The release or version number of the tool.

78 User's Guide and Reference


Prog No.
The IBM program number of the tool.

Step 2. Modify the Launchpad table


You can use one of two methods to add, delete, or update entries in the
Launchpad table.

You can modify the Launchpad table by using one of the following two methods:
v
Dialog method
The dialog method consists of displaying the Launchpad table by using
the ADBL CLIST with the DMT parameter, and then entering the ADD,
DELETE, or UPDATE command in the Sel column.
v
ADBDMTI EXEC method
Invoke the ADBDMTI EXEC with the ACTION parameter, with its
values ADD, UPDATE and DELETE. Additional values correspond to
the fields on the Launchpad Entry panel; this panel is displayed when
you run the ADBDMTI EXEC. In general, it is easier to enter these
values directly on the panel.
PID
This is the program number of the tool.
REL
This is the release number of the tool. When using several releases
of the same tool, use utmost caution, so as not to get confused. Also,
it is recommended that you assign them unique codes.
NAME
The name of the tool.
CDE
An arbitrary code used to identify or invoke the tool.
GRP
The group number used for grouping the tools on the panel.
STAT
This field indicates the installed status of the tool, and can have a
value of Y or N.
CMD
Use this field to enter an ISPF string used to launch the DB2 tool. It
is probably easier to specify the ISPF string directly in the Command
field of the Launchpad Entry panel.

These values are discussed further on in this chapter - or on the Help


panels associated with the Launchpad Entry panel; at this point, a brief
example showing that the tool with product id 5655-D38 is to be deleted,
should give you an idea of the ADBDMTI interface to the Launchpad.
ADBDMTI ACTION(DELETE) PID(5655-D38)

To update or delete a table entry, you must provide a PID number (with
or without a Rel identifier), a code or a name.

Chapter 3. Using the DB2 Admin Launchpad 79


Related tasks
“Adding tools to the Launchpad table”
“Deleting tools from the Launchpad table” on page 82
“Updating tools in the Launchpad table” on page 81

Adding tools to the Launchpad table


You can add a tool to the Launchpad table by using both the dialog method and
the ADBDMTI EXEC method.
Related concepts
“Step 2. Modify the Launchpad table” on page 79

Using the dialog method to add tools to the Launchpad table


1. Use the ADBL CLIST with the DMT parameter. The Launchpad Table panel is
displayed.
2. Specify ADD in the Sel column of any row. The Launchpad Entry panel is
displayed, as shown in the following figure.

DB2 Admin ----------- DB2 Tools Table - ADD An Entry ----------------------


Command ===> Scroll ===>

Tool Name :
DB2 Object Comparision Tool for z/OS
Code :
OBJ (User-defined code, for shortcut tool identifier)
Prog No. :
5697-L49 (IBM program product number or equivalent)
Release :
720 (Product release number)
Group :
1 (Tool category, as follows:
1 - Administration Tools
2 - Application Management Tools
3 - Performance Management Tools
4 - Recovery and Replication Management)
Installed : Y (Yes/No)

Command : DISPLAY PANEL (GOCMENU)

Figure 18. Launchpad Entry panel (ADBDMTI)

3. Specify any additional information that identifies the tool. You can specify
information in the following fields:
Tool Name
Enter the name of the DB2 tool with which you want to work.
Code
Enter a user-defined shortcut name to identify a tool. Code values should
be unique. Although it is possible to duplicate code values, doing so could
result in DB2 running the wrong tool when the code is invoked.
Prog No.
Enter the IBM program product number or equivalent.
Release
Enter the release/version number of the tool.
Group
Specify the group in which the tool belongs. These groups help to make all
the tools easier to locate on the display panel. The following values are
permissible:
v 1 - Administration Tools
v 2 - Application Management Tools
v 3 - Performance Management Tools

80 User's Guide and Reference


v 4 - Recovery and Replication Management Tools
Installed
Indicate whether the tool is installed or not. If the status of the tool is N
(not installed), you can create a table entry for it; however, this table entry
is not displayed on the panel. If you install the tool later and want to
include it on the Launchpad display panel, use the ADBDMTI EXEC to
change the N to Y.
Command
Enter an ISPF string used to launch the DB2 tool. This field does not
require continuation characters for very long command strings, as it accepts
free-form format that wraps to the next line.
Help panels provide additional information about these input fields. The tool
that you specified is added.

Using the ADBDMTI EXEC to add tools to the Launchpad table


1. Invoke the ADBDMTI EXEC that includes the ACTION(A) or ACTION(ADD)
parameter. Because ADD is the default, you can omit this parameter. The
following examples show how to use the ADBDMTI EXEC to add tools:
v ADBDMTI ACTION(A)
v adbdmti action(add) CDE(OBJ) pid(1234-567) name(OBJECT COMPARISON) rel(565)
stat(Y) grp(1) cmd(ex 'dsn.support.clist')
The Launchpad Entry panel, as shown in the previous figure, is displayed. Any
values that you specified on the ADBDMTI statement are used to fill in the
panel.
2. Specify any additional information that identifies the tool. For types of
information that you can specify, see Types of information that identify DB2
tools. The tool that you specified is added.

Updating tools in the Launchpad table


You can use the dialog method or the ADBDMTI EXEC method to update tools in
the Launchpad table.
Related concepts
“Step 2. Modify the Launchpad table” on page 79

Using the dialog method to update tools in the Launchpad table


1. Use the ADBL CLIST with the DMT parameter. The Launchpad Table panel is
displayed.
2. Specify UPD in the Sel column of any row. The Launchpad Entry-Update panel
is displayed.
3. Overwrite the information that you want to modify and press Enter. The entry
in the Launchpad table is updated.

Using the ADBDMTI EXEC method to update tools in the


Launchpad table
1. Invoke the ADBDMTI EXEC that includes the ACTION(U), ACTION(UPD), or
ACTION(UPDATE) parameter and identify the tool by specifying its name,
code, or PID number. The following example shows how to use the ADBDMTI
EXEC to update tools:
ADBDMTI ACTION(UPDATE) CDE(OBC)

The Launchpad Entry-Update panel is displayed.

Chapter 3. Using the DB2 Admin Launchpad 81


2. Overwrite the information that you want to modify and press Enter. The entry
in the Launchpad table is updated.

Deleting tools from the Launchpad table


You can use the dialog method or the ADBDMTI EXEC method to delete tools
from the Launchpad table.
Related concepts
“Step 2. Modify the Launchpad table” on page 79

Using the dialog method to delete tools from the Launchpad


table
1. Use the ADBL CLIST with the DMT parameter. The Launchpad Table panel is
displayed.
2. Specify DEL in the Sel column of the appropriate row. The Launchpad
Entry-Delete panel is displayed.
3. Confirm whether to delete the specified tool from the table.
v Specify Y to delete the tool.
v Specify N or press End to cancel the delete operation.

Using the ADBDMTI EXEC method to delete tools from the


Launchpad table
1. Invoke the ADBDMTI EXEC that includes the ACTION(D), ACTION(DEL), or
ACTION(DELETE) parameter. The following example shows how to invoke the
ADBDMTI EXEC to delete tools:
ADBDMTI ACTION(DELETE) CDE(OBC)
2. Confirm whether to delete the specified tool from the table.
v Specify Y to delete the tool.
v Specify N or press End to cancel the delete operation.

Step 3. Launch tools


You can launch DB2 tools by using one of two methods.

To launch DB2 tools:


1. Use the ADBL CLIST with the DMT parameter. The Launchpad Table panel is
displayed.
2. Use either of the following methods to launch a tool:
v Enter an S or a slash (/) in the Sel column.
v Enter the code associated with the tool on the command line and press Enter.

Important: When you enter a code, make sure that the code is unique
because, the results are unpredictable if multiple tools have the
same code.

82 User's Guide and Reference


Chapter 4. Using DB2 Admin panels
The topics in this information explain how to use DB2 Admin panels.

Topics:
“Types of DB2 Admin panels” on page 84
v
“Finding the source code for panels” on page 87
v
“Navigating DB2 Admin panels” on page 87
v
“Using DB2 Admin commands” on page 88
v
“Using the DB2 Admin Look Up function” on page 91
v
“Using search arguments to filter data on DB2 Admin panels” on page
v
93
v “Refreshing data on DB2 Admin panels” on page 95
v “Using scrollable fields on DB2 Admin panels” on page 95
v “Checking the status of DB2 Admin” on page 96
v “DB2 Administration Menu panel” on page 97
Related reference
“DB2 Admin line commands” on page 617

© Copyright IBM Corp. 1995, 2010 83


Types of DB2 Admin panels
DB2 Admin uses three types of panels.
v Table display panels
v BROWSE panels
v SQL error display panels

Using table display panels


Table display panels contain ISPF tables that show information about DB2 objects.

You use table display panels to access DB2 Admin functions.

| Note: DB2 Admin panels might hide fields or make entry fields output-only in
| some cases (for example, if a version of a DB2 is used that has this
| restriction). Hidden fields cause the appearance of blank lines or spaces, but
| you can disregard these blank lines or spaces. Note that:
| v Data entry fields, both the description preceding the entry field and the
| input field, can be entirely hidden,
| v Data entry fields can be output-only, which means that you can see that
| there is a field there (because the description is visible) but you cannot
| provide a value.
| v A column on a table display can be converted to output-only, or even
| hidden.

The panel in the following figure, is an example that shows the areas on a typical
table display panel.

DB2 Admin ------------------- DB2X Databases ---------------- ROW 1 TO 5 OF 5


A Command ===> Scroll ===> PAGE

Valid line commands are:


T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
B
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Read Only Share
Select Name Owner Group Pool DBID By S Timestamp
C
* * * * * * * * D
------ -------- -------- -------- -------- ------ -------- - ------------------
E D ISTJE2 G BP0 293 ISTJE2 0001-01-01-00.00.0
*IS ISTJE2DC ISTJE2 ISTJE2GC BP0 295 ISTJE2 0001-01-01-00.00.0
= ISTJE2DE ISTJE2 ISTJE2GE BP0 269 ISTJE2 0001-01-01-00.00.0 F
ISTJE2DS ISTJE2 ISTJE2G BP0 296 ISTJE2 0001-01-01-00.00.0
ISTJE2DV ISTJE2 ISTJE2G BP0 294 ISTJE2 0001-01-01-00.00.0
G ******************************* END OF DB2 DATA *******************************

Figure 19. Table Display panel layout

A
Command line.
On this line, you can enter any DB2 command, ISPF command, or
DB2 Admin primary command.
B
Line command description area.
This area indicates the DB2 Admin line commands that you can
issue from a particular table display panel. You issue a line

84 User's Guide and Reference


command in the Select field (area E). When there is not enough
space on a panel to list all valid line commands, only the most
frequently used line commands are shown. To display all other
valid line commands, specify a question mark (?) in the Select
field, and press Enter.
C
Column headers.
This area contains the names of the columns that contain data.
D
Search arguments.
Use this area to enter search criteria for the data that is displayed
in the panel. For columns that contain alphabetic characters, the
asterisk (*) under the column name marks the beginning
(left-justified) of the area in which you can enter search criteria to
limit the information that DB2 Admin returns. For columns that
contain numeric characters, the asterisk (*) marks the end
(right-justified) of the area. For example, you can enter D050 in the
Name column to display only those databases whose names begin
with D050.
E
Select column.
Use the Select column to issue DB2 Admin line commands (shown
in area B) against DB2 objects that are listed in the Table Display
panel.
F
Rows returned.
This area shows the rows that DB2 returns to you based on the
options that you selected, the commands that you issued, or the
search criteria that you entered. For example, to display the panel
shown in the previous figure, request (on the System Catalog
Menu panel) that all databases owned by ISTJE2 be displayed.
G
End of data marker.
This line indicates the end of the data returned from DB2.

If you enter a line command or update a row in the table display and also issue a
scroll request (PF7 to scroll up or PF8 to scroll down), the line command or row
update is processed and the scroll request is ignored.
Related concepts
“Primary commands” on page 88
“Line commands” on page 88
“Special line commands” on page 89
“Using the DB2 Admin Look Up function” on page 91

Using BROWSE panels


BROWSE panels contain details about DB2 objects.

Issue the DB2 Admin BROWSE primary command from any table display panel to
display the associated BROWSE panel for the object.

Chapter 4. Using DB2 Admin panels 85


The panel in the following figure shows the BROWSE command being entered in a
table display panel of tables stored in the DB2 catalog.

DB2 Admin ----------- DB2X Tables, Views, and Aliases ---------- Row 32 of 160
Command ===> BROWSE Scroll ===> PAGE

Commands: GRANT MIG


Line commands:
C - Columns A - Auth L - List X - Indexes S - Table space D - Database
V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
? - Show all line commands

Sel Name Owner T DB Name TS Name Cols Rows Checks


* * * * * * * *
----- ------------------ -------- - -------- -------- ------ ----------- ------
EACT DSN8810 T DSN8D81A DSN8S81R 5 -1 0
EPROJACT DSN8810 T DSN8D81A DSN8S81R 7 -1 0
EEPA DSN8810 T DSN8D81A DSN8S81R 8 -1 0
VPHONE DSN8810 V DSN8D81A DSN8S81E 7 -1 0
VEMPLP DSN8810 V DSN8D81A DSN8S81E 2 -1 0

Figure 20. Issuing the DB2 Admin BROWSE primary command on the Tables, Views, and
Aliases panel (ADB21T)

The BROWSE primary command generates output similar to that shown in the
following figure. Output is in ISPF browse format. The first line is a header with
the DB2 column names. To display the remaining columns, scroll to the right.

DB2 Admin ----- DB2X Browse Result of SQL Select ---- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

********************************* Top of Data **********************************


NAME CREATOR TYPE DBNAME TSNAME DBID OBID COLCOUNT EDPRO
------------------ -------- ---- -------- -------- ------ ------ -------- -----
DSNRLST01 SYSIBM T DSNRLST DSNRLS01 256 3 11
DSN_REGISTER_APPL DSNRGCOL T DSNRGFDB DSNRGFTS 257 3 9
DSN_REGISTER_OBJT DSNRGCOL T DSNRGFDB DSNRGFTS 257 6 11
DEPT DSN8810 T DSN8D81A DSN8S81D 258 11 5
VDEPT DSN8810 V DSN8D81A DSN8S81D 0 0 4

Figure 21. Output from the BROWSE command

DB2 Admin can also display data in tables that contain binary large objects
(BLOBs), character large objects (CLOBs), double-byte character large objects
(DBCLOBs), and ROWID columns:
v For BLOBs, DB2 Admin retrieves up to 128 bytes per column and displays the
data in hexadecimal format.
v For CLOBs, DB2 Admin retrieves up to 256 bytes per column and displays the
data in character format.
v For DBCLOBs, DB2 Admin retrieves up to 128 bytes per column and displays
the data in hexadecimal format.
v ROWIDs are displayed in hexadecimal format.

Using SQL error display panels


If an error occurs during running of an SQL statement, DB2 Admin displays the
SQL code and error message on a separate panel called an SQL error panel.

To correct the SQL statement, press END, which redisplays the panel where you
originally issued the SQL statement. DB2 Admin positions the cursor at the point
in the SQL statement where DB2 found the error.

86 User's Guide and Reference


The following figure shows the error panel that DB2 Admin displays when the
following SQL statement (containing a spelling error) is issued: SELECT * FRON
Q.STAFF.

DB2 Admin --------------------- DB2 Error Display 1 --------------------- 14:14


Command ===>
Rollback done
SQLCODE : -104 DSNTIAR CODE : 0

DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL FRON VALID SYMBOLS ARE FROM
INTO
DSNT418I SQLSTATE = 37501 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 0 0 0 -1 10 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF'
X'0000000A' X'00000000' SQL DIAGNOSTIC INFORMATION

Figure 22. Error Display panel (part 1 of 2)

Press Enter to see error panel two, as shown in the following figure.

DB2 Admin --------------------- DB2 Error Display 2 --------------------- 14:14


Command ===>

SQLCODE : -104 DSNTIAR CODE : 0

PREPARE

SELECT * FRON Q.STAFF

Figure 23. Error Display panel (part 2 of 2)

Press END to redisplay the panel in which you entered the incorrect SQL
statement.

Finding the source code for panels


Whenever DB2 Admin panels are discussed in this information, the name of the
panel in the figure caption is followed by another name in parentheses. The name
in parentheses is the source code panel name.

For example, in Figure 35 on page 98, the figure caption is “DB2 Administration
Menu Panel (ADB2).” ADB2 is the source code panel name.

If you are developing DB2 Admin applications, you can use the source code name
to quickly locate the source code for a specific panel.

To display the name of the panel in the upper left corner of the panel, issue the
ISPF command PANELID ON.
Related information
Chapter 22, “Writing and modifying DB2 Admin applications,” on page 525

Navigating DB2 Admin panels


Commands are used to navigate within the DB2 Admin interface.

You can enter the following commands on the command line of DB2 Admin
panels:

Chapter 4. Using DB2 Admin panels 87


BACK or B
Display the previous panel.
SKIP or S
Skip the current topic and go to the next topic.
UP or U
Display a higher level list of topics.

You can use the following keyboard keys whenever you are in the tutorial:
Enter Display the next panel.
HELP Display the help information for this panel.
END End the tutorial.
UP Display a higher level list of topics.
DOWN
Skip the current topic and go to the next topic (instead of typing SKIP).
RIGHT
Display the next panel (instead of pressing Enter).
LEFT Display the previous panel (instead of typing BACK).

Using DB2 Admin commands


You can use two types of DB2 Admin commands.

You can use the following types of DB2 Admin commands:


v Primary commands
v Line commands
Related information
Chapter 26, “DB2 Admin commands,” on page 611

Primary commands
Primary commands can be issued from the command line on DB2 Admin panels.

Most primary commands can be entered on all panels; however, some primary
commands are restricted to certain panels.

For information on the syntax for primary commands, see the Help panels.
Related concepts
“Using table display panels” on page 84
“Controlling DB2 Admin processing” on page 527
Related reference
“DB2 Admin primary commands” on page 612

Line commands
Line commands specify an operation that is to be performed on the information
that is displayed.

Line commands are issued from ISPF table display panels. Specify line commands
in the line command area in front of each row (called the SELECT field).

Two types of line commands are available:

88 User's Guide and Reference


v Special line commands
v General line commands

You also can define your own line commands during installation.

If you enter a line command or update a row in the table display and also issue a
scroll request (PF7 to scroll up or PF8 to scroll down), the line command or row
update is processed and the scroll request is ignored.
Related concepts
“Using table display panels” on page 84
“Step 21. Define your own line commands” on page 70
Related information
Chapter 26, “DB2 Admin commands,” on page 611

Special line commands


The special line commands that are available for a panel are listed in the line
command description area.

A question mark (?) line command indicates that there is not enough room to show
all line commands. Specify ?, to display a list of all valid line commands for that
panel.
Related concepts
“Using table display panels” on page 84
Related reference
“DB2 Admin line commands” on page 617

General line commands


Three general line commands are available: minus (-), equal (=), and slash (/).

Minus (-) line command

Use the - line command to exclude a line from a list on table display panels.

You can enter more than one - line command at a time.

Equal (=) line command

Use the = line command to repeat the last line command that you issued.

The panel in the following figure shows how the = line command is used. In this
example, the DIS command has been entered to request a display of the database
named DBEDB1. When DB2 Admin returns from executing the line command, the
asterisk replaces the first character of that command in the Select field. If you
specify = in the Select field of the next line and press Enter, the DIS line command
is executed for database DBEDB2.

Enter the = line command multiple times, as shown in Figure 25 on page 90, to
issue the next line command when DB2 Admin returns from executing the current
line command; the panel where the = line commands are entered is not shown
between executions of the line commands.

Chapter 4. Using DB2 Admin panels 89


DB2 Admin ------------------- DB2X Databases --------------------- Row 1 of 5
Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
ADBDCH ADB ADBGCH BP1 271 ISTFL2 E BP2
*IS DBEDB1 DPGROTH SYSDEFLT BP1 272 DPGROTH E BP2
= DBEDB2 DPGROTH SYSDEFLT BP1 273 DPGROTH E BP2
DSNDB04 SYSIBM SYSDEFLT BP1 4 SYSIBM BP2
DSNDB06 SYSIBM 6 SYSIBM E BP0
******************************* END OF DB2 DATA *******************************

Figure 24. Issuing the '=' line command on the Databases panel (ADB21D)

DB2 Admin ------------------- DB2X Databases --------------------- Row 1 of 7


Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
ADBDCH ADB ADBGCH BP1 271 ISTFL2 E BP2
*IS DBEDB1 DPGROTH SYSDEFLT BP1 272 DPGROTH E BP2
*IS DBEDB2 DPGROTH SYSDEFLT BP1 273 DPGROTH E BP2
DSNDB04 SYSIBM SYSDEFLT BP1 4 SYSIBM BP2
= DSNDB06 SYSIBM 6 SYSIBM E BP0
= DSNDB07 DSCGDB2 SYSDEFLT BP1 7 ISTJE W BP2
DSNRGFDB DSCGDB2 SYSDEFLT BP1 257 ISTJE E BP2
******************************* END OF DB2 DATA *******************************

Figure 25. Issuing the '=' line command multiple times on the Databases panel (ADB21D)

Slash (/) line command

Use the / line command to show all column names and their values for the
selected row.

You can enter more than one / line command at a time.

On panel the Launchpad panel (ADBDMT), issue / or s to invoke the ISPF


interface for the tool on that row. In this situation, you can specify only one / line
command at a time.

The panel in the following figure illustrates the use of the / line command on
database DSNDB06.

90 User's Guide and Reference


DB2 Admin ------------------- DB2X Databases --------------------- Row 1 of 7
Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
ADBDCH ADB ADBGCH BP1 271 ISTFL2 E BP2
*IS DBEDB1 DPGROTH SYSDEFLT BP1 272 DPGROTH E BP2
*IS DBEDB2 DPGROTH SYSDEFLT BP1 273 DPGROTH E BP2
DSNDB04 SYSIBM SYSDEFLT BP1 4 SYSIBM BP2
/ DSNDB06 SYSIBM 6 SYSIBM E BP0
DSNDB07 DSCGDB2 SYSDEFLT BP1 7 ISTJE W BP2
DSNRGFDB DSCGDB2 SYSDEFLT BP1 257 ISTJE E BP2
******************************* END OF DB2 DATA *******************************

Figure 26. Issuing the '/' line command on the Databases panel (ADB21D)

The panel in the following figure shows the result. All column names and their
values from the catalog table (SYSIBM.SYSDATABASE in this case) are displayed.

DB2 Admin ------------------- DB2X Display Row ------------------- Row 1 of 18


Command ===> Scroll ===> PAGE

S Column Name Column Value


* *
- ------------------ ----------------------------------------------------------
NAME DSNDB06
CREATOR SYSIBM
STGROUP
BPOOL
DBID 6
IBMREQD Y
CREATEDBY SYSIBM
ROSHARE
TIMESTAMP 0001-01-01-00.00.00.000000
TYPE
GROUP_MEMBER
CREATEDTS 1985-04-01-00.00.00.000000
ALTEREDTS 1985-04-01-00.00.00.000000
ENCODING_SCHEME E
SBCS_CCSID 0
DBCS_CCSID 0
MIXED_CCSID 0
INDEXBP BP0
******************************* END OF DB2 DATA *******************************

Figure 27. Result of issuing the '/' line command

Using the DB2 Admin Look Up function


Use the Look Up function to determine the valid values that you can enter in
certain input fields.

To use Look Up, type a question mark (?) in any field that is supported by Look
Up and press Enter. (Not all input fields support Look Up; the fields that do
support Look Up are denoted by a question mark at the end of the field.)

After you press Enter, a list of valid choices is displayed. You can select a value
from this list by entering a plus sign (+) to the left of your choice.

Chapter 4. Using DB2 Admin panels 91


You can also use Look Up with a qualifier. Enter the first few characters of a name
followed by a question mark. When you press Enter, all names that follow that
naming convention are displayed.

By using Look Up, you can save keystrokes and avoid typing errors. You can also
avoid backing out of the current panel in order to search for the correct object.

Examples of using the DB2 Admin Look Up function

An example of using the DB2 Admin Look Up function is shown in the following
figures. In this example, the DB2 Admin Look Up function is supported by two
fields, TABLESPACE and IN, both of which show a question mark in the text to
the right of the field. The table space name TSPACE01 has been entered, but the
character string DSN? is a request to display all databases that begin with DSN.

| ADB26CS n -------------------DB2X Create Table Space ------------------- 06:28


| Command ===> __________________________________________________________________
|
| CREATE
|
| TABLESPACE . . TSPACE01 (required table space name. ? to look up)
|
| IN . . . . . . DSN? (optional database. default=DSNDB04. ? to look up)
|
| Like:
| Database . . . ________ (optional existing database. ? to look up)
| Name . . . . . ________ (optional existing table space. ? to look up)
||
| Figure 28. Using the DB2 Admin Look Up function — requesting a Look Up on the Create
| Table Space panel (ADB26CS)

The following figure shows the results of using Look Up. All databases that begin
with DSN are displayed. Select an item by entering a plus sign (+) in the Select field
next to the desired table entry. In this example, DSN8D81A is selected. When you
press End, DB2 Admin enters this name in the IN field of the previous panel.

DB2 Admin ------------------- DB2X Databases --------------- Row 1 to 13 of 13


Command ===> Scroll ===> CSR
Select by typing '+'
Commands: GRANT MIG DIS STA STO UTIL
Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
DSNDB04 SYSIBM SYSDEFLT BP0 4 SYSIBM BP0
DSNDB06 SYSIBM 6 SYSIBM E BP0
DSNDB07 DB2ADM SYSDEFLT BP0 7 DB2ADM W BP1
DSNDPSM DB2ADM SYSDEFLT BP0 293 DB2ADM E BP1
DSNRGFDB DB2ADM SYSDEFLT BP0 257 DB2ADM E BP1
DSNRLST DB2ADM SYSDEFLT BP0 256 DB2ADM E BP1
DSN7CDDB JAYANTI CFCSG001 BP8K1 267 JAYANTI E BP1
DSN7UDF USRND05 DSN8G810 BP0 292 USRND05 U BP1
+ DSN8D81A DB2ADM DSN8G810 BP0 259 DB2ADM E BP1
DSN8D81E DB2ADM DSN8G810 BP0 269 DB2ADM U BP1
DSN8D81L USRND05 DSN8G810 BP0 296 USRND05 E BP1
DSN8D81P DB2ADM DSN8G810 BP0 268 DB2ADM E BP1
DSN8D81U DB2ADM DSN8G81U BP0 270 DB2ADM E BP1

Figure 29. Using the DB2 Admin Look Up function — selecting an object on the Databases
panel (ADB21D)

92 User's Guide and Reference


For input fields that support more than one value, you can select multiple objects
from the list by entering a plus sign next to each object that you want to select and
pressing End.

When to use DB2 Admin Look Up special characters

Some fields support the Look Up function. You can use the question mark (?) Look
Up character to search possible values that you can enter in the fields. If the
question mark is entered in a field where the DB2 Admin Look Up function is not
supported, an error message results. The question mark has its own unique
meaning on table display panels.

The plus sign (+) Look Up character should only be used to select an object from
the list returned by the DB2 Admin Look Up function. If the plus sign is entered
on a table not provided by the DB2 Admin Look Up function, an invalid line
command error message is returned.
Related concepts
“Using table display panels” on page 84

Using search arguments to filter data on DB2 Admin panels


When you run queries to display information about DB2 objects or authorizations,
you can use search arguments in certain input fields to filter the information that is
displayed.

You can use a percent sign (%) or an asterisk (*) as a wildcard character in your
search argument. If you use an asterisk as a wildcard character, DB2 Admin
translates it to a percent sign. The asterisk is also displayed as a percent sign when
the panel is re-displayed.

| Lowercase characters in the search argument for Name, Owner, in D/L/H,


| Grantor, and Grantee are translated to uppercase characters unless you change the
| DB2 Admin default setting. If you change the value of the Capitalize object names
| parameter on the Change DB2 Admin Defaults panel (ADB2P2) to NO, lowercase
| characters will not be translated to uppercase characters where DB2 rules allow the
| name to contain lowercase letters; lowercase characters cannot be translated to
| uppercase characters in database names, table space names, plan names, and
| package names that are not for trigger packages

For example, the panel in the following figure shows how you can use a search
argument with wildcard characters in the Name field on the DB2 System Catalog
panel (ADB21) to display all the databases in the DB2 system catalog with names
that contain the characters 'DSN'.

Chapter 4. Using DB2 Admin panels 93


DB2 Admin --------------------- DB2X System Catalog --------------------- 18:14
Option ===> D

More: +
Object options: DB2 System: DB2X
AO - Authorization options DB2 SQL ID: ISTJE
G - Storage groups P - Plans
D - Databases L - Collections
S - Table spaces K - Packages
T - Tables, views, and aliases M - DBRMs
V - Views H - Schemas
A - Aliases E - User defined data types
Y - Synonyms F - Functions
X - Indexes O - Stored procedures
C - Columns J - Triggers
N - Constraints Q - Sequences
DS - Database structures DSP - DS with plans and packages

Enter standard selection criteria (Using a LIKE operator, criteria not saved):
Name ===> %DSN% > Grantor ===> >
Owner ===> > Grantee ===> >
In D/L/H ===> > Switch Catalog Copy ===> N (N/S/C)
And/or other selection criteria (option xC shows you columns for option x)
Column ===> > Operator ===> Value ===>

Figure 30. System Catalog (ADB21) – using search criteria

When you press Enter, DB2 Admin generates an SQL statement that searches the
DB2 catalog using an SQL LIKE operator to qualify the search for the search
criteria. The following figure shows the ISPF table display that DB2 Admin returns.
All databases that meet the search criteria (have a name that contains the
characters 'DSN') are displayed.

DB2 Admin ------------------- DB2X Databases --------------------- Row 1 of 25


Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
ADBDSN ADB ADBGCH BP1 271 ISTFL2 E BP2
DSNDB04 SYSIBM SYSDEFLT BP1 4 SYSIBM BP2
DSNDB06 SYSIBM 6 SYSIBM E BP0
DSNDB07 DSCGDB2 SYSDEFLT BP1 7 ISTJE W BP2
DSNRGFDB DSCGDB2 SYSDEFLT BP1 257 ISTJE E BP2
DSNRLST DSCGDB2 SYSDEFLT BP1 256 ISTJE E BP2
DSN8D81A DSCGDB2 DSN8G810 BP0 258 ISTJE E BP2
DSN8D81E DSCGDB2 DSN8G810 BP1 260 ISTJE U BP2
DSN8D81P DSCGDB2 DSN8G810 BP0 259 ISTJE E BP2
DSN8D81U DSCGDB2 DSN8G81U BP1 261 ISTJE E BP2
GRGDSN01 DPGROTH SYSDEFLT BP1 272 DPGROTH E BP2
GRGDSN02 DPGROTH SYSDEFLT BP1 273 DPGROTH E BP2
******************************* END OF DB2 DATA *******************************

Figure 31. System Catalog (ADB21) – list of qualifying databases

94 User's Guide and Reference


Related concepts
“Changing DB2 Admin defaults” on page 123
Related reference
“The System Catalog panel” on page 546

Refreshing data on DB2 Admin panels


As you work through DB2 Admin panels, you might want to refresh the original
data on a panel after entering or changing data on that panel.

To refresh the data, enter the REFRESH primary command.

Using scrollable fields on DB2 Admin panels


To allow you to see the contents of input or output fields on panels that are not
wide enough to display the entire contents of the field at once because the space
on a DB2 Admin panel is limited, DB2 Admin uses ISPF scrollable fields.

The less than (<) and the greater than (>) symbols denote a scrollable field. A >
symbol indicates that the field can be scrolled to the right, and a < symbol
indicates that the field can be scrolled to the left. Both symbols are displayed when
you are in the middle of data and can scroll either left or right. You can use the
following ISPF commands to work with the field:
v To scroll through the field, type LEFT or RIGHT in the command field, position
the cursor in the field, and press Enter.
v To see the entire contents of the field at once, type EXPAND in the command
field, position your cursor in the scrollable field, and press Enter.
| v To clear the contents of the field, type ZCLRSFLD in the command field,
| position your cursor in the scrollable field, and press Enter. (If your level of
| z/OS does not support the ZCLRSFLD command, you can use the EXPAND
| command to display the entire contents of the field, and then clear the contents
| of the field in the pop-up window.)

Tip: You can assign your PF keys to be the LEFT, RIGHT, EXPAND, and
ZCLRSFLD commands. Using a PF key simulates both typing in the
command and pressing Enter.

For example, the following figure shows the ALTER Table panel. On this panel,
input fields New owner and New name are scrollable. Output field Old name and
output column Column Name are scrollable.

Chapter 4. Using DB2 Admin panels 95


DB2 Admin ------------------- DB2X ALTER Table ------------------ Row 1 from 5
Command ===> Scroll ===> PAGE

New owner ===> USER1 > Old owner : USER1


New name ===> _DEPARTMENT_TABLE <> Old name : DIVISIONXYZ_DEPART >
Volatile ===> NO Action : NONE New DB ===> DSNDB04
Rows/Page : 51.848 Partitions: 0 New TS ===> DIVISION
Commands : CONTINUE PRIMKEY ADD REL
Line commands :
I - Insert U - Update D - Delete R - Repeat LAB - Label COM - Comment
M - Move A - After B - Before X - Index RES - Reset update
Old Operation
Select Column Name Col No Col Type Length Scale Null D Col No Type
* * * * * * * * *
------ -----------------> ------ -------- ------ ------ ---- - ------ ---------

DEPTNO 1 CHAR 3 0 Y Y 1
MYSPECIALNAME_DEPT 2 VARCHAR 36 0 Y Y 2
MGRNO 3 CHAR 6 0 Y Y 3
ADMRDEPT 4 CHAR 3 0 Y Y 4
LOCATION 5 CHAR 16 0 Y Y 5
******************************* END OF DB2 DATA *******************************

Figure 32. Scrollable fields on the ALTER Table panel

As shown in the panel in the following figure, if you were to scroll the Column
Name field to the right, you would see the rest of the column name for column 2,
and a < symbol would appear to show that the field can be scrolled to the left:

Old Operation
Select Column Name Col No Col Type Length Scale Null D Col No Type
* * * * * * * * *
------ <----------------- ------ -------- ------ ------ ---- - ------ ---------

1 CHAR 3 0 Y Y 1
E_DEPTNAME 2 VARCHAR 36 0 Y Y 2
3 CHAR 6 0 Y Y 3
4 CHAR 3 0 Y Y 4
5 CHAR 16 0 Y Y 5
******************************* END OF DB2 DATA *******************************

Figure 33. Scrolling through a field

Checking the status of DB2 Admin


On any DB2 Admin panel, you can check the status of DB2 Admin by using the
STATUS primary command.

When you use the STATUS command, the DB2 Admin Status panel is displayed, as
shown in the following figure.

Using the DB2 Admin Status panel, you can verify the environment in which DB2
Admin is running (for example, the current SQL ID and the DB2 release). In
addition, execution control counts are displayed.

96 User's Guide and Reference


DB2 Admin ------------------ DB2X DB2 Admin Status ---------------------- 11:07
Option ===>

Current DB2 Admin status: Accessing the local system


More: +
Local DB2 subsystem name: DB2X
Userid : ISTJE
Current SQL ID : ISTJE

DB2 release : 810


DB2 product : DB2

Catalog qualifier : SYSIBM - running directly on catalog tables


DDF location : (blank) - running locally
Current server : CPHMVS1_DB2X - local server
Remote subsystem name : n/a

Execution totals Counts Counts


Prepare : 4 Execute dynamically : 0
Describe : 6 - Set : 0
Open : 4 - Insert : 0
Fetch : 1039 - Update : 0
Close : 4 - Delete : 0
Commit : 4 - Create : 0
Rollback : 0 - Drop : 0
Connect : 0 - Alter : 0
Set : 2 - Comment : 0
User rows affected : 0 - Label : 0
- Grant : 0
- Revoke : 0
- Rename : 0
- Commit : 0
- Rollback : 0
- Other dynamic : 0
Use the RESET command to reset the counts

Figure 34. The DB2 Admin Status panel (ADB2STAT)

DB2 Administration Menu panel


The DB2 Administration Menu panel is the main menu for accessing DB2 Admin
functions.

The DB2 Administration Menu panel, as shown in the following figure, is referred
to throughout this information.

DB2 Admin includes a sample application as part of the product. You can access
the sample application from this panel by specifying the “hidden” option S.

Chapter 4. Using DB2 Admin panels 97


| DB2 Admin -------------- DB2 Administration Menu 7.2.0 ------------------ 01:03
| Option ===>
|
| 1 - DB2 system catalog DB2 System: DB2X
| 2 - Execute SQL statements DB2 SQL ID: ISTJE
| 3 - DB2 performance queries Userid : ISTJE
| 4 - Change current SQL ID DB2 Rel : 810
| 5 - Utility generation using LISTDEFs and TEMPLATEs
| P - Change DB2 Admin parameters
| DD - Distributed DB2 systems
| E - Explain
| Z - DB2 system administration
| SM - Space management functions
| W - Manage work statement lists
| X - Exit DB2 Admin
| CC - DB2 catalog copy version maintenance
| CM - Change management
|
| Interface to other DB2 products and offerings:
| I - DB2I DB2 Interactive
| C - DB2 Object Comparison Tool
|
|
| Figure 35. DB2 Administration Menu panel (ADB2)
|
DB2 SYSTEM CATALOG
Select this option to display information from the catalog about DB2 objects
and/or authorizations for those objects.
EXECUTE SQL STATEMENTS
Select this option to execute SQL statements.
DB2 PERFORMANCE QUERIES
Select this option to run performance and space utilization queries.
CHANGE CURRENT SQL ID
Select this option to change your current SQL ID. This is the same as issuing
the DB2 Admin primary command SQLID.
UTILITY GENERATION USING LISTDEFS AND TEMPLATES
Choose this option to generate utilities using LISTDEFs and TEMPLATEs.
CHANGE DB2 ADMIN PARAMETERS
Select this option to change DB2 Admin parameters.
DISTRIBUTED DB2 SYSTEMS
Select this option to see the system catalog panels for a remote DB2 system.
EXPLAIN
Select this option to:
v Enter an SQL statement and see the resulting rows in a plan table
(PLAN_TABLE).
v List rows from a plan table and see how DB2 will execute SQL statements in
application plans, or packages that were bound with EXPLAIN(YES).
v Create and upgrade a plan table.
DB2 SYSTEM ADMINISTRATION
Select this option to display a list of system administration functions.
SPACE MANAGEMENT FUNCTIONS
Select this option to perform space manager functions.
MANAGE WORK STATEMENT LISTS
Select this option to display the work statement list library and to manage
work statement lists.

98 User's Guide and Reference


DB2 CATALOG COPY VERSION MAINTENANCE
Select this option to maintain and update the Catalog Copy Version Table. This
option appears only if you customized your system for support of multiple
catalog copies.
| CHANGE MANAGEMENT
| Select this option to use the Change Management functions to manage
| changes, versions, masks, and ignores. This option is displayed only if DB2
| Admin has been customized such that the use of Change Management is
| enabled.
Related concepts
Chapter 11, “Using LISTDEFs and TEMPLATEs,” on page 215
Chapter 24, “Running DB2 Admin across distributed systems,” on page 539
Chapter 23, “Using copies of the DB2 catalog,” on page 533
“System Administration panel” on page 380
Related information
Chapter 22, “Writing and modifying DB2 Admin applications,” on page 525
Chapter 25, “System catalog panels,” on page 545
Chapter 8, “Building and running SQL statements,” on page 141
Chapter 10, “Running DB2 Admin performance queries,” on page 187
Chapter 6, “Setting DB2 Admin parameters,” on page 121
Chapter 17, “Invoking DB2 EXPLAIN,” on page 371
Chapter 18, “Administering DB2 Admin,” on page 379
Chapter 19, “Managing space,” on page 435
Chapter 14, “Using work statement lists,” on page 305
Chapter 20, “Managing changes to DB2 objects,” on page 445

Chapter 4. Using DB2 Admin panels 99


100 User's Guide and Reference
Chapter 5. DB2 Admin tutorial
The topics in this information demonstrate how to navigate DB2 Admin and
introduce you to some of its major functions.

Comprehensive information about all of DB2 Admin's functionality is contained in


Part 3: Using DB2 Admin.

Remember: This tutorial is based on the DB2 sample database that is provided
with DB2. If you do not have the sample database installed on your
system, you can still follow along with the tutorial by using one of
your own databases.

Topics:
v “Running queries” on page 102
v “Sorting display data” on page 103
v “Running utilities” on page 105
v “Granting authorizations” on page 108
v “Creating views” on page 109
v “Binding plans and packages” on page 110
v “Displaying detailed information about an object” on page 114
v “Reverse engineering objects” on page 115

Figure 36 on page 102 shows the DB2 Administration Menu panel that is displayed
when you start DB2 Admin. The top of the panel shows the DB2 Admin functions
you can choose. The bottom of the panel shows other DB2 tools (in this case, DB2
Interactive and DB2 Object Comparison Tool) that can be invoked from the main
menu; this is a customization option.

© Copyright IBM Corp. 1995, 2010 101


Running queries
You run queries to display and filter information about database objects.

Choose option 1 on the panel, as shown in the following figure, to display the DB2
System Catalog panel.

| DB2 Admin -------------- DB2 Administration Menu 7.2.0 ------------------ 00:49


| Option ===> 1
|
| 1 - DB2 system catalog DB2 System: DB2X
| 2 - Execute SQL statements DB2 SQL ID: ISTJE
| 3 - DB2 performance queries Userid : ISTJE
| 4 - Change current SQL ID DB2 Rel : 810
| 5 - Utility generation using LISTDEFs and TEMPLATEs
| P - Change DB2 Admin parameters
| DD - Distributed DB2 systems
| E - Explain
| Z - DB2 system administration
| SM - Space management functions
| W - Manage work statement lists
| X - Exit DB2 Admin
| CC - DB2 catalog copy version maintenance
| CM - Change management
|
| Interface to other DB2 products and offerings:
| I DB2I DB2 Interactive
| C DB2 Object Comparison Tool
||
| Figure 36. DB2 Administration Menu (ADB2)
|
Choose option D on this panel, which displays the databases in the DB2 system
catalog. You can filter the databases that are displayed by specifying a search
argument in the Name field. You can use a percent sign (%) or an asterisk (*) as a
wildcard character in your search argument.

DB2 Admin --------------------- DB2X System Catalog --------------------- 18:14


Option ===> D

More: +
Object options: DB2 System: DB2X
AO - Authorization options DB2 SQL ID: ISTJE
G - Storage groups P - Plans
D - Databases L - Collections
S - Table spaces K - Packages
T - Tables, views, and aliases M - DBRMs
V - Views H - Schemas
A - Aliases E - User defined data types
Y - Synonyms F - Functions
X - Indexes O - Stored procedures
C - Columns J - Triggers
N - Constraints Q - Sequences
DS - Database structures DSP - DS with plans and packages

Enter standard selection criteria (Using a LIKE operator, criteria not saved):
Name ===> TABLE1 > Grantor ===> >
Owner ===> > Grantee ===> >
In D/L/H ===> > Switch Catalog Copy ===> N (N/S/C)
And/or other selection criteria (option xC shows you columns for option x)
Column ===> > Operator ===> Value ===>

Figure 37. System Catalog (ADB21) – object options

The following figure shows the ISPF table display panel that DB2 Admin returns.
All databases that meet the search criteria are displayed in the Name field.

102 User's Guide and Reference


DB2 Admin ------------------- DB2X Databases --------------------- Row 1 of 25
Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
ADBDCH ADB ADBGCH BP1 271 ISTFL2 E BP2
DBEDB1 DPGROTH SYSDEFLT BP1 272 DPGROTH E BP2
DBEDB2 DPGROTH SYSDEFLT BP1 273 DPGROTH E BP2
DSNDB04 SYSIBM SYSDEFLT BP1 4 SYSIBM BP2
DSNDB06 SYSIBM 6 SYSIBM E BP0
DSNDB07 DSCGDB2 SYSDEFLT BP1 7 ISTJE W BP2
DSNRGFDB DSCGDB2 SYSDEFLT BP1 257 ISTJE E BP2
DSNRLST DSCGDB2 SYSDEFLT BP1 256 ISTJE E BP2
DSN8D81A DSCGDB2 DSN8G810 BP0 258 ISTJE E BP2
DSN8D81E DSCGDB2 DSN8G810 BP1 260 ISTJE U BP2
DSN8D81P DSCGDB2 DSN8G810 BP0 259 ISTJE E BP2
DSN8D81U DSCGDB2 DSN8G81U BP1 261 ISTJE E BP2
******************************* END OF DB2 DATA *******************************

Figure 38. System catalog databases (ADB21D)

Related concepts
“Using the DB2 Admin Parameters panel” on page 122

Sorting display data


You can sort alphabetically on one or more columns or include only rows with
certain values.

The following figure shows the information DB2 Admin returns when a SORT
primary command is issued. You can also sort on any column by typing the SORT
primary command, putting your cursor in the column to be sorted, and pressing
Enter.

Chapter 5. DB2 Admin tutorial 103


DB2 Admin ------------------- DB2X Databases --------------------- Row 1 of 25
Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
ADBDCH ADB ADBGCH BP1 271 ISTFL2 E BP2
DBEDB1 DPGROTH SYSDEFLT BP1 272 DPGROTH E BP2
DBEDB2 DPGROTH SYSDEFLT BP1 273 DPGROTH E BP2
DSNDB04 SYSIBM SYSDEFLT BP1 4 SYSIBM BP2
DSNDB06 SYSIBM 6 SYSIBM E BP0
DSNDB07 DSCGDB2 SYSDEFLT BP1 7 ISTJE W BP2
DSNRGFDB DSCGDB2 SYSDEFLT BP1 257 ISTJE E BP2
DSNRLST DSCGDB2 SYSDEFLT BP1 256 ISTJE E BP2
S DSN8D81A DSCGDB2 DSN8G810 BP0 258 ISTJE E BP2
DSN8D81E DSCGDB2 DSN8G810 BP1 260 ISTJE U BP2
DSN8D81P DSCGDB2 DSN8G810 BP0 259 ISTJE E BP2
DSN8D81U DSCGDB2 DSN8G81U BP1 261 ISTJE E BP2
******************************* END OF DB2 DATA *******************************

Figure 39. Databases after SORT CREATOR issued (ADB21D)

You can save a sort sequence for a panel and the sequence is displayed every time
that the panel is displayed (until specifically deleted). The saved sort sequence for
each panel is saved in an ISPF table named ADBSORT in the user ISPPROF data
set. You can specify the sort sequence for a panel by using the SORT command
(without parameters). Panel ADBSORT is displayed, on which you can save or
delete the sort sequence for that panel.

Using the SORT command, you can also sort the data using the displayed column
header name.

You can navigate the catalog. If you enter the S line command in the Select field
next to database DSN8D81A in the panel in the previous figure, DB2 Admin
displays all table spaces in database DSN8D81A. The results of issuing the S line
command are shown in the following figure.

DB2 Admin ------------------ DB2X Table Spaces -------------------- Row 1 of 5


Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO


Line commands:
T - Tables D - Database A - Auth G - Storage group ICS - Image copy status
DIS - Display database STA - Start database STO - Stop database X - Indexes
? - Show all line commands

Select Name DB Name Parts Bpool L E S I C Tables Act. pages Segsz T L


* * * * * * * * * * * * * *
------ -------- -------- ------ ------ - - - - - ------ ----------- ------ - -
DIS DSN8S81D DSN8D81A 0 BP0 P N A N N 1 12 0 Y
DSN8S81E DSN8D81A 4 BP0 P N A N N 1 120 0 Y
DSN8S81R DSN8D81A 0 BP0 P N A N N 6 0 0 Y
DSN8S81P DSN8D81A 0 BP0 R N A N N 4 24 4 Y
DSN8S81S DSN8D81A 0 BP0 P N A N N 1 0 0 Y
******************************* END OF DB2 DATA *******************************

Figure 40. Table spaces in a database (ADB21S)

You can issue commands against DB2 objects. From the Table Spaces panel, you
can issue DB2 commands against DB2 objects. The previous figure demonstrates

104 User's Guide and Reference


the use of the DIS line command against a DB2 database. As shown in the
following figure, output from a DB2 command is displayed in ISPF browse.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-DIS DB(DSN8D81A) SPACENAM(DSN8S81D) LIMIT(*)

********************************* Top of Data **********************************


DSNT360I DB2X ***********************************
DSNT361I DB2X * DISPLAY DATABASE SUMMARY
* GLOBAL
DSNT360I DB2X ***********************************
DSNT362I DB2X DATABASE = DSN8D81A STATUS = RW
DBD LENGTH = 16142
DSNT397I DB2X
NAME TYPE PART STATUS PHYERRLO PHYERRHI CATALOG PIECE
-------- ---- ---- ------------------ -------- -------- -------- -----
DSN8S81D TS RW
******* DISPLAY OF DATABASE DSN8D81A ENDED **********************
DSN9022I DB2X DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 41. ISPF Browse output after DB2 command (ADB2DB2O)

Related concepts
“Running utilities”

Running utilities
You can run DB2 utilities from DB2 Admin.

Redisplay the Table Spaces panel. Specify line command UTL for table space
DSN8S81D. DB2 Admin responds by displaying the utilities that can be run against
a table space, as shown in the following figure.

Chapter 5. DB2 Admin tutorial 105


DB2 Admin ------------------ DB2X Table Space Utilities ----------------- 00:51
Option ===>

Execute utility on DB2 System: DB2X


table space DSNDB06.SYSEBCDC DB2 SQL ID: ISTJE
More: +
C - Copy full CI - Copy incremental C2 - Copytocopy
CC - Copy concurrent
E - Mergecopy EN - Mergecopy newcopy
K - Check index KD - Check data
M - Modify
N - Repair nocopypend NA - Repair nocheckpend NB - Repair norcvrpend
NL - Repair Levelid
O - Reorg OU - Reorg unload only OO - Online reorg
OC - Reorg w/Inline Copy
P - Report recovery Q - Quiesce
R - Runstats RT - Runstats table all RR - Runstats report
RX - Runstats (to invalidate dynamic cache)
V - Recover VC - Recover tocopy VG - Recover to last GDG
VI - Rebuild index VR - Recover torba VL - Recover logonly
DG - Define GDG for copy data sets VP - Recover tologpoint
U - Unload

BP - Change batch job parameters


TU - Specify Template Usage

Utility control options:


Review/change options : NO (Yes/No)
Generate work statement list : NO (Yes/No)
Generate template statements : NO (Yes/No)
Generate modify after copy : NO (Yes/No)

Figure 42. Table Space Utilities menu (ADB2US)

You can run the COPY utility against the table space by specifying option C, which
requests a full image copy. The following figure shows the JCL that DB2 Admin
returns to you. The JCL is ready to be submitted.

106 User's Guide and Reference


File Edit Edit_Settings Menu Utilities Compilers Test Help
-------------------------------------------------------------------------------
EDIT ISTJE.SPFTEMP2.CNTL Columns 00001 00072
Command ===> Scroll ===> PAGE
000007 //*
000008 //**********************************************************************
000009 //*
000010 //* DB2 ADMIN GENERATED JOB TO RUN COPY ON SELECTED TABLESPACES
000011 //*
000012 //************************************************************ADB2USC***
000013 //*
000014 //**********************************************************************
000015 //* STEP COPY: COPY TABLESPACE DSN8D81A.DSN8S81D
000016 //************************************************************ADB2USC1**
000017 //COPY EXEC DSNUPROC,SYSTEM=DB2X,
000018 // LIB='SYS1.DSNDB2X.SDSNLOAD',
000019 // UID='ISTJE'
000020 //DSNUPROC.SYSCOPY DD DSN=ISTJE.DB2X.IC.DSN8D81A.DSN8S81D(+1),
000021 // DISP=(NEW,CATLG),
000022 // SPACE=(8192,(7,5),RLSE),
000023 // UNIT=SYSDA
000024 //DSNUPROC.SYSIN DD *
000025 COPY TABLESPACE DSN8D81A.DSN8S81D DSNUM ALL FULL YES
000026 /*
000027 //**********************************************************************
000028 //* STEP MOD: MODIFY RECOVERY TABLESPACE DSN8D81A.DSN8S81D
000029 //**********************************************************************
000030 //MOD EXEC DSNUPROC,SYSTEM=DB2X,
000031 // LIB='SYS1.DSNDB2X.SDSNLOAD',
000032 // UID='ISTJE'
000033 //DSNUPROC.SYSIN DD *
000034 MODIFY RECOVERY TABLESPACE DSN8D81A.DSN8S81D DSNUM ALL
000035 DELETE AGE(35)
000036 /*
****** **************************** Bottom of Data ****************************

Figure 43. JCL for a utility

Back to the Table Spaces panel again, you can determine what tables are in a table
space by issuing the T line command. The following figure shows the tables in
table space DSN8S81D.

DB2 Admin ----------- DB2X Tables, Views, and Aliases ----------- - Row 1 of 1
Command ===> Scroll ===> PAGE

Commands: GRANT MIG


Line commands:
C - Columns A - Auth L - List X - Indexes S - Table space D - Database
V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
? - Show all line commands

Sel Name Owner T DB Name TS Name Cols Rows Checks


* * * * * * * *
----- ------------------ -------- - -------- -------- ------ ----------- ------
T DEPT DSN8810 T DSN8D81A DSN8S81D 5 14 0
VDEPT DSN8810 V DSN8D81A DSN8S81D 4 -1 0
******************************* END OF DB2 DATA *******************************

Figure 44. Tables in a table space (ADB21T)

To see the columns in a table, issue the C line command against the DEPT table. The
result is shown in the following figure.

Chapter 5. DB2 Admin tutorial 107


| DB2 Admin ----- DB2X Columns in Table: DSN8810.DEPT --------------- Row 1 of 5
| Command ===> Scroll ===> PAGE
|
| Line commands:
| T - Tables X - Indexes A - Auth GR - Grant H - Homonyms I - Interpret
| UR - Update runstats LAB - Label COM - Comment DI - Distribution stats
| PST - Partition stats E - Source data type SEQ - Identity column info
| ? - Show all line commands
|
| Select Column Name Col No Col Type Length Scale Null Def FP Col Card
| * * * * * * * * *
| ------ ------------------ ------ -------- ------ ------ ---- --- -- -----------
| DEPTNO 1 CHAR 3 0 N N N 14
| DEPTNAME 2 VARCHAR 36 0 N N N -1
| MGRNO 3 CHAR 6 0 Y Y N 9
| ADMRDEPT 4 CHAR 3 0 N N N 3
| LOCATION 5 CHAR 16 0 Y Y N -1
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 45. Columns in a table (ADB21TC)
|
To see the indexes for a table, issue the X line command against the DEPT table. The
following figure shows the information that is returned.

DB2 Admin --------------------- DB2X Indexes ---------------------- Row 1 of 3


Command ===> Scroll ===> PAGE

Commands: DIS STA STO


Line commands:
T - Tables D - Database G - Storage group P - Plans C - Columns
DIS - Display database STA - Start database STO - Stop database
? - Show all line commands

Index Table C C C
Select Index Name Owner Table Name Owner U Cols G D L T
* * * * * * * * * *
------ ------------------ -------- ------------------ -------- - ------ - - - -
XDEPT1 DSN8810 DEPT DSN8810 P 1 N Y N 2
XDEPT2 DSN8810 DEPT DSN8810 D 1 N Y N 2
XDEPT3 DSN8810 DEPT DSN8810 D 1 N Y N 2
******************************* END OF DB2 DATA *******************************

Figure 46. Indexes for a table (ADB21X)

Related concepts
“Sorting display data” on page 103

Granting authorizations
You can grant authorizations with DB2 Admin.

You can find the authorizations for any DB2 object by issuing the A line command.
The following figure shows the output that DB2 Admin returns when the A line
command is issued against table DEPT.

108 User's Guide and Reference


DB2 Admin ---------------- DB2X Table Authorizations -------------- Row 1 of 2
Command ===> Scroll ===> PAGE

Commands: REVOKE GRANT


Line commands:
R - Revoke GR - Grant T - Table I - Interpretation U D I S U R
CA - Column authorizations P A E I N E P R E
D L L N S L D E F T
C T E D E E A F C R
G H Date O E T E R C T E O I
S Grantor Grantee T Owner Name G Grant L R E X T T E R L G
* * * * * * * * * * * * * * * * *
-- -------- -------- - -------- ----------------- - ------ - - - - - - - - - -
GR DSN8810 DSN8810 DSN8810 DEPT S 010524 G G G G G G G G
DSCGDB2 PUBLIC* DSN8810 DEPT S 010524 Y Y Y Y
******************************* END OF DB2 DATA *******************************

Figure 47. Authorizations for a DB2 object (ADB2AT)

Issue the GR line command to grant privileges for the object. The following figure
shows the information that DB2 Admin returns when GR is issued against table
DEPT.

DB2 Admin ----------------- DB2X Grant Table Privileges ----------------- 00:53


Command ===>

GRANT

Specify Y or G (for WITH GRANT OPTION) or ' ' (for none)

ALL INDEX UPDATE


ALTER INSERT REFERENCES
DELETE SELECT TRIGGERS

ON TABLE

OWNER ===> DSN8810 >


TABLE ===> DEPT >

TO

To ===> USERX
>

Figure 48. Grant privileges for a table (ADB2GT)

Creating views
You can create views in DB2 Admin.

From the Tables, View, and Aliases panel, as shown in the following figure, you
can request the SQL source that created a view. To do this, issue the VS line
command against the VDEPT view.

Chapter 5. DB2 Admin tutorial 109


DB2 Admin ----------- DB2X Tables, Views, and Aliases ----------- - Row 1 of 1
Command ===> Scroll ===> PAGE

Commands: GRANT MIG


Line commands:
C - Columns A - Auth L - List X - Indexes S - Table space D - Database
V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
? - Show all line commands

Sel Name Owner T DB Name TS Name Cols Rows Checks


* * * * * * * *
----- ------------------ -------- - -------- -------- ------ ----------- ------
DEPT DSN8810 T DSN8D81A DSN8S81D 5 14 0
VS VDEPT DSN8810 V DSN8D81A DSN8S81D 4 -1 0
******************************* END OF DB2 DATA *******************************

Figure 49. Tables, Views and Aliases panel (ADB21T)

As shown in the following figure, you can request that DB2 Admin display the
definition of the view using ISPF edit.

DB2 Admin -------------- DB2X Create View Source Statements ------------- 00:54
Command ===>

Valid primary commands are: BR - Browse E - Edit EX - Edit/Execute

------------------------- Create View Source Statement ------------------------


CREATE VIEW DSN8810.VDEPT
AS SELECT ALL DEPTNO ,
DEPTNAME,
MGRNO ,
ADMRDEPT
FROM DSN8810.DEPT

Figure 50. SQL source that created a view (ADB21VS)

Binding plans and packages


You can bind plans and packages in DB2 Admin.

From the System Catalog menu, select option P to list the application plans in the
catalog as shown in the following figure.

110 User's Guide and Reference


DB2 Admin ---------------- DB2X Application Plans ---------------- Row 1 of 25

Commands: BIND REBIND FREE GRANT


Line commands:
DP - Depend A - Auth T - Tables V - Views X - Indexes S - Table spaces
Y - Synonyms M - DBRMs RB - Rebind F - Free B - Bind GR - Grant
PL - Package list LP - List PLAN_TABLE I - Interpret ENDI - Enab/disab con
K - Local packages SQ - SQL
Bind Bind V I V O Bound Quali- Pack A R E D
Select Name Owner Date Time D S A P By fier Lists Q L X R
* * * * * * * * * * * * * * *
------ -------- -------> ------ ------ - - - - -------- -------> ------ - - - -
ADBTEP2 DSCGDB2 010828 100153 B S Y Y ISTFL2 DSCGDB2 1 U C N
ADBV3 DSCGDB2 010912 024459 B S Y Y ISTFL DSCGDB2 2 U C Y
ADB2GEN DSCGDB2 010623 005531 B S Y Y ISTJE DSCGDB2 1 U C Y
ADB2GE2 DSCGDB2 010526 003803 B S Y Y ISTFL DSCGDB2 1 U C Y
ADB21 DSCGDB2 010623 004026 B S Y Y ISTJE DSCGDB2 1 U C N
ADB31 DSCGDB2 011030 170150 B S Y Y ISTJE DSCGDB2 1 U C N
DB2E81 DPGROTH 011029 145636 R S Y Y DPGROTH DPGROTH 0 U C Y
DSNEDCL DSCGDB2 010524 190326 R S Y Y ISTJE DSCGDB2 1 U C N
DSNESPCS DSCGDB2 010524 190324 R S Y Y ISTJE DSCGDB2 1 U C N
DSNESPRR DSCGDB2 010524 190325 R R Y Y ISTJE DSCGDB2 1 U C N
M DSNTIAD DSCGDB2 010524 024119 R S Y Y ISTJE DSCGDB2 0 U C N
******************************* END OF DB2 DATA *******************************

Figure 51. Application plans (ADB21P)

Use the M line command from the Application Plans panel to display the DBRMs
for an application plan. The following figure shows the output that DB2 Admin
returns when the M line command is issued against application plan DSNTIAD.

DB2 Admin ---------------------- DB2X DBRMs ----------------------- Row 1 of 1


Command ===> Scroll ===> PAGE

Line commands:
P - Plans B - Browse DBRM S - SQL statements I - Interpretation

S Name Owner PL Name Q C H P Date P Time PDS Name


* * * * * * * * *
- -------- -------> -------- - - - ------ -------- ----------------------------
S DSNTIAD DSCGDB2 DSNTIAD N N B 010524 02410439 DB2.DSN810.DBRMLIB.DATA
******************************* END OF DB2 DATA *******************************

Figure 52. DBRMs for an application plan (ADB21M)

To request the actual SQL statements in the DBRM, issue line command S. The
result is shown in the following figure.

Chapter 5. DB2 Admin tutorial 111


DB2 Admin ----------------- Extracted SQL ---------------- Columns 00001 00072
Command ===> Scroll ===> PAGE

****** ***************************** Top of Data ******************************


000001 -- SQL statements in DBRM: DSNTIAD.DSNTIAD
000002 -- SQL in stmt: 982
000003 WHENEVER SQLERROR GO TO EXECERR
000004 -- SQL in stmt: 983
000005 WHENEVER SQLWARNING GO TO EXECWRN
000006 -- SQL in stmt: 984
000007 WHENEVER NOT FOUND GO TO EXECWRN
000008 -- SQL in stmt: 1226
000009 CONNECT
000010 -- SQL in stmt: 1278
000011 CONNECT RESET
000012 -- SQL in stmt: 1405
000013 CONNECT TO :H
000014 -- SQL in stmt: 1528
000015 SET CONNECTION :H
000016 -- SQL in stmt: 1649
000017 RELEASE CURRENT
000018 -- SQL in stmt: 1700
000019 RELEASE ALL
000020 -- SQL in stmt: 1780
000021 RELEASE ALL PRIVATE
000022 -- SQL in stmt: 1829
000023 RELEASE ALL SQL
000024 -- SQL in stmt: 1938
000025 RELEASE :H
000026 -- SQL in stmt: 1993
000027 EXECUTE IMMEDIATE :H
****** **************************** Bottom of Data ****************************

Figure 53. SQL statements in a DBRM (ADB21KSE)

From the Application Plans panel, you can issue a Bind, Rebind, or Free line
command for a particular plan. You can also issue a BIND, REBIND, FREE, or
GRANT primary command for all plans listed.

The following figure shows the result when you request a Bind of application plan
DSNTIAD.

DB2 Admin ------------------ DB2X Bind Application Plan ----------------- 00:59


Command ===>

More: +
Verify BIND parameters:

BIND PLAN(
Plan name ===> DSNTIAD
) OWNER(
Plan owner ===> DSCGDB2 >
) QUALIFIER(
Qualifier ===> DSCGDB2 > (qualifier to resolve unqualified SQL)
) MEMBER( (use ? to get current values from the catalog)
DBRM members ===> ?

) LIBRARY (use ? to get current values from the catalog)


DBRM data sets ===> ?

) PKLIST( (use ? to get current values from the catalog)


Package lists ===>

Figure 54. A BIND of an application plan (ADB21PB) (1 of 2)

112 User's Guide and Reference


) DEFER(PREPARE)
Defer prepare ===> N (Yes/No, used for distributed dynamic SQL)
) VALIDATE(
Validation time ===> R (Run or Bind, Bind preferred)
) ISOLATION(
Isolation level ===> CS (CS, RR, RS, or UR)
) CACHE(
Cache size ===> 1024 (cache size in bytes for authorization IDs)
) ACQUIRE(
Acquire at ===> U (Use or Allocate, Use preferred)
) RELEASE(
Release at ===> C (Commit or Deallocate, Commit preferred)
) EXPLAIN(
Explain plan ===> N (Yes/No, to explain access path)
) CURRENTDATA(
Inhibit blocking===> (Yes/No)
) CURRENT SERVER(
Server name ===> > (blank=local, else first location)
) ACTION(
Bind action ===> REPLACE (Add or Replace)
) RETAIN
Retain auth list===> YES (Yes/No)
) ENABLE( (use ? to get current values from the catalog)
Enable connects ===>
) DISABLE( (use ? to get current values from the catalog)
Disable connects===>
) (use ? to get current values from the catalog)
En/disable names===>

DEGREE(
Parallelism ===> (1 or ANY)
) SQLRULES(
Connect2 rules ===> (DB2 or STD)
) DISCONNECT(
Disconnect ===> (Explicit, Automatic, or Conditional)
) DYNAMICRULES(
Dynamic rules ===> (Run or Bind)
) KEEPDYNAMIC(
Keep dynamic SQL===> (Yes/No)
) DEFER(PREPARE)/NODEFER(PREPARE)
Defer prepare ===> (Yes/No)
) REOPT(VARS)/NOREOPT(VARS)
Re-opt at exec ===> (Yes/No)
) DBPROTOCOL(
3 part protocol ===> (Drda or Private)
) OPTHINT(
Access path hint===> > (hint id)
) PATH(
UDT/UDF/STP path===>

)
ENCODING(
Scheme or CCSID ===> (ASCII, EBCDIC, UNICODE or ccsid)
)

Figure 55. A BIND of an application plan (ADB21PB) (2 of 2)

DB2 Admin uses the catalog to automatically find the DBRM members and
libraries for the bind. These are displayed when you press Enter, as shown in the
following figure.

Chapter 5. DB2 Admin tutorial 113


DB2 Admin ------------------ DB2X Bind Application Plan ----------------- 00:59
Command ===>

More: +
Verify BIND parameters:

BIND PLAN(
Plan name ===> DSNTIAD
) OWNER(
Plan owner ===> DSCGDB2
) QUALIFIER(
Qualifier ===> DSCGDB2 (qualifier to resolve unqualified SQL)
) MEMBER( (use ? to get current values from the catalog)
DBRM members ===> DSNTIAD

) LIBRARY (use ? to get current values from the catalog)


DBRM data sets ===> 'DB2.DSN810.DBRMLIB.DATA'

) PKLIST( (use ? to get current values from the catalog)


Package lists ===>

...

Figure 56. DBRM members and libraries for the BIND (ADB21PB)

If an SQL error occurs, DB2 Admin displays the DSNTIAR message, as shown in
the following figure.

DB2 Admin --------------------- DB2 Error Display 1 --------------------- 12:54


Command ===>
Rollback done
SQLCODE : -206 DSNTIAR CODE : 0

DSNT408I SQLCODE = -206, ERROR: T.TYP IS NOT A COLUMN OF AN INSERTED TABLE,


UPDATED TABLE, OR ANY TABLE IDENTIFIED IN A FROM CLAUSE, OR IS NOT A
COLUMN OF THE TRIGGERING TABLE OF A TRIGGER
DSNT418I SQLSTATE = 42703 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNXORSO SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = -600 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'FFFFFDA8' X'00000000' X'00000000' X'FFFFFFFF'
X'00000000' X'00000000' SQL DIAGNOSTIC INFORMATION

Figure 57. DSNTIAR error messages

When you press Enter, a second error panel opens to display the actual SQL
statement that caused the error as shown in the following figure.

DB2 Admin --------------------- DB2 Error Display 2 --------------------- 12:54


Command ===>

SQLCODE : -206 DSNTIAR CODE : 0

PREPARE

SELECT T.* FROM SYSIBM.SYSTABLES T WHERE T.CREATOR LIKE 'DSN and T.TYP = 'V'
FOR FETCH ONLY

Figure 58. SQL statement in error

Displaying detailed information about an object


You can display detailed information about an object in DB2 Admin.

114 User's Guide and Reference


If you want interpretive information about an object in the DB2 catalog, you can
use the I line command on the Application Plans panel. The following figure
shows the result when you issue the I line command against application plan
DSNTIAD.

DB2 Admin --------- DB2X Interpretation of an Object in SYSPLAN --------- 01:00


Option ===>

Details for application plan : DSNTIAD


More: +
Authorization ID of owner : DSCGDB2
Authorization ID of creator : ISTJE
Qualifier for unqualified SQL : DSCGDB2
Date of latest BIND of plan : 040524 (yymmdd)
Time of latest BIND of plan : 02411994 (hhmmssth)
Time when the plan was bound : 2004-05-24-02.41.19.948290
Version under which plan bound : V8
SQL rules specified at BIND : D - DB2
Cache size for auth IDs in bytes : 1024
Operative status of plan : Plan is valid and operative
Resource and authorization check : At plan allocation time
Plan base section size (bytes) : 2632 (in EDM pool during execution)
Average DML section size (bytes) : 0 (loaded when needed during exec)
Plan bound with EXPLAIN option : NO
Plan bound with DEFER(PREPARE) : No - DEFER(PREPARE) not specified
Number of PACKAGE list entries : 0
Number of enabled/disabled sys : 0
Current server :
Disconnect option used : E - explicit. Release locations at commit
Data concurrency : C - required for ambiguous cursors
Effect on blocking : Inhibit blocking for ambiguous cursors
DEGREE of I/O parallelism : 1 - parallel I/O inhibited
Group member that performed BIND :
Dynamic SQL rules : Not specified - use the rules for the plan
Re-optimize SQL at execution time: No - access path determined at BIND time
Keep prepared dynamic SQL stmts : No - are destroyed at COMMIT
Protocol for 3 part names : D
Function resolved at : 2004-05-24-02.41.19.894713
Optimizer hint identifier :
Encode CCSID : 277
Write group buffer pool pages : Normal write
SQL path for resolving UDT,UDF,SP:

Resource allocation information :


Resources acquired : When first used
Resources released : At COMMIT
Isolation level : Cursor stability

Figure 59. Interpretation of an object (ADB21PI1)

Reverse engineering objects


You can reverse engineer objects in your DB2 catalog (that is, extract the DDL
required to re-create the DB2 objects).

The starting point for reverse engineering can be databases, table spaces, tables,
aliases, synonyms, schemas, data types, functions, stored procedures, triggers,
sequences, or storage groups.

The following figure shows the panel that is displayed when reverse engineering
of database DSN8D81A is requested using the GEN line command.

Chapter 5. DB2 Admin tutorial 115


DB2 Admin -------------- DB2X Generate SQL from DB2 catalog ------------- 01:01
Option ===>

Generate SQL statements for database DSN8D81A DB2 System: DB2X


DB2 SQL ID: ISTJE

SQL statement types to be generated from the DB2 catalog:


CREATE DATABASE. . . . . : Y (Y,N) GRANT access ON DATABASE . : Y (Y,N)
CREATE TABLESPACE. . . . : Y (Y,N) GRANT access ON TABLESPACE : Y (Y,N)
CREATE TABLE . . . . . . : Y (Y,N) GRANT access ON TABLE. . . : Y (Y,N)
CREATE VIEW. . . . . . . : D (Y,N,D) GRANT access ON VIEW . . . : Y (Y,N)
CREATE INDEX . . . . . . : Y (Y,N) ALTER TABLE ADD FOREIGN KEY: Y (Y,N,D)
CREATE SYNONYM . . . . . : Y (Y,N) LABEL ON . . . . . . . . . : Y (Y,N)
CREATE ALIAS . . . . . . : Y (Y,N) COMMENT ON . . . . . . . . : Y (Y,N)
CREATE TRIGGER . . . . . : Y (Y,N,D) REBIND PLAN/PACKAGE. . . . : Y (Y,N,D)
CREATE STORAGE GROUP . . : Y (Y,N) GRANT use OF STORAGE GROUP : Y (Y,N)

New names/values for generated SQL: (leave blank to use current values)
Object owner. . . . . : > Run SQLID. . . . . . . . . : SQLIDXXX
Object grantor. . . . : >
Alloc TS size as. . . : DEFINED (DEFINED, USED, or ALLOC)
Database name . . . . :
Storage group for TS. : > Storage group for IX . . . : >
Target DB2 version. . : (Current DB2 version: 810)
Use Masking . . . . . : YES (Yes/No)
Generate catalog stats: NO (Yes/No/Only)
Target cat qualifier: > (Default is SYSIBM)

Output file and execution mode:


Add to work stmt list : YES (Yes/No)
Data set name . . . . : *
Data set disposition: OLD (OLD, SHR, or MOD)
Execution mode. . . . : BATCH (BATCH or TSO)
Commit statements per : (Db, tS, Tb, All, None. Default is All)
DB2 defaults handling : (Keep, or Remove. Default is Keep)

DB2 Command output file:


Data set name . . . . : *
Data set disposition: OLD (OLD, SHR, or MOD)

BP - Change batch job parameters

Figure 60. Generate SQL from DB2 Catalog panel (ADB2GEN)

Press Enter to display the reverse engineering output. This figure shows part of the
result of running reverse engineering on this database.

116 User's Guide and Reference


------------------------------------------------------------------------
-- --
-- Database 2 Administration Tool (DB2 Admin) , program 5697-L90 (C) --
-- --
-- ADB2GEN - Extract object definitions from the DB2 Catalog tables --
-- --
-- Input prepared on : DB2X (810) Extract time : 2005-16-04 01:01 --
-- --
-- Catalog values overridden : none --
-- --
-- Generate : SG=Y DB=Y TS=Y TB=Y VW=Y IX=Y SY=Y AL=Y LB=Y CM=Y FK=Y --
-- TG=Y UT=N UF=N SP=N --
-- Grants : SG=Y DB=Y TS=Y TB=Y VW=Y SC=N UT=N UF=N SP=N --
-- --
------------------------------------------------------------------------
------------------------------------------------------------------------
-- --
-- ADB2GEN: Generate DDL for Database DSN8D81A --
-- --
------------------------------------------------------------------------
--
--
------------------------------------------------------------------------
-- Database=DSN8D81A Stogroup=DSN8G810
------------------------------------------------------------------------
--
SET CURRENT SQLID='DSCGDB2';
--
CREATE DATABASE DSN8D81A
BUFFERPOOL BP0
INDEXBP BP2
CCSID EBCDIC
STOGROUP DSN8G810 ;
--
GRANT DBADM
ON DATABASE DSN8D81A TO PUBLIC;
--
COMMIT;
--

Figure 61. Reverse engineering output (1 of 2)

Chapter 5. DB2 Admin tutorial 117


------------------------------------------------------------------------
-- Database=DSN8D81A Stogroup=DSN8G810
-- Tablespace=DSN8D81A.DSN8S81D
------------------------------------------------------------------------
--
CREATE TABLESPACE DSN8S81D
IN DSN8D81A
USING STOGROUP DSN8G810
PRIQTY 32 SECQTY 20
ERASE NO
FREEPAGE 0 PCTFREE 5
GBPCACHE CHANGED
TRACKMOD YES
BUFFERPOOL BP0
LOCKSIZE PAGE
LOCKMAX SYSTEM
CLOSE NO
COMPRESS NO
CCSID EBCDIC
MAXROWS 255;
--
GRANT USE OF TABLESPACE DSN8D81A.DSN8S81D TO PUBLIC;
--
COMMIT;
--
------------------------------------------------------------------------
-- Table=DSN8810.DEPT In DSN8D81A.DSN8S81D
------------------------------------------------------------------------
--
SET CURRENT SQLID='DSN8810';
--
CREATE TABLE DSN8810.DEPT
(DEPTNO CHAR(3) FOR SBCS DATA NOT NULL ,
DEPTNAME VARCHAR(36) FOR SBCS DATA NOT NULL ,
MGRNO CHAR(6) FOR SBCS DATA WITH DEFAULT NULL ,
ADMRDEPT CHAR(3) FOR SBCS DATA NOT NULL ,

Figure 62. Reverse engineering output (2 of 2)

If you specify Y for REBIND PLAN/PACKAGE on the Generate SQL from DB2
Catalog Panel shown inFigure 60 on page 116, you get not just the Reverse
Engineering output shown in Figure 61 on page 117, but also that shown in the
following figure.

Command ===> Scroll ===> PAGE


****** ***************************** Top of Data ******************************
000001 REBIND PACKAGE(DSN8ES81.DSN8ES1)
****** **************************** Bottom of Data ****************************

Figure 63. Reverse engineering rebind output

118 User's Guide and Reference


Part 3. Using DB2 Admin
The topics in this part provide information on how to use the features of DB2
Admin.

© Copyright IBM Corp. 1995, 2010 119


120 User's Guide and Reference
Chapter 6. Setting DB2 Admin parameters
You can change the default settings and appearance of DB2 Admin panels.

Topics:
v “Using the DB2 Admin Parameters panel” on page 122
v “Changing ISPF settings” on page 122
v “Changing colors and highlights” on page 122
v “Changing DB2 Admin defaults” on page 123
v “Changing/Allocating print data sets” on page 126
v “Changing DB2 Admin prompt options” on page 127
| v “Changing migrate settings” on page 129
v “Changing the SQL ID” on page 129
Related concepts
“DB2 Administration Menu panel” on page 97

© Copyright IBM Corp. 1995, 2010 121


Using the DB2 Admin Parameters panel
Use the Change DB2 Admin Parameters panel to select the DB2 Admin parameters
that you want to change.

Select option P on the Administration Menu panel to display the Change DB2
Admin Parameters panel, as shown in the following figure.

Use this panel to select the DB2 Admin parameters that you want to change. To
select a category of parameters, enter the corresponding option in the Option field
and press Enter.

| DB2 Admin ---------------- DB2 Change DB2 Admin Settings ---------------- 11:10
| Option ===>
|
| 0 - Change ISPF settings DB2 System: DB2X
| 1 - Change colors and highlight DB2 SQL ID: ISTJE
| 2 - Change DB2 Admin defaults
| P - Change/allocate print data set
| BP - Change batch parameters
| PR - Change prompt options
| M - Change migrate settings
||
| Figure 64. Change DB2 Admin Settings panel (ADB2P)
|
Related concepts
“Running queries” on page 102

Changing ISPF settings


Use the Change ISPF Settings panel to change standard ISPF settings, such as PF
keys and default colors.

Select option 0 on the Change DB2 Admin Settings panel, to display the change
ISPF Settings panel.

Use this panel to change standard ISPF settings such as PF keys and default colors.

Changing colors and highlights


Use the Change Colors and Highlights panel to change the colors or highlighting
scheme (or designations) technique on DB2 Admin panels.

Select option 1 on the Change DB2 Admin Settings panel to display the Change
Colors and Highlight panel, as shown in the following figure.

Use this panel to change the colors or highlighting scheme (or designations)
technique on DB2 Admin panels.

If you leave an input field on the panel blank, the default value is used. Specify
RESET on the command line to choose default values for all sections of the panel.

122 User's Guide and Reference


DB2 Admin ----------------- Change Colors and Highlights ----------------- 15:46
Command ===>

DB2 Admin panels consist of standard sections, as listed below.


Select colors and highlights to use for each section.

Valid Colors : yellow red blue green white pink and turq
Valid Highlights : blink reverse uscore or blank (default)

Color: Highlight:
Headings: YELLOW
Text: BLUE
Highlighted text: TURQ
Messages: RED
Function: WHITE
Input areas: GREEN
Output areas: TURQ
Scrollable fields: BLUE
Scrollable columns: BLUE

Press ENTER to activate changes or PF3 to cancel changes.

Figure 65. Change Colors and Highlight panel (ADB2P1)

The fields on this panel are:


Headings
First line of the panel (the default setting is yellow)
Text
Instructions or descriptions on the panel (default is blue)
Highlighted text
Emphasized text (the default setting is turquoise)
Messages
Message area, third line on the panel when a message is returned (the default
setting is red)
Function
Command line and/or option chosen (the default setting is white)
Input areas
Area in which you enter your input (the default setting is green)
Output areas
Area in which output is returned to you (the default setting is turquoise)
Scrollable fields
Fields that you can scroll for more information (the default setting is blue)
Scrollable columns
Columns that you can scroll for more information (the default setting is blue)

Changing DB2 Admin defaults


Use the Change DB2 Admin Defaults panel to change various parameters that
affect the execution of DB2 Admin.

Select option 2 on the Change DB2 Admin Settings panel to display the Change
DB2 Admin Defaults panel, as shown in the following figure.

Use this panel to change various parameters that affect the execution of DB2
Admin.

Chapter 6. Setting DB2 Admin parameters 123


| ADB2P2 in ------------------ Change DB2 Admin Defaults ------------------ 05:58
| Option ===> ___________________________________________________________________
|
| DB2 System: DBAA
|
|
| Max No of Rows to Fetch . . . 1000 (0-327670, 0=unlimited, def. 1000)
|
| Max Chars in an SQL Stmt . . . 32765 (4000-32765, default is 32765)
|
| Pgm Action when SQL error:
| First do a . . . . . . . . . ROLLBACK (Commit or Rollback)
| Display error panel . . . . YES (Yes/No)
| Continue executing SQL . . . NO (Yes/No)
|
| Auto Refresh After Update . . YES (Yes/No, default is YES)
|
| Display SQL cost estimate . . YES (Yes/No, default is YES)
|
| Browse DB2 Command Output . . YES (Yes/No)
|
| Max Chars in an ISPF Stmt . . 2000 (500-32765, default is 2000)
|
| Max Chars in an Admin Cmd . . 32765 (500-32765, default is 32765)
|
| Report Drop Impacts . . . . . YES (Yes/No)
|
| Report Revoke Impacts . . . . YES (Yes/No)
|
| Reset to Def. at Startup . . . YES (Yes/No)
|
| Action when no rows found . . M (M - Message (default), P - Panel)
|
| Default local CCSID . . . . . 00000 (Optional, numeric)
|
| Verify CCSID . . . . . . . . . YES (Yes/No, default is YES)
|
| Capitalize object names . . . YES (Yes/No, default is YES)
|
| Capitalize data . . . . . . . YES (Yes/No, default is YES)
|
| Use trusted context in batch . YES (Yes/No, default is NO)
||
| Figure 66. Change DB2 Admin Defaults panel (ADB2P2)
|
The fields on this panel are:
Max No of Rows to Fetch
Enter the maximum number of rows to fetch for each SQL SELECT statement.
Max Chars in an SQL Stmt
Enter the maximum length of the buffer for SQL and ISPF statements.
Pgm Action when SQL error
Specify the action that DB2 Admin takes when an SQL error occurs. The
choices are:
v COMMIT or ROLLBACK the changes
v Display the SQL error panel with the SQL error message and SQLCA (YES
or NO)
v Continue processing by executing the next SQL statement (YES or NO)
Auto Refresh After Update
Indicate whether table display panels are to be refreshed after SQL updates
(YES or NO). If YES, DB2 Admin refreshes the panels when they are
redisplayed. For performance reasons, the refresh is limited to panels where
the elapsed time to fetch the rows to be displayed is less than 10 seconds.

124 User's Guide and Reference


Display SQL cost estimate
Specify whether you want DB2 Admin to display an estimated cost for an SQL
SELECT statement. The estimate is displayed as an ISPF message. If the
estimated cost is larger than the maximum value of an integer, the estimated
cost is displayed as "*.***.***.***".
Browse DB2 Command Output
Indicate whether DB2 Admin should invoke ISPF browse (YES) or let the
output default to TSO line mode (NO).
Max Chars in an ISPF Stmt
Enter the maximum length of the buffer for ISPF statements.
Max Chars in an Admin Cmd
Enter the maximum length of the buffer for DB2 Admin commands.
Report Drop Impacts
Enter the default value to be displayed in the Report Drop Impacts field when
dropping an object.
Report Revoke Impacts
Enter the default value to be displayed in the Report Revoke Impacts field
when revoking authorities.
Reset to Def. at Startup
Indicate whether DB2 Admin should restore the following parameters to their
default values at the next startup:
v MAX NO OF ROWS TO FETCH
v MAX CHARS IN AN SQL STATEMENT
v AUTO REFRESH AFTER UPDATE
v MAX CHARS IN AN ISPF STMT
v MAX CHARS IN AN ADMIN CMD
When set to NO, DB2 Admin attempts to restore the CURRENT SQLID.
Action when no rows found
Indicate whether DB2 Admin displays a pop-up panel (P) or just a message
(M) when no rows are found.
| Default local CCSID
| If the ISPF system or terminal emulator are set up such that no CCSID is
| available in ZTERMCID, specify a default to enable the SQ line command for
| packages, plans and triggers that are created in DB2 Version 8 or higher.
| Verify CCSID
| Indicate whether DB2 Admin verifies that the coded character set identifier
| (CCSID) for the TSO terminal and the CCSID for the plan under which DB2
| Admin is running match each other. When you start DB2 Admin and
| verification is active, a pop-up panel is displayed to provide a warning if the
| CCSIDs do not match. (The pop-up panel is also displayed when you start
| DB2 Object Comparison Tool and the CCSIDs of the TSO terminal and the plan
| under which DB2 Object Comparison is running do not match each other.) A
| discrepancy in the CCSIDS can lead to unexpected data conversion, affecting
| any characters that do not map to the same code point in the two CCSIDs.
| Capitalize object names
| Indicates whether DB2 Admin translates the lowercase characters that you use
| in object names, qualifiers, and authorization identifiers in the following fields
| on the System Catalog panel (ADB21) to uppercase characters:
| v Name

Chapter 6. Setting DB2 Admin parameters 125


| v Owner
| v In D/L/H (databases, collections, and schema)
| v Grantor
| v Grantee
| When the value of the parameter is NO, lowercase characters that are specified
| in these fields are not translated to uppercase characters unless the object being
| displayed is restricted to having a name with uppercase characters only
| according to the rules of DB2. For example, database names, table space
| names, plan names, and package names (except for trigger package names)
| must have names in uppercase characters and, therefore, will always be
| translated to uppercase characters.
| When the value of this parameter is NO, DB2 Admin also supports the use of
| lowercase characters in the qualifier and name of the object when you use DB2
| Admin panels to:
| v Create or drop an index.
| v Create or drop an view.
| v Drop a table.
| Capitalize data
| Indicates whether DB2 Admin translates the lowercase characters that you
| enter as data to uppercase characters.
| Use trusted context in batch
| Indicates whether the ASUSER parameter that is used in the online function
| should also be used in batch.
Related concepts
“Using search arguments to filter data on DB2 Admin panels” on page 93
Related tasks
“Using Drop Impact Reports” on page 162

Changing/Allocating print data sets


Use the Change/Allocate Print Data Set panel to allocate a print data set for the
DB2 Admin print function.

Select option P on the Change DB2 Admin Settings panel to display the
Change/Allocate Print Data Set panel, as shown in the following figure.

Use this panel to allocate a print data set for the DB2 Admin print function.

DB2 Admin -------------- Change/Allocate Print Data Set ----------------- 00:27


Option ===>

Enter data set name and disposition:


Data set name ===>
Disposition ===> (NEW,OLD,MOD,FREE)

For a NEW data set enter:


Lrecl ===> 132 (8-32760)
Block size ===> 6204 (0-32760)
Format ===> (Fixed or Variable)
Space units ===> (Tracks, Cylinders or Blocks)
Primary space ===> (Default 1)
Sec. space ===> (Default 1)
Unit type ===> (Default SYSDA)

Figure 67. Change/Allocate Print Data Set panel (ADB2PP)

126 User's Guide and Reference


The fields on this panel are:
Enter data set name and disposition
Enter the name and allocation mode of the print data set, as described below.
Data set name
Enter the name of the data set that DB2 Admin should use for printing.
Disposition
Enter the allocation mode of the data set, which must be one of the
following values:
NEW
Allocate a new data set.
OLD
Use an existing data set.
MOD
Append output to an existing data set.
FREE
Deallocate print data set.
For a NEW data set enter:
For a new data set, the following parameters are required:
Lrecl
Specify the logical record length.
Block size
Specify the block size.
Format
Specify the data set format, which can be either F (for fixed) or V (for
variable) length records.
Space units
Specify the units in which space is to be allocated (tracks, cylinders, or
blocks).
Primary space
Specify the primary space allocation, specified in preceding units.
Sec. space
Specify the secondary space allocation, specified in preceding units.
Unit type
Specify the type of UNIT for allocation.

Changing DB2 Admin prompt options


Use the Prompt Options panel to change DB2 Admin prompt options.

Select option PR on the Change DB2 Admin Settings panel to display the Prompt
Options panel, as shown in the following figure. Use the Prompt Options panel to
change DB2 Admin prompt options. By turning on the prompt option, you are
prompted before certain SQL statements are run. Specify YES to activate prompting
on the options listed in the following figure.

Chapter 6. Setting DB2 Admin parameters 127


DB2 Admin ------------------------ Prompt Options ----------------------- 01:52
Option ===>

Change one or more options below. Prompt before executing:

Definition SQL (CREATE, DROP, ALTER, RENAME,.) ===> NO (Yes/No)

Authorization SQL (GRANT and REVOKE) ===> YES (Yes/No)

Update SQL (INSERT, UPDATE, DELETE) ===> NO (Yes/No)

DSN commands (BIND, REBIND and FREE) ===> NO (Yes/No)

DB2 commands (START, STOP, ALTER, SET) ===> NO (Yes/No)

Figure 68. Prompt Options panel (ADB2PRMT)

The fields on this panel are:


Definition SQL
Any SQL statement that changes the definition of an object, such as CREATE,
ALTER, DROP, and RENAME
Authorization SQL
GRANT and REVOKE SQL statements
Update SQL
INSERT, UPDATE, and DELETE statements
DSN commands
A DSN command statement, such as BIND, REBIND, or FREE
DB2 commands
A DB2 command that changes the state of an object or the system

When any of the prompt options are used, the Statement Execution Prompt panel
is displayed, as shown in the following figure. For example, in the previous figure,
prompting before running authorization statements is requested. The following
figure shows the prompt panel that is displayed before running a request to grant
load access to database TESTDB01.

DB2 Admin --------------- DB2X Statement Execution Prompt --------------- 11:46


Option ===>

DB2 Admin is about to execute the statement below. You have asked to be
prompted before DB2 Admin executes this type of statement. What do you want to
do now:
1 - Execute the statement
2 - Edit the statement
3 - Create a batch job with the statement
4 - Add the statement to the work statement list
CAN - Cancel
Work statement list dsn ===>
Work statement list name ===> Action ===> A (Append or Replace)
More: +
Statement that is about to be executed (first 28 lines):
GRANT LOAD
ON DATABASE TESTDB01
TO ISTJE

Figure 69. Statement Execution Prompt panel (ADB2PSTM) – granting authorizations

When more than one SQL statement is to be run, the message (add an A for all
stmts. For example 1A – Execute all stmts) is issued on the Statement
Execution Prompt panel, and the following additional options are available:

128 User's Guide and Reference


1A
Runs all statements.
3A
Runs all statements in batch mode.
4A
Adds all statements to a work statement list. If the action is append, the
statements are added to the end of the work statement list. If the action is
replace, the work statement list is erased and then the statements are added.
Related concepts
“Using DB2 Admin basic functions to create WSLs” on page 306

| Changing migrate settings


| Use the migrate function to change the parameter that controls whether space
| information is gathered and displayed in the Migrate Table Spaces panel (ADB28S).

| To change the parameter that controls whether space information is displayed:


| 1. Select option M on the Change DB2 Admin Settings panel. The Change Migrate
| Settings panel is displayed.
| 2. Specify YES or NO in the Show space information on panels field.
| Related tasks
| “Step 1. Specify the objects to migrate information” on page 293

Changing the SQL ID


DB2 uses the current SQL ID for the CREATE, GRANT, and REVOKE SQL
statements.

In all other cases, DB2 uses the composite privileges, that is, the combined
privileges of your current, primary, and secondary SQL IDs.

To change your current SQL ID:


1. Select option 4 on the Administration Menu panel. The Change Current SQL ID
panel is displayed, as shown in the following figure.

Chapter 6. Setting DB2 Admin parameters 129


DB2 Admin ---------------- DB2 Change Current SQL ID -- ROW 115 TO 131 OF 131
Command ===> Scroll ===> PAGE

Enter: Current:
New DB2 SQL ID ===> DB2 SQL ID: ISTJE

Or select one from the following list of secondary SQL IDs:

Secondary
S SQL ID
*
- --------
RAVUTS
RAVVB0
RAVW
RGEP
RGET
RGEULA
RGEULR
RGEUPA
RGEUPR
RGEUPS

Figure 70. Change Current SQL ID panel (ADB24)

2. Either enter a new SQL ID in the New DB2 SQL ID field or use the S line
command to select from the list of secondary SQL IDs. The list of secondary
SQL IDs is created by simulating or invoking the authorization exit in your
system. The SET CURRENT SQLID='sqlidname' command is issued to change
the current SQL ID.

Requirement: To change the current SQL ID to one that is not included in the
list of secondary SQL IDs, you must have SYSADM privilege.
The ID you choose remains in effect until you change it again.

130 User's Guide and Reference


Chapter 7. Querying the system catalog
This information briefly describes the main system catalog panel and how to use it
to query the DB2 system catalog.

Using these panels, you can perform the following tasks:


v Display any object in the DB2 catalog
v Display related DB2 objects using DB2 Admin line commands
v Interpret catalog information
v Show the authorizations for DB2 objects
v Display the static SQL statements from application plans and packages
v Display the DDL for existing views
v Generate JCL (job control language) for the DB2 utilities and then run them
online
v Execute dynamic SQL statements
v Issue DB2 commands (for databases and table spaces)
v Display database structures
v Reverse engineer DB2 objects
| v Generate reports about the DB2 objects that are saved in a printable format

Topics:
v “Using the System Catalog panel” on page 132
v “Using a copy of the DB2 catalog” on page 133
v “Selecting a copy of the DB2 catalog” on page 133
v “Creating reports from the DB2 catalog” on page 134
| v “Redefined columns in the DB2 catalog” on page 138
v “DB2 Admin restrictions on DB2 object names” on page 139
Related information
Chapter 25, “System catalog panels,” on page 545

© Copyright IBM Corp. 1995, 2010 131


Using the System Catalog panel
Use the System Catalog panel to display objects in the DB2 catalog, database
structures, and options for authorizations for objects in the catalog.

The System Catalog panel is displayed, as shown in the following figure, when
you select option 1 on the DB2 Administration Menu panel. If your display has
fewer than 32 rows, scroll down the panel to view all the rows.

Enter one of the object codes on the command line (for example, D for databases).
You can limit the information that is returned by entering one or more selection
criteria at the bottom of the panel. For example, D402 limits the search to databases
whose names begin with D402. In response to your choices, DB2 Admin creates and
executes an SQL statement that searches the DB2 catalog for the object or
authorization you have requested.

For optimum performance, specify selection criteria for the following:


v When using option T, enter a value for “Owner” or “In D/L/H” (database,
collection, or schema) to quicken the search.
v Option M can be time-consuming, depending on how many plans and DBRMs
you maintain.
v If you want to view only tables, you can use the TT option.

When you specify selection criteria, you can change from a LIKE search (a "fuzzy"
search) to an exact search, using an equal sign (=). You can use the LIKE ON and
LIKE OFF primary commands to toggle between a "fuzzy" search (LIKE ON) and
an exact search (LIKE OFF).

You can save (or not save) your search criteria between DB2 Admin sessions using
the SAVE ON and SAVE OFF primary commands. When the SAVE ON command
is active, the text criteria saved appears on the System Catalog panel. With SAVE
ON, the search criteria is restored when you re-enter a DB2 Admin session.

DB2 Admin --------------------- DB2X System Catalog --------------------- 18:14


Option ===>

More: +
Object options: DB2 System: DB2X
AO - Authorization options DB2 SQL ID: ISTJE
G - Storage groups P - Plans
D - Databases L - Collections
S - Table spaces K - Packages
T - Tables, views, and aliases M - DBRMs
V - Views H - Schemas
A - Aliases E - User defined data types
Y - Synonyms F - Functions
X - Indexes O - Stored procedures
C - Columns J - Triggers
N - Constraints Q - Sequences
DS - Database structures DSP - DS with plans and packages

Enter standard selection criteria (Using a LIKE operator, criteria not saved):
Name ===> > Grantor ===> >
Owner ===> > Grantee ===> >
In D/L/H ===> > Switch Catalog Copy ===> N (N/S/C)
And/or other selection criteria (option xC shows you columns for option x)
Column ===> > Operator ===> Value ===>

Figure 71. System Catalog panel (ADB21) – object options

132 User's Guide and Reference


To view the authorization options, choose the AO option. The authorization
options are shown in the following figure.

For optimum performance, specify selection criteria for all authorization options
(xA) and enter a value in the Grantor field or the Grantee field.

| DB2 Admin --------------------- DB2X System Catalog --------------------- 18:24


| Option ===>
|
| More: +
| Authorization options: DB2 System: DB2X
| OO - Object options DB2 SQL ID: ISTJE
| GA - Storage group auths PA - Plan authorizations
| DA - Database authorizations LA - Collection authorizations
| SA - Table space authorizations KA - Package authorizations
| TA - Table authorizations HA - Schema authorizations
| VA - View authorizations EA - User defined data type authorizations
| CA - Column authorizations FA - Function authorizations
| ZA - System authorizations OA - Stored procedure authorizations
| UA - User authorizations QA - Sequence authorizations
| RA - Resource authorizations TR - Trusted contexts
| RO - Roles
|
|
| Enter standard selection criteria (Using a LIKE operator, criteria not saved):
| Name ===> > Grantor ===> >
| Owner ===> > Grantee ===> >
| In D/L/H ===> > Switch Catalog Copy ===> N (N/S/C)
| And/or other selection criteria (option xC shows you columns for option x)
| Column ===> > Operator ===> Value ===>

Figure 72. System Catalog panel (ADB21) – authorization options

Related concepts
“Overview of reports” on page 134

Using a copy of the DB2 catalog


If your subsystem supports using multiple copies of the DB2 catalog, you can use
the System Catalog panel Switch Catalog Copy field at the bottom of the panel to
switch between copies of the catalog.

Valid values include:


N No change. Continue using the same catalog.
S Use the system catalog.
C Use a copy of the DB2 system catalog. When you choose this option, the
Select Copy of DB2 Catalog panel is displayed. On this panel, select a
catalog. The suffix xx in CCxx is the plan name suffix assigned to the copy.
In the heading of all subsequent system catalog panels, CCxx is displayed
instead of the DB2 subsystem name.
Related concepts
“Selecting a copy of the DB2 catalog”

Selecting a copy of the DB2 catalog


Use the System Catalog panel to select a copy of the DB2 catalog.

Chapter 7. Querying the system catalog 133


The Select Copy of DB2 Catalog panel is displayed, as shown in the following
figure, when you enter C on the Switch Catalog Copy line on the System Catalog
panel. The panel shows a list of copies of the DB2 system catalog; select one of
them by entering an S in front of the appropriate catalog.

DB2 Admin -------------- DB2X Select Copy of DB2 Catalog ----------------------


Command ===> Scroll ===> PAGE

DB2 Catalog Copy Version Selection: DB2 System: DB2X


DB2 SQL ID: ISTJE
S - Select an entry
Copy Planname
Select Timestamp Owner Suffix Type Location
* * * * *
------ -------------------------- -------- -------- ---- ----------------
2004-01-09-18.17.27.341202 COPY02 02 C
2004-01-20-14.49.07.032221 COPY01 01 C
? ALIES2 A2 A SYSTEM4A_DB2X
? ALIES6 A6 A SYSTEM4A_DB2X1
? COPY03 03 C
******************************* END OF DB2 DATA *************************

Figure 73. Select Copy of DB2 Catalog panel (ADB2CCS)

The panel includes the following columns:


Select Input field in which you enter the S line command to select a catalog.
Timestamp
Time when the copy of the catalog was last refreshed.
Copy Owner
The user ID that owns the catalog copy.
Planname Suffix
Suffix that identifies the catalog. When a copy of the DB2 catalog is used,
this suffix is used on the header of the system catalog panels instead of the
DB2 subsystem identifier.
Type Type of catalog. The catalog can be one of the following types:
A Alias of a (distributed) DB2 system catalog.
C Copy of the local DB2 system catalog.
Location
Name or location of the remote DB2 subsystem.
Related concepts
“Using a copy of the DB2 catalog” on page 133
Related information
Chapter 25, “System catalog panels,” on page 545

| Creating reports from the DB2 catalog


| You can create reports about the objects in the DB2 catalog that can be saved and
| printed.

| Overview of reports
| You can you can use the REP command to generate reports that can be saved and
| printed.

134 User's Guide and Reference


| When you use the system catalog panels to display information about the objects
| in the DB2 catalog, you can use the REP command to generate reports with
| information (that is similar to the displayed information) that can be saved and
| printed.

| Reviewing printed reports can be faster than stepping through the information
| online. Saving reports about your databases at various points in time also allows
| you to perform trend analysis, which enables you to manage your environment
| more efficiently and more proactively.

| When you issue the REP command, a panel is displayed that allows you to specify
| the content of the report. You choose which types of objects that you want
| included in the report. For example, for a database, you might want a report that
| lists the table spaces, tables, and indexes in the database. Or, for a group of
| schemas, you might want a report that lists the distinct types in each schema.

| After you specify the objects for the report, DB2 Admin generates JCL for a batch
| job that produces the report in a printable format. The batch job contains two
| steps. The first step invokes the GEN function to produce a version file for the
| objects that are to be included in the report. The second step formats the records in
| the version file into a report that is written to a data set.

| The generated report consists of the following sections:


| v A summary section that lists which types of objects are included in the report
| (the GEN parameters that were active when the data was collected).
| v A detailed report section for each type of object that is included in the report.
| Each detailed report section lists all of the occurrences of the particular object.
| The information that is provided for each object and the column headings are
| the same as what is displayed on the corresponding system catalog panel for the
| object.

| The following figure shows an example of the summary section of the report:
|
| ADB2GEN parameters active when this data was collected :
|
| Create Database(s) : Yes Create Tablespace(s) : Yes Create Table(s) : Yes
| Create View(s) : No Create Index(es) : No Create Synonym(s) : No
| Create Alias(es) : No Create Label(s) : No
| Create Triigers : No also for refs not gen'd : No
| Create Foreign key(s) : No also for refs not gen'd : No
| Create User def. Types : No Create Functions : No Create Stored Procedures: No
|
| Column information will not be included in this report.
|
| Figure 74. Example of the summary section
|
| The following figure shows an example of a detailed report section for table
| spaces:
|

Chapter 7. Querying the system catalog 135


| Name DB Name Parts Bpool L E S I C Tables Act. pages Segsz T L
| * * * * * * * * * * * * * *
| -------- -------- ------ ------ - - - - - ------ ----------- ------ - -
| SYSALTER DSNDB06 0 BP32K P N A N N 2 44 4 Y
| SYSCOPY DSNDB06 0 BP0 A N A N N 2 720 0 Y
| SYSDBASE DSNDB06 0 BP8K0 A N A N N 14 8280 0 Y
| SYSDBAUT DSNDB06 0 BP0 A N A N N 4 84 0 Y
| SYSDDF DSNDB06 0 BP0 P N A N N 8 38 4 Y
| SYSEBCDC DSNDB06 0 BP0 P N A N N 1 12 4 Y
| SYSGPAUT DSNDB06 0 BP0 A N A N N 1 720 0 Y
| SYSGROUP DSNDB06 0 BP0 A N A N N 2 24 0 Y
| SYSGRTNS DSNDB06 0 BP8K0 R N A N N 2 24 4 Y
| SYSHIST DSNDB06 0 BP8K0 R N A N N 9 144 4 Y
| SYSJAUXA DSNDB06 0 BP0 L N A N N 1 288 0 O Y
| SYSJAUXB DSNDB06 0 BP0 L N A N N 1 1008 0 O Y
|
| Figure 75. Example of a detailed report section - table spaces
|
| Related concepts
| “Using the System Catalog panel” on page 132
| Related information
| Chapter 25, “System catalog panels,” on page 545

| Generating a report
| You can generate reports that can be saved and printed.

| To generate a report:
| 1. From the DB2 Admin Main Menu, specify option 1 to display the System
| Catalog panel.
| 2. Select one of the options that supports the ability to specify the REP command
| to generate a report. The following options support the ability to specify the
| REP command to generate a report:
| v Databases (option D)
| v Table Spaces (option S)
| v Tables, Views, and Aliases (option T)
| v Aliases (option A)
| v Synonyms (option Y)
| v Schemas (option H)
| v Data (or Distinct) Types (option E)
| v Functions (option F)
| v Storage Groups (option G)
| v Stored Procedures (option O)
| v Triggers (option J)
| v Sequences (option Q)
| You can use the fields at the bottom of the panel to specify search criteria to
| filter or limit the number of objects that are displayed.
| 3. Generate a report.
| v To generate a report for the single object, issue the REP line command.
| v To generate a report for all of the listed objects, issue the REP primary
| command.
| The following figure shows the REP command being issued against a database.
|

136 User's Guide and Reference


| DB2 Admin ------------------- DB2X Databases ---------------------- Row 1 of 4
| Command ===> Scroll ===> PAGE
|
| Commands: GRANT MIG DIS STA STO UTIL
| Line commands:
| T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
| DIS - Display database STA - Start database STO - Stop database A - Auth
| ? - Show all line commands
| Storage Buffer Created Index
| Select Name Owner Group Pool DBID By T E Buffer Pool
| * * * * * * * * *
| ------ -------- -------- -------- -------- ------ -------- - - -----------
| DSNATPDB DB2ADM SYSDEFLT BP0 260 ISTJ E BP2
| DSNDB04 SYSIBM SYSDEFLT BP0 4 SYSIBM BP0
| REP DSNDB06 SYSIBM SYSDEFLT BP0 6 SYSIBM E BP0
| DSN8D81A DB2ADM DSN8G810 BP0 258 ISTJ E BP2
| DSN8D81P DB2ADM DSN8G810 BP0 259 ISTJ M E BP2
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 76. Databases panel (ADB21D) - Example of issuing the REP command to generate a
| report

| When you use either the REP line command or the REP primary command, the
| Generate Report from DB2 Catalog panel, as shown in the following figure, is
| displayed. The Generate Report from DB2 Catalog panel that is displayed
| (ADB2REP, ADB2REPS, or ADB2REP6) and the fields that are included on the
| panel depend on the type of object that the REP command was issued for.
| 4. Fill in the fields on the Generate Report from DB2 catalog panel and press
| Enter.
| 5. Use the panel to specify the following items:
| v The types objects that you want included in the report. Specify Y for each
| object type that you want. For triggers, specify D to include triggers that refer
| to extracted tables.
| v Whether to have the column properties for objects that have associated
| columns included in the report. This field is displayed only when it is
| applicable.
| v The data set information for the report output.
|

Chapter 7. Querying the system catalog 137


| DB2 Admin ------------ DB2X Generate Report from DB2 Catalog ------------ 13:24
| Option ===>
|
| Generate batch report for database DSNDB06 DB2 System: DB2X
| DB2 SQL ID: ISTJ
| More: +
| Object types to be included from the DB2 catalog:
| Database . . . . . . . . . Y (Y,N)
| Table space . . . . . . . Y (Y,N)
| Table . . . . . . . . . . Y (Y,N)
| View . . . . . . . . . . . N (Y,N)
| Index . . . . . . . . . . N (Y,N)
| Synonym . . . . . . . . . N (Y,N)
| Alias . . . . . . . . . . N (Y,N)
| Trigger . . . . . . . . . N (Y,N,D)
| Storage group . . . . . . N (Y,N)
| Plan/package . . . . . . . N (Y,N)
|
| Include column data . . . . Y (Y,N)
|
| Output file:
| Data set name . . . . . . 'USER.DB0024.REPORT' >
| Data set disposition . . OLD (OLD, SHR, or MOD)
|
| BP - Change batch job parameters
|
|
| Figure 77. Generate Report from DB2 Catalog panel (ADB2REP)
|
| The batch jobs to create the report are generated, and an ISPF Edit session is
| displayed.
| 6. Verify and submit the generated jobs. The report is created in a printed format
| and written to the data set that was specified.

| You are now ready to print the data set with the carriage control and rotate
| options specified to review the report.

| Redefined columns in the DB2 catalog


| DB2 Admin puts integers in the INTEGER column to improve readability.

| In some DB2 catalog tables, when a column with an INTEGER data type became
| too small to hold large values, DB2 added a corresponding column with a FLOAT
| data type to the catalog table to replace the INTEGER column. For example,
| CARDF was added for CARD in SYSTABLES, and FIRSTKEYCARDF was added
| for FIRSTKEYCARD in SYSINDEX. The DB2 SQL Reference shows that the
| INTEGER version of the column is no longer used. When the catalog table is
| queried by using SPUFI (SELECT *), the value for the unused column might be
| displayed as 0 or -1.

| DB2 Admin handles these pairs of INTEGER and FLOAT columns differently than
| DB2 does. For readability, DB2 Admin displays the integer equivalent of the value
| that is in the FLOAT column in the INTEGER column if the value fits. If the value
| is too large, DB2 Admin displays 11 asterisks instead.

| The following columns contain the corresponding integer value of the floating
| point column when the floating point column also is present in the SELECT list:
| v CARD
| v COLCARD
| v FIRSTKEYCARD
| v FULLKEYCARD

138 User's Guide and Reference


| v FREQUENCY
| v FAROFFPOS
| v NEAROFFPOS
| v NACTIVE
| v NPAGES
| v SPACE
| v KEYCOUNT
| v CLUSTERRATIO

| In addition, the integer columns must be returned by DB2 as INTEGER NOT


| NULL.

| Within a SELECT in DB2 Admin, use one of the following methods to get the real
| value from the DB2 catalog:
| v Do not specify both the integer and floating point column in the SELECT list.
| v Rename one of the columns in the SELECT list by using AS, for example,
| SELECT CARD AS MYCARD.
| v Change the data type in the result, for example, SELECT
| DECIMAL(COLCARD,11,0)

| DB2 Admin restrictions on DB2 object names


| There are two DB2 Admin restrictions on DB2 object names.

| DB2 Admin puts two restrictions on DB2 object names. Do not use:
| v Object names that contain Unicode characters that cannot be translated into the
| EBCDIC CCSID that DB2 Admin is using.
| v Object names that contain an apostrophe (').

| Object names that contain these characters can be displayed, but when a line
| command is used with either of the restricted object names, an error (SQLCODE
| -104) or warning message might be displayed.
| Related reference
| “DB2 Admin line commands” on page 617

Chapter 7. Querying the system catalog 139


140 User's Guide and Reference
Chapter 8. Building and running SQL statements
DB2 Admin can issue, build, and run SQL statements.

This information describes how to use DB2 Admin to perform the following tasks:
v Issue dynamic SQL statements from your screen, from a data set, or from
program file
v Build and run SQL SELECT, INSERT, UPDATE, and DELETE statements
interactively by using line commands
v Run the following SQL statements by entering required parameters: CREATE,
DROP, LABEL ON, COMMENT ON, GRANT, and REVOKE
The two panels for this function are also used from the system catalog panels,
where they are shown when a line command is issued against an object. When
invoked in this way, the object names contain the object name from the catalog.

Topics:
v “Selecting a method for building and running SQL statements” on page
142
v “Running SQL statements from screen input” on page 143
v “Running SQL statements from a data set” on page 144
v “Running or explaining SQL statements from a program file” on page
144
v “Building SQL SELECT, INSERT, UPDATE and DELETE prototypes” on
page 147
v “Issuing CREATE, DROP, LABEL ON, and COMMENT ON statements”
on page 152
v “Granting and revoking privileges on objects panel” on page 167
v “Revoking system authority from an SQLID” on page 168
Related concepts
“DB2 Administration Menu panel” on page 97

© Copyright IBM Corp. 1995, 2010 141


Selecting a method for building and running SQL statements
Use the Execute SQL Statements panel to choose how you want to build and run
SQL statements.

To use the Execute SQL Statements panel to choose how you want to build and
run SQL statements:
1. Select option 2 on the Administration Menu panel. The Execute SQL Statements
panel is displayed, as shown in the following figure,

DB2 Admin -------------------- Execute SQL Statements ------------------- 01:36


Option ===>

1 - Execute SQL statements from screen input DB2 System: DB2X


2 - Run or Explain SQL statements DB2 SQL ID: ISTJE
3 - Build SQL SELECT, INSERT, UPDATE or DELETE prototype
4 - Create/drop/label/comment on objects
5 - Grant/revoke privileges on objects

Figure 78. Execute SQL Statements panel (ADB22)

2. Select one of the following options:


1 - Execute SQL statements from screen input
Select this option to run SQL statements from your screen.
2 - Run or Explain SQL statements
Select this option to run SQL statements from a data set or to run or
explain an SQL statement from a program file. When you use a data
set, you can edit the SQL statements by using the ISPF editor, save the
edited statements, and run the statements later. When you use a
program file, you can select one SQL statement at a time to run or
explain.
3 - Build SQL SELECT, INSERT, UPDATE or DELETE prototype
Select this option to build and run an SQL SELECT, INSERT, UPDATE
or DELETE statement. The statement is built interactively using line
commands.
4 - Create/drop/label/comment on objects
Select this option to run one of the following SQL statements: CREATE,
DROP, LABEL ON, or COMMENT ON.
5 - Grant/revoke privileges on objects
Select this option to run GRANT and REVOKE SQL statements.

142 User's Guide and Reference


Related concepts
“Issuing CREATE, DROP, LABEL ON, and COMMENT ON statements” on page
152
Related tasks
“Running SQL statements from screen input”
“Running SQL statements from a data set” on page 144
“Building SQL SELECT, INSERT, UPDATE and DELETE prototypes” on page 147
“Granting and revoking privileges on objects panel” on page 167

Running SQL statements from screen input


You can enter free-form SQL statements on your screen and run them.

To run SQL statements from screen input:


1. Select option 1 on the Execute SQL Statements panel. The Execute SQL
Statements from Screen Input panel is displayed, as shown in the following
figure.

DB2 Admin ----------- Execute SQL Statements from Screen Input ---------- 01:36
Command ===>

DB2 System: DB2X


SQL statement: DB2 SQL ID: ISTJE
SELECT * FROM SYSIBM.SYSTABLES WHERE CREATOR='SYSIBM'

Press ENTER to execute the SQL statement, or enter EDIT on the command line to
edit it. Use command CAPS (OFF/ON) to change the caps mode.

Figure 79. Execute SQL Statements from Screen Input panel (ADB221)

2. Type your SQL statements in the SQL statement field using free form. Separate
each SQL statement with a semicolon (;).
3. Press Enter to run your SQL statements. DB2 Admin runs SQL statements one
at a time.
4. Press Enter to issue subsequent SQL statements.

If an SQL SELECT statement returns rows, the result is shown on the default table
display panel.

You can edit an SQL statement by entering EDIT on the command line.

By default, any SQL statement that you enter is converted to uppercase. To disable
this, use the CAPS OFF primary command.

Chapter 8. Building and running SQL statements 143


Related tasks
“Selecting a method for building and running SQL statements” on page 142

Running SQL statements from a data set


You can run SQL statements that are stored in a data set.

To run SQL statements that are stored in a data set:


1. Select option 2 on the Execute SQL Statements panel. The Run or Explain SQL
Statements panel is displayed, as shown in the following figure.

DB2 Admin ---------------- Run or Explain SQL Statements ---------------- 17:44


Option ===>

1 - Run SQL statements from a data set DB2 System: DB2X


EDIT first ===> YES (Yes/No) DB2 SQL ID: ISTJE
2 - Run or Explain SQL located in a program
Program type ===> (1=COBOL, 2=PL/I)

ISPF library:
Project ===>
Group ===> ===> ===> ===>
Type ===>
Member ===> (blank for member selection list)

Other partitioned or sequential data set:


Data Set Name ===>
Volume Serial ===> (if not cataloged)

Alternative pre-allocated DD name:


DD name ===> (use ddname(member) for members)

Figure 80. Run or Explain SQL Statements panel (ADB222)

2. Select option 1 to run the SQL statements from a data set.


3. Specify the data set name that contains the SQL statements that you want to
run. The input data set can be specified as:
v An ISPF library
v A partitioned or sequential data set
v A pre-allocated ddname
4. Run the SQL statement.
v If you specify Yes in the EDIT first field and press Enter, the SQL statements
are placed in ISPF edit mode on the specified data set before running them.
You can then edit the statements. Press End in the edit session to run the
SQL statements.
v If you specify No in the EDIT first field, press Enter to run the SQL
statements.
If the total size of the data set exceeds 2 MB, DB2 Admin issues an error
message that indicates that the SQL statement is too long.
Related tasks
“Selecting a method for building and running SQL statements” on page 142

Running or explaining SQL statements from a program file


You can run or explain SQL statements that are in a program file.

To run or explain SQL statements that are in a program file:

144 User's Guide and Reference


1. Select option 2 on the Execute SQL Statements panel The Run or Explain SQL
Statements panel is displayed, as shown in the following figure.

DB2 Admin ---------------- Run or Explain SQL Statements ---------------- 17:44


Option ===>

1 - Run SQL statements from a data set DB2 System: DB2X


EDIT first ===> (Yes/No) DB2 SQL ID: ISTJE
2 - Run or Explain SQL located in a program
Program type ===> 1 (1=COBOL, 2=PL/I)

ISPF library:
Project ===>
Group ===> ===> ===> ===>
Type ===>
Member ===> (blank for member selection list)

Other partitioned or sequential data set:


Data Set Name ===>
Volume Serial ===> (if not cataloged)

Alternative pre-allocated DD name:


DD name ===> (use ddname(member) for members)

Figure 81. Execute SQL Statements from a Data Set panel (ADB222)

2. Select option 2 to specify that the SQL statements to run or explain are in a
program file and specify the type of program. The types are:
1 COBOL
2 PL/I
If you specify the program type as a parameter when you issue the RUN or
EXPLAIN primary command for the SQL statement, the parameter for the type
overrides the value that is set in the Program type field.
3. Specify the data set name that contains the program. The input data set can be
specified as:
v An ISPF library
v A partitioned or sequential data set
v A pre-allocated ddname
4. Press Enter to display the program file, as shown in the following figure.

Chapter 8. Building and running SQL statements 145


ISREDDE2 ELACZ.TEST.SQLSTMT(TEST) - 01.16 Columns 00001 00080
Command ===> Scroll ===> PAGE
****** ********************************* Top of Data **********************************
==MSG>
==MSG> Use the line command "C" or block command "CC" to select
==MSG> an SQL statement.
==MSG> Use the primary command "EXPLAIN" to explain or "RUN" to run
==MSG> the selected SQL statement.
==MSG>
000001 ------------------------------------------------------------------------
:
000010 --
000011 EXEC SQL
000012 SELECT NAME,
000013 TBNAME,
000014 TBCREATOR,
000015 COLNO,
000016 COLTYPE,
000017 FROM SYSIBM.SYSCOLUMNS
000018 WHERE TBNAME = :TBN
000019 AND TBCREATOR = :TBC
000020 ORDER BY NAME, TBNAME;
****** ******************************** Bottom of Data ********************************

Figure 82. Example of selecting SQL statements in a program to run or explain

5. Use the C line command or the CC block command to select the SQL statement
to run or explain. Only one SQL statement can be selected at a time.

Restriction: The following SQL statements cannot be run or explained:


v ALLOCATE CURSOR
v ASSOCIATE LOCATOR
v BEGIN DECLARE SECTION and END DECLARE SECTION
v CALL
v CLOSE
v CONNECT
v DECLARE STATEMENT, DECLARE TABLE, DECLARE
VARIABLE
v all DESCRIBE statements
v EXECUTE and EXECUTE IMMEDIATE
v FETCH
v FREE LOCATOR and HOLD LOCATOR
v INCLUDE
v OPEN
v PREPARE
v SIGNAL SQLSTATE
v VALUES
v WHENEVER
v --#SET ROWS_FETCH, --#SET ROWS_OUT, --#SET
TERMINATOR
6. Issue the RUN primary command to run the statement or the EXPLAIN
primary command to explain the statement.
7. Specify the values for every host variable in the SQL statement in the
pop-window that is displayed. Enter the values for character host variables in
single quotation marks. If you leave the value of host variable blank, the host
variable is removed from the statement.
8. Exit the edit session to have the primary command executed.

146 User's Guide and Reference


Tip: If you have changed the selected statement but do not want to save the
changes in the program file, choose CANCEL when you are prompted to
exit the edit session. The updated statement is executed, but the program
file is not changed.
Related tasks
“Building SQL SELECT, INSERT, UPDATE and DELETE prototypes”

Building SQL SELECT, INSERT, UPDATE and DELETE prototypes


You can build SQL SELECT, INSERT, UPDATE and DELETE prototypes
interactively by using DB2 Admin line commands.

Because prototyping is similar for each of the SQL statements covered by this
option, this information describes only how to build the SELECT statement.

To build SQL SELECT, INSERT, UPDATE and DELETE prototypes:


1. Select option 3 on the Execute SQL Statements panel to display the Build SQL
SELECT, INSERT, UPDATE or DELETE Prototype panel. Use this panel to
search for the object (table, view, or alias) for which you want to build and run
an SQL SELECT, DELETE, INSERT, or UPDATE statement.

| ADB223 in ------------- Build SQL Prototype: Search Objects ------------- 06:22


| Command ===> _________________________________________________________________
|
| Enter/verify:
| Schema . . . ________ > (optional, default is SMITHJR)
| Name . . . . __________________ > (optional)
|
|
| Figure 83. Build SQL SELECT Prototype panel (ADB223)
|
| 2. Enter the Schema or Name of the object.
3. Press Enter to display a list of objects that match the search criteria, as shown
in the following figure.

Chapter 8. Building and running SQL statements 147


| ADB223T n ----------- DB2X Tables, Views, and Aliases -------- Row 1 to 7 of 7
| Command ===> Scroll ===> PAGE
|
| Line commands:
| SEL - Select for SQL SELECT prototype T - Table
| DEL - DELETE prototype INS - INSERT prototype UPD - UPDATE prototype
|
| Select Name Schema T
| * * *
| ------- -----------------> -------- -
| _______ AA1122 OWNER1 T
| _______ AARVV1145600_ANDR OWNER1 T
| _______ EEMP DSN8810 T
| _______ EEPA DSN8810 T
| __SEL__ EMP DSN8810 T
| _______ EMPPROJACT DSN8810 T
| _______ EPROJ DSN8810 T
| _______ EPROJACT DSN8810 T
| _______ MAP_TBL DSN8810 T
| _______ NEWDEPT DSN8810 T
| _______ NEWPHONE DSN8810 T
| _______ PARTS DSN8810 T
| _______ PROJ DSN8810 T
| _______ PROJACT DSN8810 T
| _______ STAFF DSN881SA T
| _______ STAFFV1 DSN881SA V
| _______ TCONA DSN8810 T
| _______ TDSPTXT DSN8810 T
| _______ TESTSTUFF DSN881SA T
| _______ TOPTVAL DSN8810 T
| _______ VACT DSN8810 V
| _______ VASTRDE1 DSN8810 V
| _______ VASTRDE2 DSN8810 V
| _______ VCONA DSN8810 V
| _______ VDEPMG1 DSN8810 V
| _______ VDEPT DSN8810 V
| _______ VDSPTXT DSN8810 V
| _______ VEMP DSN8810 V
||
| Figure 84. Example of building an SQL SELECT statement (part 1 of 5) (ADB223T)
|
4. Build your SQL statement by using line commands. For example, if you want
to build an SQL SELECT statement that returns the name and department
number of all employees with a salary greater than $30,000, begin by using the
SEL line command to select the table that contains the desired information. The
previous figure shows that the EMP is selected. When you press Enter, DB2
Admin displays the panel in the following figure, which shows the partially
built SQL statement at the top.

148 User's Guide and Reference


DB2 Admin --------- DB2X Build SQL SELECT Prototype -------------- Row 1 of 14
Command ===> Scroll ===> PAGE

SELECT ?
FROM DSN8810.EMP T
WHERE ?
ORDER BY ?
GROUP BY ?
Commands: EDIT RESET * QUOTE INS UPD DEL COUNT COUNT_BIG
Line commands: S - Show SA - Show ASC SD - Show DESC
AVG, COUNT, COUNT_BIG, MAX, MIN, STDDEV, SUM, VARIANCE - Aggregate functions
<oper><expr>, OR <pred>, IN list, BETWEEN <expr>,<expr> - WHERE predicates
Select Column Name Col Type Length
* * *
---------------------------------- ------------------ -------- -----------
EMPNO CHAR 6
S FIRSTNME VARCHAR 12
S MIDINIT CHAR 1
S LASTNAME VARCHAR 15
S WORKDEPT CHAR 3
PHONENO CHAR 4
HIREDATE DATE 10
JOB CHAR 8
EDLEVEL SMALLINT 2
SEX CHAR 1
BIRTHDATE DATE 10
>30000 SALARY DECIMAL 9
BONUS DECIMAL 9
COMM DECIMAL 9
******************************* END OF DB2 DATA ******************************

Figure 85. Example of building an SQL SELECT statement (part 2 of 5) (ADB21TSE)

The following primary commands are available:


EDIT
Edit the query. Editing does not change the SQL statement on the panel.
RESET
Reset the query.
* (asterisk)
Show all columns in the result.
QUOTE
Place column names in quotes.
INS
Insert statement prototype. Not applicable to creating a view.
UPD
Update statement prototype. Not applicable to creating a view.
DEL
Delete statement prototype. Not applicable to creating a view.
COUNT(*)
Count distinct for this column returns integer value.
COUNT_BIG(*)
Count distinct for this column returns decimal value.
The following line commands are available:
S Show the column in the result.
SA
Show the column in the result and sort ascending. Not applicable to
creating a view.

Chapter 8. Building and running SQL statements 149


SD
Show the column in the result and sort descending. Not applicable to
creating a view.
AVG
Return average value for the numeric column.
COUNT
Count distinct for this column returns integer value.
COUNT_BIG
Count distinct for this column returns decimal value.
MAX
Return maximum value for the numeric column.
MIN
Return minimum value for the numeric column.
STDDEV
Return the standard deviation for the numeric column.
SUM
Returns the sum of the selected columns.
VARIANCE
Return the variance of a set of numbers from selected columns.
The WHERE predicate can be:
<oper><expr>
where:
<oper>
Adds a predicate (WHERE clause) for this column with this
operator. <oper> can be: =, ¬=, >, >=, <, <=, or LIKE.
<expr>
Right side of predicate, consisting of an alphanumeric value.
OR <pred>,
Examples:
OR=1O
R=x
OR IN(1,2,3,4,5)
OR BETWEEN s,t
IN list
Examples:
IN x,y
IN('x','y')
IN 1,2,3,4,5,6
BETWEEN <expr>, <expr>
Examples:
BTW x,y
BETWEEN x AND y
BTW nnn,ppp
For this scenario, use the S line command to include columns in your SELECT
statement, and use the <oper><expr> line command to specify the salary range
of 30,000.
Press Enter to run the line commands and to update the SELECT statement, as
shown in the following figure.

150 User's Guide and Reference


DB2 Admin --------- DB2X Build SQL SELECT Prototype -------------- Row 1 of 14
Command ===> Scroll ===> PAGE

SELECT FIRSTNME,MIDINIT,LASTNAME,WORKDEPT,SALARY
FROM DSN8810.EMP T
WHERE SALARY>30000
ORDER BY ?
GROUP BY ?
Commands: EDIT RESET * QUOTE INS UPD DEL COUNT COUNT_BIG
Line commands: S - Show SA - Show ASC SD - Show DESC
AVG, COUNT, COUNT_BIG, MAX, MIN, STDDEV, SUM, VARIANCE - Aggregate functions
<oper><expr>, OR <pred>, IN list, BETWEEN <expr>,<expr> - WHERE predicates
Select Column Name Col Type Length
* * *
---------------------------------- ------------------ -------- -----------
EMPNO CHAR 6
*S FIRSTNME VARCHAR 12
*S MIDINIT CHAR 1
*S LASTNAME VARCHAR 15
*S WORKDEPT CHAR 3
PHONENO CHAR 4
HIREDATE DATE 10
JOB CHAR 8
EDLEVEL SMALLINT 2
SEX CHAR 1
BIRTHDATE DATE 10
SD SALARY DECIMAL 9
BONUS DECIMAL 9
COMM DECIMAL 9
******************************* END OF DB2 DATA *******************************

Figure 86. Example of building an SQL SELECT statement (part 3 of 5) (ADB21TSE)

Use the SD line command, as shown in the previous figure, to add the ORDER
BY clause to the SELECT statement. When you press Enter, the SELECT
statement is updated and displayed, as shown in the following figure.

DB2 Admin --------- DB2X Build SQL SELECT Prototype -------------- Row 1 of 14
Command ===> Scroll ===> PAGE

SELECT FIRSTNME,MIDINIT,LASTNAME,WORKDEPT,SALARY
FROM DSN8810.EMP T
WHERE SALARY>30000
ORDER BY SALARY DESC
GROUP BY ?
Commands: EDIT RESET * QUOTE INS UPD DEL COUNT COUNT_BIG
Line commands: S - Show SA - Show ASC SD - Show DESC
AVG, COUNT, COUNT_BIG, MAX, MIN, STDDEV, SUM, VARIANCE - Aggregate functions
<oper><expr>, OR <pred>, IN list, BETWEEN <expr>,<expr> - WHERE predicates
Select Column Name Col Type Length
* * *
---------------------------------- ------------------ -------- -----------
EMPNO CHAR 6
FIRSTNME VARCHAR 12
MIDINIT CHAR 1
LASTNAME VARCHAR 15
WORKDEPT CHAR 3
PHONENO CHAR 4
HIREDATE DATE 10
JOB CHAR 8
EDLEVEL SMALLINT 2
SEX CHAR 1
BIRTHDATE DATE 10
*SD SALARY DECIMAL 9
BONUS DECIMAL 9
COMM DECIMAL 9
******************************* END OF DB2 DATA *******************************

Figure 87. Example of building an SQL SELECT statement (part 4 of 5) (ADB21TSE)

Chapter 8. Building and running SQL statements 151


The SQL statement is now ready to be run. Do not specify any line commands
when running the statement. When you press Enter, the result is displayed, as
shown in the following figure.

DB2 Admin -------------- DB2 Result of the SQL SELECT ------------- Row 1 of 8
Command ===> Scroll ===> PAGE

L FIRSTNME MIDINIT LASTNAME WORKDEPT SALARY


* * * * *
- ------------ ------- --------------- -------- -----------
CHRISTINE I HAAS A00 52750.00
DIAN J HEMMINGER A00 46500.00
VINCENZO G LUCCHESI A00 46500.00
MICHAEL L THOMPSON B01 41250.00
JOHN B GEYER E01 40175.00
SALLY A KWAN C01 38250.00
EVA D PULASKI D21 36170.00
IRVING F STERN D11 32250.00
******************************* END OF DB2 DATA *******************************

Figure 88. Example of building an SQL SELECT statement (part 5 of 5) (ADB2DF)

You can also perform SQL prototyping by using the Create View panel
(ADB26CV), as shown in the following figure.
You can use the EDIT command to capture the SELECT statement and store it
in a data set.

DB2 Admin ----------------------- DB2X Create View ---------------------- 10:4


Command ===>

CREATE VIEW
Owner ===> > (optional, default is ISTJE)
Name ===> > (? to look up)
( (optional column list)
Col names ===>

) AS (? to use SELECT prototype)


SELECT stmt===>

WITH ? CHECK OPTION (check INSERTS/UPDATES with VIEW definition)


Check opt ===> (Y-include, N-omit, blank-omit (default),
C-CASCADED, L-LOCAL)

Figure 89. SQL prototyping on the Create View panel (ADB26CV)

Related tasks
“Selecting a method for building and running SQL statements” on page 142
“Running or explaining SQL statements from a program file” on page 144

Issuing CREATE, DROP, LABEL ON, and COMMENT ON statements


Use the Execute SQL Statements panel to issue CREATE, DROP, LABEL ON, and
COMMENT ON statements.

Select option 4 on the Execute SQL Statements panel to display the


Create/Drop/Label/Comment On Objects panel, as shown in the following figure.

152 User's Guide and Reference


Use this panel to issue CREATE, DROP, LABEL ON, and COMMENT ON
statements.

Restriction: When creating SQL scalar functions, the maximum length of the
return statement is 2MB (32,767KB). When creating SQL stored
procedures, the maximum length of the procedure body is 2MB
(32,767KB).

| DB2 Admin ---------- DB2X Create/Drop/Label/Comment On Objects ---------- 01:40


| Option ===>
|
|
| DB2 System: DB2X
| CREATE DROP DB2 SQL ID: ISTJE
| CG - Storage group DG - Storage group
| CD - Database DD - Database
| CS - Table space DS - Table space
| CT - Table DT - Table
| CV - View DV - View
| CL - Alias DL - Alias
| CX - Index DX - Index
| CY - Synonym DY - Synonym
| CA - Auxiliary table
| CE - Distinct type DE - Distinct type
| CJ - Trigger DJ - Trigger
| CF - Function DF - Function
| CO - Stored procedure DO - Stored procedure
| CM - Materialized table DQ - Sequence
| CQ - Sequence
| CTR - Trusted context DTR - Trusted context
| CRO - Role DRO - Role
| LABEL COMMENT (remark)
| LT - Table/view RT - Table
| LL - Alias RL - Alias
| LC - Column RC - Column
| RE - Distinct type
| RF - Function
| RO - Stored procedure
| RJ - Trigger
| RX - Index
| RQ - Sequence
| RTR - Trusted Context
| RRO - Role
||
| Figure 90. Create/Drop/Label/Comment On Objects panel (ADB26)
|
You can use this panel to perform the following tasks:
v Create a database
v Create a table space
v Create a table
v Create a materialized query table
v Create an index
v Place a label on a table
v Comment on a table
v Drop a table and use Drop Impact Reports
| v Create, drop, or comment on a trusted context
| v Create, drop, or comment on a role

You can use these examples as models when using this panel to issue other
statements.

Chapter 8. Building and running SQL statements 153


Related tasks
“Selecting a method for building and running SQL statements” on page 142

Creating a database
Use the Create Database panel to create a new database.

To create a new database:


1. Select option CD on the Create/Drop/Label/Comment On Objects panel. The
Create Database panel is displayed, as shown in the following figure.

DB2 Admin --------------------- DSNX Create Database -------------------- 17:45


Command ===>

CREATE

DATABASE ===> (required database name. ? to look up existing)

STOGROUP ===> > (optional: default is SYSDEFLT. ? to look up)

BUFFERPOOL ===> (optional: default is defined during installation)

INDEXBP ===> (optional: default is defined during installation)

CCSID ===> (optional: ASCII/EBCDIC/UNICODE)

AS WORKFILE ===> (Yes/No, only for data sharing environments)

AS TEMP ===> (Yes/No, to create DB for declared temporary table

FOR MEMBER ===> (optional: default is current connected member)

Figure 91. The Create Database panel (ADB26CD)

2. Specify the following values:


v In the DATABASE field, enter a database name for the new database, or
enter a question mark (?) to look up existing database names using the
Databases panel.
v Optional: In the STOGROUP field, specify the name of a storage group in
which you want the new database to belong.\
v Optional: In the BUFFERPOOL and INDEXBP fields, enter the names of
buffer pools to use (as defined at installation time).
v Optional: In the CCSID field, enter one of the following formats: ASCII,
EBCDIC, or UNICODE.
v Optional: In the AS WORKFILE field, enter a work file name for data
sharing environments.
3. In the AS TEMP field, specify whether to create a database for declared
temporary tables.
4. In the FOR MEMBER field, specify a different member in which to place the
new database.
5. Follow the instructions on the Statement Execution Prompt panel (if enabled),
as shown in the following figure, to complete and run the SQL statement for
creating the new database.

154 User's Guide and Reference


DB2 Admin --------------- DSNX Statement Execution Prompt --------------- 18:10
Option ===>

DB2 Admin is about to execute the statement below. You have asked to be
prompted before DB2 Admin executes this type of statement. What do you want to
do now:
1 - Execute the statement
2 - Edit the statement
3 - Create a batch job with the statement
4 - Add the statement to the work statement list
CAN - Cancel
Work statement list dsn ===>
Work statement list name ===> Action ===> A (Append or Replace)
More: +
Statement that is about to be executed (first 28 lines):
CREATE DATABASE "DBTEST01"

Figure 92. The Statement Execution Prompt panel (ADB2PSTM) – Creating a new database

Related reference
“Option D. Databases” on page 555

Creating a table space


Use the Create Table Space panel to create a new table space in a database.

To create a new table space in a database:


1. Select option CS on the Create/Drop/Label/Comment On Objects panel. The
Create Table Space panel is displayed, as shown in the following figure.

| ADB26CS n -------------------DB2X Create Table Space ------------------- 06:28


| Command ===> __________________________________________________________________
|
| CREATE
|
| TABLESPACE . . FGRTS (required table space name. ? to look up)
|
| IN . . . . . . FGRDB (optional database. default=DSNDB04. ? to look up)
|
| Like:
| Database . . . ________ (optional existing database. ? to look up)
| Name . . . . . ________ (optional existing table space. ? to look up)
||
| Figure 93. The Create Table Space panel (ADB26CS)
|
2. Specify the following values:
v In the TABLESPACE field, enter a table space name for the new table space,
or enter a question mark (?) to look up existing table space names using the
Table Spaces panel.
v Optional: In the IN field, specify the name of a database in which you want
the new table space created, or enter a question mark (?) to look up existing
database names using the Databases panel.
v Optional: In the Like: Database field, enter the name of a database on which
to model the new table space.
v Optional: In the Like: Name field, enter a table space name on which to
model the new table space.
3. Press Enter to display the Create Table Space panel, as shown in the following
figure.

Chapter 8. Building and running SQL statements 155


| ADB21SAR ------------------ DSN9 Create Table Space --------- Row 1 to 1 of 1
| Command ===> ________________________________________________ Scroll ===> PAGE
|
| Commands: CONTINUE ORIGINAL
| Line commands: I - Insert part D - Delete part U - Update part
| C - Clear data R - Repeat part
| CREATE TABLESPACE: FGRTS IN FGRDB
|
| Numparts . . . . 0 . Large . . . . . ___ LOB . . . . . ___
| Define . . . . . .
___ DSSIZE . . . . ____ LOG . . . . .
| Member Cluster . .
___ SEGSIZE . . . . __ CCSID . . . .
| Buffer Pool . . . .
________ Close Rule . . ___ Max Rows . . ___
| Lock Size . . . . .
__________ Lock Part . . . Lock Max . . __________
| Max Partitions . .
0_________
| Free Pct E T S
| S Part Pqty Sqty Page Free Compr R M T VCAT Stogroup GBPCache
| - ------ ---------- ---------- ---- ---- ----- - - - -------- -------> --------
| _ 0 __________ __________ ___ __ ___ _ _ _ ________ ________ ________
| ******************************* END OF DB2 DATA *******************************
||
| Figure 94. The Create Table Space panel (ADB21SAR) – Creating a new table space
|
4. On the Create Table Space panel (ADB21SAR), specify parameters for the new
table space or issue the CONTINUE primary command to use the default
settings.
5. Follow the instructions on the Statement Execution Prompt panel (if enabled) to
complete and run the SQL statement for creating the new table space.
Related reference
“Option S. Table Spaces” on page 591
“Option D. Databases” on page 555

Creating a table
Use the Create Table panel to create a new table.

To create a new table in a table space within a database:


1. Select option CT on the Create/Drop/Label/Comment On Objects panel. The
Create Table panel is displayed, as shown in the following figure.

| ADB26CT n ----------------------DB2X Create Table ---------------------- 16:31


| Command ===>
|
| CREATE TABLE
|
| Schema . . . . . > (default is SMITHAJ)
| Name . . . . . . PJ > (? to look up)
|
| LIKE
| Schema . . . . . >
| Name . . . . . . > (? to look up)
| Identity attrs . (Include identity attributes, Yes/No)
| Row chg attrs . . (Include row change TS attributes, Yes/No)
| As model . . . . (Use as model only, Yes/No)
|
| (
| Number of columns . . .
||
| Figure 95. The Create Table panel (ADB26CT)
|
2. Specify the following values:
v In the Owner field, enter a table owner name for the new table or use the
default owner.

156 User's Guide and Reference


v In the Name field, enter a table name for the new table, or enter a question
mark (?) to look up existing table names using the Tables, Views, and Aliases
panel.
v Optional: In the LIKE Owner field, specify the name of an owner on which
to model the new owner for the new table.
v Optional: In the LIKE Name field, enter the name of a table on which to
model the new table, or enter a question mark (?) to look up existing table
names using the Tables, Views, and Aliases panel.
v In the ID Atrbs field, specify whether to include identity column attributes
for the new table.
v

Optional: In the As model field, specify Y to indicate that you want to use
the LIKE table as a model that you can edit before creating the
table.
v Specify the number of columns for the table. In the panel in the previous
figure, nine columns have been specified.
| 3. Press Enter to continue to the next Create Table Columns panel, as shown in
| the following figure.

| ADB26CTF ------------------DB2X Create Table Columns ------- Row 1 to 1 of 1


| Command ===> Scroll ===> CSR
|
| Schema . . SMITHAJ > Database . . .
| Name . . . PJTABRR > Table space . .
|
| Commands : CREATE PRIMKEY TBLOPTS PART
| Line commands: M - Move A - After B - Before
| Inn - Insert U - Update D - Delete Rnn - Repeat
| Operation
| Select Column Name Col Type Length Scale Null D Col No Type
| * * * * * * * *
| ------ -----------------> --------- ------ ------ ---- - ------ ---------
|
| * RCHG TIMESTMP 10 0 N E 1 UPDATE
| ******************************* END OF DB2 DATA *******************************
||
| Figure 96. The Create Table panel (ADB26CTF) – Creating a new table
|
4. On the Create Table panel (ADB26CTF), specify parameters for the new table.
5. Follow the instructions on the Statement Execution Prompt panel (if enabled) to
complete and run the SQL statement for creating the new table.
Related reference
“Option T. Tables, Views, and Aliases” on page 594

Creating a materialized query table


Use the Create Materialized Table panel to create a new materialized query table.

To create a new materialized query table in a table space within a database:


1. Select option CM on the Create/Drop/Label/Comment On Objects panel. The
Create Materialized Table panel is displayed, as shown in the following figure.

Chapter 8. Building and running SQL statements 157


DB2 Admin ---------------- DB2X Create Materialized Table --------------- 16:17
Command ===>

CREATE TABLE (Materialized)


Owner ===> ISTJE > Database ===> TESTDB (? look up))
Name ===> MTABLE01 > Table space ===> SPACE01 (? look up))
Source Owner ===> OWNER1 >
Source Name ===> TABLE1 > (? look up)
( (column list ? to look up)
Col names ===> ?
>
) AS (? to use SELECT prototype)
SELECT stmt===> ?

MAINTAINED BY SYSTEM/USER ===> S (S-SYSTEM, U-USER, default SYSTEM)


ENABLE QUERY OPTIMIZATION ===> YES (Yes/No, default YES)
DEFINITION ONLY (Will create base table only)
IDENTITY COL ATTRIBUTES ===> YES (EXCLUDE, Yes/No, default NO)
COLUMN DEFAULTS ===> NO (EXCLUDE, Yes/No, default NO)

Figure 97. The Create Materialized Table panel (ADB26CM)

2. Specify the following values:


v In the Owner field, enter a table owner name for the new materialized query
table.
v In the Name field, enter a table name for the new materialized query table.
v In the Source Owner field, enter the name of the owner of that source table.
v In the Source Name field, enter a source table name on which the new
materialized query table is based, or enter a question mark (?) to look up
existing table names.
v In the Col names field, enter the column names to be added to the new
materialized query table, or enter a question mark (?) to look up existing
column names.
v In the SELECT stmt field, enter an SQL SELECT statement to build the
materialized query table, or enter a question mark (?) to use the Build SQL
SELECT Prototype panel to build one.
v In the MAINTAINED BY SYSTEM/USER field, enter S if you want the DB2
system to update and maintain the table, or enter U if you want a user
program to update and maintain the table.
v In the ENABLE QUERY OPTIMIZATION field, enter Yes or No to use the
DB2 query optimizer.
v In the DEFINITION ONLY area, specify whether you want to exclude either
or both of the following:
IDENTITY COL ATTRIBUTES
Specify Yes to exclude identity column attributes, or specify No to
include them.
COLUMN DEFAULTS
Specify Yes to exclude column defaults, or specify No to include
them.
If you specify Yes for both fields in the DEFINITION ONLY area, DB2 Admin
creates a regular base table (type "T"), as opposed to a materialized query table.
3. Press Enter.

158 User's Guide and Reference


4. Follow the instructions on the Statement Execution Prompt panel (if enabled) to
complete and run the SQL statement for creating the new materialized query
table.

Creating an index on a table


Use the Create Index panel to create a new index on a table.

Using DB2 Admin, you can create a new index on a table in several ways:
v Select option CX on the Create/Drop/Label/Comment On Objects panel
(ADB26).
v Use the CREX line command on the Tables, Views, and Aliases panel (ADB21T).
v Use the CRE line command on the Indexes panel (ADB21X).
v Select option CX on the Explain panel (ADB2E).

Each of these methods display the create index panels, beginning with the Create
Index panel (ADB26CX).

To create a new index on a table:


1. Select option CX on the Create/Drop/Label/Comment On Objects panel. The
Create Index panel is displayed, as shown in the following figure.

DB2 Admin ---------------------- DB2X Create Index ---------------------- 09:54


Command ===>

CREATE INDEX

Owner ===> OWNER1 > (default is ISTJE)


Name ===> INDEX1 > (? to look up)

ON
Table owner===> OWNER1 > (default is ISTJE)
Table name ===> TABLE1 > (? to look up)

Partitions ===> 0 (0 for nonpartitioned INDEX)

Like:
Index owner===> > (required for Like usage)
Index name ===> > (? to look up)

Figure 98. The Create Index panel (ADB26CX)

2. Specify the following values:


v In the Owner field, enter the name of the index owner for the new index or
use the default owner.
v In the Name field, enter an index name for the new index, or enter a
question mark (?) to look up existing index names using the Indexes panel.
v Optional: In the Table owner field, enter the name of the owner for a table
name on which the index is based.
v In the Table name field, enter a table name or enter a question mark (?) to
look up existing table names using the Tables, Views, and Aliases panel.
v Optional: In the Partitions field, enter the number of partitions for a
partitioned index. For releases of DB2 prior to Version 8, you can specify up
to 254 partitions. For DB2 Version 8, you can specify up to 4096 partitions.
v Optional: In the Like: Index owner field, specify the name of an owner on
which to model the new owner for the new index.

Chapter 8. Building and running SQL statements 159


v Optional: In the Like: Index name field, enter the name of an index on
which to model the new index or enter a question mark (?) to look up
existing index names using the Indexes panel.
3. On the next Create Index panel (ADB21XAR), use the A and D line commands
to specify whether the columns should be in ascending or descending order
and other optional parameter values. Specify the general index attributes in the
fields on the upper portion of the panel. Depending upon the release of DB2
and your choice of parameters, some of the attribute fields might be
unavailable.
4. Use line commands to specify the columns in the index on the lower, scrollable
table of the panel. All columns of the DB2 table are displayed. Index columns
are identified in the Colseq and Order columns.
5. Issue the CONTINUE primary command to display the Create Index – Space
panel (ADB21XAS).
6. Specify the space allocation and storage parameters for the index or for each
partition of the index. If a partitioned index with more than one partition is
being created, the word Default: appears at the top of the scrollable portion of
the panel. Use this line to enter common values for each partition and to avoid
entering the same value for a parameter on all partitions again.
7. Issue the CONTINUE primary command to generate the DDL for the index
and display an edit session.
8. Edit the CREATE statement or exit the session to create the index.
9. Follow the instructions on the Statement Execution Prompt panel (if enabled) to
complete and run the SQL statement for creating the new index.

After the index is created, DB2 Admin displays the Create Index – Utilities panel
(ADB26CXU), on which you can run several index utilities, including RECOVER
and RUNSTATS.
Related reference
“Option X. Indexes” on page 600

Placing a label on a table


Use the Label Table panel to place a label on a table.

To place a label on a table:


1. Select option LT on the Create/Drop/Label/Comment On Objects panel. The
Label Table panel is displayed, as shown in the following figure.

DB2 Admin --------------------- DB2X Label Table ------------------------ 15:34


Command ===>

Owner ===> OWNER1 >


Name ===> TABLE10 > (? to look up)

IS

Label ===>

Figure 99. The Label Table panel (ADB26LT)

2. Specify the following values:


v In the Owner field, enter an owner name for the table on which you want to
place a label.

160 User's Guide and Reference


v In the Name field, enter a table name on which you want to place a label, or
enter a question mark (?) to look up existing table names using the Tables,
Views, and Aliases panel.
3. Enter a label for the table and press Enter.
4. Follow the instructions on the Statement Execution Prompt panel (if enabled) to
complete and run the SQL statement for placing the label on the table.
Related reference
“Option T. Tables, Views, and Aliases” on page 594

Placing a comment on a table


Use the Comment Table panel to place a comment on a table.

To place a comment (or remark) on a table:


1. Select option RT on the Create/Drop/Label/Comment On Objects panel. The
Comment Table panel is displayed, as shown in the following figure.

DB2 Admin -------------------- DB2X Comment Table ----------------------- 15:43


Command ===>

COMMENT ON TABLE

Owner ===> OWNER1 >


Name ===> TABLE10 > (? to look up existing tables)

IS

Remarks ===>

Figure 100. The Comment Table panel (ADB26RT)

2. Specify the following values:


v In the Owner field, enter an owner name for the table on which you want to
place a comment.
v In the Name field, enter a table name on which you want to place a
comment or enter a question mark (?) to look up existing table names using
the Tables, Views, and Aliases panel.
3. Enter a comment or remark for the table and press Enter.
4. Follow the instructions on the Statement Execution Prompt panel (if enabled) to
complete and run the SQL statement for placing the comment on the table.
Related reference
“Option T. Tables, Views, and Aliases” on page 594

Dropping a table
Use the Drop Table panel to drop a table.

To drop a table:
1. Select option DT on the Create/Drop/Label/Comment On Objects panel. The
Drop Table panel is displayed, as shown in the following figure.

Chapter 8. Building and running SQL statements 161


DB2 Admin ---------------------- DB2X Drop Table ------------------------ 15:48
Command ===>

DROP TABLE

Owner ===> OWNER1 >


Name ===> TABLE07_TEST >
(? to look up existing tables)

Report Drop Impacts ===> YES (Yes, No, or Batch)

Figure 101. The Drop Table panel (ADB26DT)

2. Specify the following values:


v In the Owner field, enter an owner name for the table that you want to drop.
v In the Name field, enter a table name that you want to drop or enter a
question mark (?) to look up existing table names using the Tables, Views,
and Aliases panel.
v If you want to request a Drop Impact Report, enter YES in the Report Drop
Impacts field.
3. Press Enter.
4. Follow the instructions on the Statement Execution Prompt panel (if enabled) to
complete and run the SQL statement for dropping the table.
Related tasks
“Using Drop Impact Reports”
Related reference
“Option T. Tables, Views, and Aliases” on page 594

Using Drop Impact Reports


When dropping DB2 objects, you can request Drop Impact Reports to identify
other DB2 objects, plans, and packages that are impacted by the action.

Use the Report Drop Impacts field on the Change DB2 Admin Defaults panel
(ADB2P2) to set the default (YES or NO) for these reports.

Tip: Use the Drop Impact Report when dropping DB2 objects to avoid dropping
objects that adversely impact other DB2 objects, plans, and packages.

For example, to request and use a Drop Impact Report:


1. Issue the DROP line command on the Databases panel to specify that a
database be dropped, as shown in the following figure.

162 User's Guide and Reference


DB2 Admin ------------------- DB2X Databases ---------------------- Row 1 of 4
Command ===> Scroll ===> CSR

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
VNDWLBDB VNDWLB SYSDEFLT BP0 269 VNDWLB E BP1
DROP VNDWLBD0 VNDWLB VNDWLBSG BP0 330 VNDWLB E BP1
VNDWLBD1 VNDWLB VNDWLBSG BP0 331 VNDWLB E BP1
VNDWLB1 VNDWLB VNDWLBSG BP0 344 VNDWLB E BP1
******************************* END OF DB2 DATA *******************************

Figure 102. Using the DROP command on the Databases panel (ADB21D)

2. Press Enter. The Drop Database panel (ADB26DD) is displayed, as shown in the
following figure. If you set the default value for Drop Impact Reports to Yes,
the Report Drop Impacts field contains a YES value. You can enter NO to skip
the Drop Impact Report or proceed.

DB2 Admin ---------------------- DSNX Drop Database --------------------- 14:29


Command ===>

DROP DATABASE

Name ===> VNDWLBD0 (? to look up)

All objects in the database will be dropped.

Display Drop Impact Report ===> YES (Yes, No, or Batch)

Figure 103. The Drop Database panel (ADB26DD)

If you request a Drop Impact Report and press Enter, the DROP Impact
Analysis Summary panel (ADB2DIP) is displayed, as shown in the following
figure.

Chapter 8. Building and running SQL statements 163


DB2 Admin -------------- DB2X DROP Impact Analysis Summary -------------- 14:30
Command ===> Scroll ===> CSR

SQL Statement: DROP DATABASE "VNDWLBD0"


Line commands: S - Show blank - Suppress

Items to Items to Constraints to


DROP or REVOKE Invalidate Remove
-------------- ---- -------- ---- ----------------------- ----
S Databases . . : 1 S Aliases : 1 S Check Constraints. . . : 1
S TableSpaces . : 7 S Packages: 0 S Referential Constraints: 2
S Tables. . . . : 3 S Plans . : 0 S Unique Constraints . . : 3
S Aux. Tables . : 1 ==== ====
S Indexes . . . : 4 1 6
S Authorizations: 17
S Synonyms. . . : 3
S Views . . . . : 2
S Procedures. . : 0
S Functions . . : 0
S Triggers. . . : 1
S Dist. Types . : 0
S Sequences . . : 0
====
39

Figure 104. DROP Impact Analysis Summary panel (ADB2DIP)

If you press Enter again, the DROP Impact Analysis Details panel (ADB2DIPD)
is displayed. A portion of this panel is shown in the figure below. This panel
displays all objects that are impacted by dropping the object.

164 User's Guide and Reference


DB2 Admin ---------- DB2X DROP Impact Analysis Details ----------- Row 1 of 30
Command ===> Scroll ===> CSR

SQL Statement: DROP DATABASE "VNDWLBD0"

Commands: RE-SORT DROP


Line commands: S - Show object DRD - DROP RESTRICT on DROP

Sel Type Object Name/Grantor>Grantee Owner Note


* * * *
--- ------ --------------------------- -------- -------------------------------
D----- VNDWLBD0------------------- VNDWLB
A VNDWLB>VNDWLB2 VNDWLB
S ABCCLUST VNDWLB Type=Cluster<64G
S ABCLARGE VNDWLB Type=>64G
S ABCSIZE VNDWLB Type=Segmented
S VNDWLBSP VNDWLB Type=Partitioned
A VNDWLB>VNDWLB1 VNDWLB
T WLBEMPTB VNDWLB Restrict on Drop
A VNDWLB>VNDWLB5 VNDWLB
A VNDWLB>VNDWLB4 VNDWLB Col=EMPNOX,Reference
A VNDWLB>VNDWLB4 VNDWLB Col=NAME,Update
Y SYNEMPTB VNDWLB
ALI ALIEMPTB VNDWLB Orphaned Alias
CHR REFCON1 VNDWLB Related child
CHR REFCON2 VNDWLB Related child (unconstrained)
PAR REFCON1 VNDWLB Related parent
UC UC4PRIM VNDWLB Primary key
CHK CHKNAM2 VNDWLB NAME > 'A'
J WLBTRIG1 VNDWLB
UC UC3UNIQ VNDWLB Unique key
X WLBIX1 VNDWLB
S VNDWLBS4 VNDWLB Type=LOB
T AUX_PSEG_PHOTO VNDWLB Type=Aux. Table
S WLBEMPTB VNDWLB Type=Implicit
V VIEWOFTBL VNDWLB View of a Table
A VNDWLB>VNDWLB6 VNDWLB
Y VIEWOFTBLSYN VNDWLB View of a Table Synonym
V VIEWOFVIEW VNDWLB View of a View
A VNDWLB>VNDWLB7 VNDWLB
Y VIEWOFVIEWSYN VNDWLB View of a View Synonym
******************************* END OF DB2 DATA *******************************

Figure 105. Partial display of DROP Impact Analysis Details panel (ADB2DIPD)

On the DROP Impact Analysis Details panel, you can issue the following
primary commands:
RE-SORT
Re-sort the table to its original sequence.
DROP
Proceed to drop the object.
Sort
Sort the table using one or more columns.
On the DROP Impact Analysis Details panel, you can issue the following line
commands:
S Show further details about an object.
DRD
Drop Restrict on Drop for the object.

Chapter 8. Building and running SQL statements 165


Related concepts
“Changing DB2 Admin defaults” on page 123
Related tasks
“Dropping a table” on page 161

Using Restrict on Drop


If a table has the Restrict on Drop attribute, users are restricted from dropping the
object until the attribute is removed.

Occasionally, DB2 tables contain the Restrict on Drop attribute to prevent users
from accidently dropping them. When attempting to drop one or more tables that
have the Restrict on Drop attribute, DB2 Admin displays the Tables with Restrict
on Drop panel, as shown in the following figure.

DB2 Admin -------------- DB2X Tables with Restrict on Drop -------- Row 1 of 1
Command ===>
Drop Table Restricted
SQL Statement: DROP DATABASE "VNDWLBD0"

DROP statement failed because one or more tables are defined with
RESTRICT ON DROP.

Commands: DROP - DROP Restrict on Drop and DROP DATABASE


Line commands: DRD - DROP RESTRICT on DROP

Sel Table Name Owner DB Name TS Name Note


* * * * *
--- ------------------ -------- -------- -------- ----------------
EMP_PHOTO_RESUME VNDWLB VNDWLBD0 VNDWLBS3 Restrict on Drop
******************************* END OF DB2 DATA *******************************

Figure 106. Tables with Restrict on Drop panel (ADB26DDR)

DB2 Admin also displays this panel if a user attempts to drop a database or a table
space that contains one or more tables that have the Restrict on Drop attribute.

To remove the Restrict on Drop attribute from a table, use the DRD line command.
The DRD line command removes the Restrict on Drop attribute without dropping
the table.

When dropping a database, table space, or table, you can use the DROP primary
command to remove the Restrict on Drop attribute from the tables that are
involved and then drop the database, table space, or table.

When the PROMPT option is used while dropping an object, the DROP statement
for the object is displayed. You must select option 1 to run the DROP statement. If
the DROP statement fails (with error code –672) because one or more tables have
the Restrict on Drop attribute, the Tables with Restrict on Drop (ADB26DDR) panel
is displayed. At this point, you can take one of the following actions:
v Use the DROP primary command to remove the Restrict on Drop attribute from
the tables and run the DROP statement again. The DROP primary command
generates an ALTER DROP RESTRICT ON DROP statement for each table,
followed by a DROP statement.
v Use the DRD line command to remove the Restrict on Drop attribute for an
individual table.
v Cancel and exit without running the DROP statement.

166 User's Guide and Reference


Granting and revoking privileges on objects panel
Use the Grant or Revoke Privileges On Objects panel to issue GRANT and
REVOKE SQL statements.

The following example shows how to revoke privileges on a table.

To revoke privileges on a table:


1. Select option 5 on the Execute SQL Statements panel. The Grant or Revoke
Privileges On Objects panel is displayed, as shown in the following figure.

DB2 Admin ----------- DB2X Grant/Revoke Privileges On Objects ---------- 01:40


Option ===>

DB2 System: DB2X


GRANT REVOKE DB2 SQL ID: ISTJE
GG - Storage group RG - Storage group
GD - Database RD - Database
GS - Table space RS - Table space
GT - Table RT - Table
GC - Column
GP - Plan RP - Plan
GL - Collection RL - Collection
GK - Package RK - Package
GZ - System privilege RZ - System privilege
GR - Buffer pool RR - Buffer pool
GH - Schema RH - Schema
GE - Distinct type RE - Distinct type
GF - Function RF - Function
GO - Stored procedure RO - Stored procedure
GJ - JAR file RJ - JAR file
GQ - Sequence RQ - Sequence

Figure 107. Grant or Revoke Privileges On Objects panel (ADB2G)

2. Specify RT in the Option field and press Enter. The Revoke Table Privileges
panel is displayed, as shown in the following figure.

DB2 Admin ----------------- DB2X Revoke Table Privileges ---------------- 10:18


Command ===>

REVOKE DB2 SQL ID: ISTJE

Enter any character in front of the privilege to revoke it from the user:

ALL INDEX UPDATE


ALTER INSERT REFERENCE
DELETE SELECT TRIGGERS

ON TABLE
Owner ===> MULTIPLE >
Table ===> ALL >
FROM
From ===> >
BY
By ===> ISTJE

Report Revoke Impacts ===> YES (Yes/No)


Report Dropped Synonyms & Aliases ===> NO (Yes/No)

Figure 108. Revoke Table Privileges panel (ADB2RT)

3. Specify the following information:


v Type of privilege that you want to revoke
v Owner name

Chapter 8. Building and running SQL statements 167


v Table name
v User ID from which the privilege is being revoked (the FROM field)
v User ID that is revoking the privilege (the BY field)
When you issue a REVOKE command, you can choose to view a Revoke
Impact Report. For example, on the Revoke Table Privileges panel in the
previous figure, you can enter Y in the Report Revoke Impacts field. The report
is displayed as a tree structure. The complete tree represents all of the
authorizations or objects that will be lost or invalidated as a consequence of
performing the REVOKE.
Similarly, you can choose to view a Dropped Synonyms and Aliases Report by
entering a Y in that field.
4. Press Enter to revoke the specified privilege.
Related tasks
“Selecting a method for building and running SQL statements” on page 142

| Revoking system authority from an SQLID


| Use the System Privileges Authorization panel to revoke system authority from an
| SQLID.

| The following example shows how to revoke system authority from an SQLID and
| run a Revoke Impact Report.

| To revoke system authority from an SQLID and run a report:


| 1. On panel ADB21, System Catalog, enter the authid you want to revoke in the
| Grantee field with and then issue the AO - Authorization options command.
| 2. When the authorization options are displayed on panel ADB21, System Catalog,
| issue the UA - User authorizations command. A summary displays for the
| SQLID on panel ADB2AUS,User Authorizations Summary
| 3. From panel ADB2AUS, issue the AU line command.
|

168 User's Guide and Reference


| ADB2AUS n ----------- DB2X User Authorizations Summary ----- Row 1 to
| Command ===> Scroll
| Authorities held by C222333%
| Authority includes SYSADM
| Commands: AU AP ALL AE AI
| Line commands: AU - User Only AP - All PUBLIC ALL - All Authorizat
| AE - Explicit to User AI - Implicit to User
| Sel Type Explicit Implicit PUBLIC Total
|
| --- ---------------- ----------- ----------- ----------- -----------
|
| AU System 2 0 1 3
| Storage group 0 21 15 36
| Database 0 306 57 363
| Table space 1 0 105 106
| Table 1 305 2768 3074
| Column 0 3 0 3
| Plan 4 47 220 271
| Collection 0 0 2 2
| Package 44 459 218 721
| Function 0 4 1 5
| Buffer pool 0 0 8 8
| Data type 0 0 1 1
| JAR 0 0 0 0
| Stored procedure 0 4 41 45
| Schema 0 0 2 2
| Sequence 0 1 0 1
|
| ******************************* END OF DB2 DATA ********************
||
| Figure 109. User Authorizations Summary panel (ADB2AUS)
|
| 4. Start the REVOKE process and its associated Revoke Impact Report by issuing
| the R - Revoke line command from panel ADB2AZ, System Privileges
| Authorizations.
|
| ADB2AZ in ---------- DB2X System Privileges Authorizations --- Row 1
| Command ===> Scroll
| Commands: REVOKE GRANT
| Line commands:
| R - Revoke GR - Grant B B CREATE : D R S S S S S B
| I - Interpretation I S I E T T Y Y Y I
| N D A T S C O O S S S N
| D S L M P O P S A C O D
| A D D I T L V A P D T P A
| H D B B S A A A E L A M R R G
| Sel Grantor Grantee Grant date G D A C G S B Y R L C L T
| * * * * * * * * * * * * * * * * * * *
|
| --- -------- -------- ---------- - - - - - - - - - - - - - - - -
|
| DB2ADM C717086 2007-04-24 S Y
| R VNDLRC C717086 2008-10-06 S Y
|
| ******************************* END OF DB2 DATA ********************
||
| Figure 110. System Privileges Authorizations panel (ADB2AZ)
|
| 5. Enter YES in the Report Revoke Impacts field on panel ADB2RZ, Revoke
| System Privileges.
|

Chapter 8. Building and running SQL statements 169


| ADB2RZ in ---------------- DB2X Revoke System Privileges ---
| Command ===>
| REVOKE DB2
| Enter any character in front of the privilege to revoke it
| Y SYSADM BSDS CREATESG STOPALL
| SYSOPR CREATEDBA DISPLAY STOSPACE
| BINDADD CREATEDBC RECOVER TRACE
| MONITOR1 MONITOR2 CREATEALIAS SYSCTRL
| BINDAGENT ARCHIVE CREATETMTAB
| FROM
| From ===> C717086 >
| BY
| By ===> VNDLRC
| Report Revoke Impacts ===> YES (Yes/No)
| Report Dropped Synonyms & Aliases ===> NO (Yes/No)
|
|
| Figure 111. Revoke System Privileges panel (ADB2RZ)
|
| 6. Check the details on panel ADB2RIP, Revoke Impact Report.
|
| ADB2RIP n -------------- DB2X Revoke Impact Report ---------------- Row 1 of 1
| Command ===> ________________________________________________ Scroll ===> PAGE
|
|
|
| Line commands: I - Interpretation
| Owner/
| S Grantee G Resource N/ O Schema/ Grantor/ G H Privileges/
| Lvl T Collection T P/K Name Binder T G Effect
| - --- -------- - ------------ - -------- -------- - - -------------------------
| * 0 PACKADM Z VNDRG S Y
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 112. Revoke Impact Report panel (ADB2RIP)
|

170 User's Guide and Reference


|

Chapter 9. Reconstructing SQL (DB2 Admin Reverse


Engineering)
DB2 Admin can generate the SQL statements that are required to re-create a DB2
object.

This process, which is called reverse engineering, is accomplished by using the GEN
command to extract the SQL for an object from the DB2 catalog.

Extracting the DDL for an object before changes are made is helpful for ensuring
that the changes are applied to the current definition. The DDL also ensures that
the original object definitions are available for fallback purposes.

When extracting objects in databases, table spaces, and tables, you can also
generate all dependent objects, including: table spaces, tables, indexes, views,
synonyms, aliases, referential constraints, table check constraints, and triggers.
When extracting objects in schemas, you can extract the associated distinct types,
sequences, functions, and stored procedures.

In addition to extracting the DDL for objects, you can also generate the DCL for all
authorizations to the objects and the DML for the catalog statistics for the objects.

You can generate the SQL statements online or with a batch job. Batch jobs are
recommended when you extract many objects from a large catalog.

Topics:
v “Generating SQL to re-create a DB2 object” on page 172
| v “Generating SQL using wildcard characters” on page 179
v “Sample output from generating SQL” on page 182
v “Sample output with the Rebind option” on page 186
Related tasks
“Step 18. Create additional DB2 catalog indexes” on page 69
Related reference
“Option A. Aliases” on page 551
“Option D. Databases” on page 555
“Option E. User-Defined Data Types” on page 560
“Option F. Functions” on page 562
“Option H. Schemas” on page 565
“Option O. Stored Procedures” on page 580
“Option S. Table Spaces” on page 591
“Option T. Tables, Views, and Aliases” on page 594

© Copyright IBM Corp. 1995, 2010 171


Generating SQL to re-create a DB2 object
To generate SQL to re-create DB2 objects:
1. From the DB2 Admin Main Menu, specify option 1. The System Catalog panel
is displayed.
2. Select one of the following options that supports the ability to specify the GEN
command to reverse engineer objects.
v Databases (option D)
v Table Spaces (option S)
v Tables, Views, and Aliases (option T)
v Aliases (option A)
v Synonyms (option Y)
v Schemas (option H)
v Data (or Distinct) Types (option E)
v Functions (option F)
v Storage Groups (option G)
v Stored Procedures (option O)
v Triggers (option J)
v Sequences (option Q)

Tip: You can use the fields at the bottom of the panel to specify search criteria
to filter or limit the number of objects that are displayed.
3. Generate SQL.
v To generate the SQL for a single object, issue the GEN line command for the
object.
v To generate the SQL for all of the listed objects, issue the GEN primary
command.
The following figure shows the GEN line command being issued against a
database.

DB2 Admin ------------------- DB2X Databases ---------------------- Row 1 of 4


Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
GEN DSN8D81A DSCGDB2 DSN8G810 BP0 258 ISTJE E BP2
DSN8D81E DSCGDB2 DSN8G810 BP1 260 ISTJE U BP2
DSN8D81P DSCGDB2 DSN8G810 BP0 259 ISTJE E BP2
DSN8D81U DSCGDB2 DSN8G81U BP1 261 ISTJE E BP2
******************************* END OF DB2 DATA *******************************

Figure 113. Databases panel (ADB21D) - Example of issuing the GEN command to reverse
engineer objects

Tip: The DDL line command is a convenient alternative to using the GEN
command when you want to view only the DDL for a single object in the
DB2 catalog. The DDL command does not provide the additional options
that the GEN command does for extracting additional information, such as
constraints, authorizations, or dependent objects like triggers, labels, or
comments. The DDL line command is valid anywhere that the GEN line
command is valid with these exceptions:
172 User's Guide and Reference
v It is not valid on the Schemas panel (Option 1.H).
v It is valid on the Indexes panel (Option 1.X).

| Note: When a native SQL procedure statement size is near the 2 MB boundary,
| sometimes GEN cannot generate the native SQL procedure statement
| DDL. Two scenarios can occur when GEN might not be able to generate
| the native SQL procedure DDL:
| v The native SQL procedure statement is created by GEN by first
| constructing the native SQL procedure options from the catalog fields
| (other than sysroutines.text) and appending the native SQL procedure
| SQL-routine-body that is stored in sysroutines.text. Sometimes the
| resulting DDL statement exceeds 2 MB. This might occur because
| more options are generated by GEN (such as keep default option
| values, when the "DB2 defaults handling" option is set to Keep) than
| were specified when the native SQL procedure was created. When the
| 2 MB is exceeded in this scenario, GEN will issue the ADB1915W
| warning message and generate the native SQL procedure DDL as it is
| stored in DB2. The resulting DDL for the native SQL procedure object
| is the exact contents of the sysroutines.text field. If masking or an
| override was specified (such as change owner, change schema, or Run
| SQLID), the ADB1916E error message will be issued instead and GEN
| processing will stop. This is because GEN cannot complete the request
| within 2 MB for the native SQL procedure DDL with the specified
| masks or overrides.
| v GEN attempts to format each DDL statement so it is easy to read.
| Sometimes during the formatting process the extra bytes added for
| formatting cause the formatted statement length to exceed 2 MB.
| When this occurs, GEN will issue the ADB1919W warning message
| and generate unformatted DDL for the native SQL procedure. If
| masking or an override was specified (such as change owner, change
| schema, or Run SQLID), the ADB1920E error message will be issued
| instead and GEN processing will stop. This is because GEN cannot
| complete the request within 2 MB for the native SQL procedure DDL
| with the specified masks or overrides.
When you use either the GEN line command or the GEN primary command,
the Generate SQL from DB2 catalog panel is displayed, as shown in the
following figure.

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) 173


| ADB2GEN n -------------- DB2X Generate SQL from DB2 catalog ------------- 11:34
| Option ===>
|
| Generate SQL statements for database DBFSSGEN DB2 System: DSN9
| DB2 SQL ID: DEMBIN2
|
| SQL statement types to be generated from the DB2 catalog:
| CREATE DATABASE. . . . . Y (Y,N) GRANT access ON DATABASE . . Y (Y,N,A,R)
| CREATE TABLESPACE. . . . Y (Y,N) GRANT access ON TABLESPACE . Y (Y,N,A,R)
| CREATE TABLE . . . . . . Y (Y,N) GRANT access ON TABLE. . . . Y (Y,N,A,R)
| CREATE VIEW. . . . . . . Y (Y,N,D) GRANT access ON VIEW . . . . Y (Y,N,A,R)
| CREATE INDEX . . . . . . Y (Y,N) ALTER TABLE ADD FOREIGN KEY. Y (Y,N,D)
| CREATE SYNONYM . . . . . Y (Y,N) LABEL ON . . . . . . . . . . Y (Y,N)
| CREATE ALIAS . . . . . . Y (Y,N) COMMENT ON . . . . . . . . . Y (Y,N)
| CREATE TRIGGER . . . . . Y (Y,N,D) REBIND PLAN/PACKAGE. . . . . Y (Y,N,D)
| CREATE STORAGE GROUP . . Y (Y,N) GRANT use OF STORAGE GROUP . Y (Y,N,A,R)
|
| New names/values for generated SQL: (leave blank to use current values)
| Object schema . . . . : > Run SQLID. . . . . . . . . :
| Object grantor. . . . : >
| Alloc TS size as. . . : DEFINED (DEFINED, USED, or ALLOC)
| Database name . . . . :
| Storage group for TS. : > Storage group for IX . . . : >
| Target DB2 version. . : (Current DB2 version: 915)
| Use Masking . . . . . : NO (Yes/No)
| Generate catalog stats: NO (Yes/No/Only)
| Target cat qualifier: > (Default is SYSIBM)
|
| Output file and execution mode:
| Add to work stmt list : NO (Yes/No)
| Data set name . . . . : >
| Data set disposition: OLD (OLD, SHR, or MOD)
| Execution mode. . . . : TSO (BATCH or TSO)
| Commit statements per : (Db, tS, Tb, All, None. Default is All)
| DB2 defaults handling : R (Keep, or Remove. Default is Keep)
| Prompt to run SQL . . : YES (Yes/No. For TSO mode and no WSL)
|
| DB2 Command output file:
| Data set name . . . . : >
| Data set disposition: OLD (OLD, SHR, or MOD)
|
| BP - Change batch job parameters
||
| Figure 114. Generate SQL from DB2 Catalog panel (ADB2GEN)
|
4. Fill in the fields in the Generate SQL from the DB2 catalog panel, as shown in
the previous figure. In most cases, the valid values are Y and N. For detailed
descriptions of the fields, refer to the online help for the panel. For DB2 V9
NFM or later, the values available for the GRANT access statement types and
GRANT use OF STORAGE GROUP are:
Y Generate GRANT statements for authorizations and roles
N Do not generate any GRANT statements
A Generate GRANT statements for authorizations
R Generate GRANT statements for roles
The fields are grouped:
v In the first set of fields, specify whether a CREATE statement is to be
generated for the requested objects and dependent objects of the requested
objects, where applicable:
CREATE DATABASE
A value of Y specifies that CREATE statements for all of the explicitly
requested databases are to be generated.
When you also request to generate storage groups, statements are
generated for the default storage group.

174 User's Guide and Reference


CREATE TABLESPACE
A value of Y specifies that CREATE statements for all of the table
spaces that are identified during processing are to be generated,
which includes both explicitly and implicitly requested table spaces.
For example, if you specify the GEN command for a database and
specify Y in the CREATE TABLESPACE field, a CREATE statement
will be generated for each table space that resides in the database.
CREATE TABLE
A value of Y specifies that CREATE statements for all of the tables
that are identified during processing are to be generated, which
includes both explicitly and implicitly requested tables.
CREATE VIEW
A value of Y specifies that CREATE statements for all of the views
that are identified during processing are to be generated, which
includes both explicitly and implicitly requested views.
Specify D to extract views without DB2 Admin checking whether all
other objects used in the view are also being generated. This option
significantly reduces the resource consumption when running on
large DB2 catalogs.
CREATE INDEX
A value of Y specifies that CREATE statements for all of the indexes
that are identified during processing are to be generated, which
includes both explicitly and implicitly requested indexes.
CREATE SYNONYM
A value of Y specifies that CREATE statements for all of the
synonyms that are identified during processing are to be generated,
which includes both explicitly and implicitly requested synonyms.
CREATE ALIAS
A value of Y specifies that CREATE statements for all of the aliases
that are identified during processing are to be generated, which
includes both explicitly and implicitly requested aliases.
CREATE TRIGGER
A value of Y specifies that CREATE statements for all of the triggers
that are identified during processing are to be generated, which
includes both explicitly and implicitly requested triggers.
CREATE STORAGE GROUP
A value of Y specifies that CREATE statements for all of the storage
groups that are identified during processing are to be generated,
which includes both explicitly and implicitly storage groups.
GRANT access ON DATABASE
Generates a GRANT access ON DATABASE statement in the SQL.
GRANT access ON TABLESPACE
Generates a GRANT access ON TABLESPACE statement in the SQL.
GRANT access ON TABLE
Generates a GRANT access ON TABLE statement in the SQL.
GRANT access ON VIEW
Generates a GRANT access ON VIEW statement in the SQL.

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) 175


ALTER TABLE ADD FOREIGN KEY
Specify D to extract FOREIGN KEYS for tables that are dependent on
the tables being extracted.
LABEL ON
Generates a LABEL ON statement in the SQL.
COMMENT ON
Generates a COMMENT ON statement in the SQL.
REBIND PLAN/PACKAGE
Generates REBIND commands for plans and packages. These
REBIND commands are written to the data set that is specified in the
DB2 Command output file: Data set name field.
GRANT use OF STORAGE GROUP
Generates a GRANT USE OF STOGROUP statement in the SQL.
v In the second set of fields, specify the new names or values to be used in the
generated SQL:
| Object schema
Specify a new object schema. If specified, the new schema is used
whenever an object is created.
Run SQLID
| Specify the SQL ID to be used when creating objects. The SQL ID
| that is specified must have the privileges that are necessary to create
| objects, such as an administrative type of SQL ID that has been
| defined. If you specify a value of <NONE>, no SET CURRENT
| SQLID statements are generated in the DDL. If you leave the field
| blank, a SET CURRENT SQLID statement is generated in the DDL
| before each object that is created (where possible, the SQL ID that
| was originally used to create the object is used).
If you specify an SQLID of <NONE>, the following is true if you use
synonyms:
– If the creator of the synonym is the same as the creator of the
table on which the synonym is defined, an executable CREATE
SYNONYM statement is generated.
– If the creator of the synonym is not the same as the creator of the
table on which the synonym is defined, the SQLID that created
the SYNONYM is extracted from the catalog and both the SET
SQLID and CREATE SYNONYM statements are created, but
commented out. An informational message is issued. Be aware
that other generated statements might fail due to these statements
being commented out (for example, a view that is defined using
the synonym).
The other DB2 Admin functions where you can specify a RUN
SQLID value include the Rename Database, Redefine (RDEF), ALC,
Migrate, and Change Management functions.
Object grantor
The grantor of the object.
Alloc TS size as
Specifies how to generate the primary quantity. The following values
are valid:
DEFINED
Uses the size defined in the catalog.

176 User's Guide and Reference


USED
Uses the size that is actually used. This option requires you to
run the STOSPACE utility for the storage groups for the objects
being generated.
ALLOC
Uses the allocated size. This option requires you to run the
STOSPACE utility for the storage groups for the objects being
generated.
Database name
Specify a new database name for the objects (except when initiated
using a primary command from a list of databases).
Storage group for TS
Specify a new storage group for the table spaces.
Storage group for IX
Specify a new storage group for the indexes.
Target DB2 version
Specify the DB2 level for the generated SQL statements, if different
from the current DB2 level.
Use Masking
Specify Y to enable masking.
Generate catalog stats
Specify whether to generate catalog statistics, which causes INSERT,
UPDATE, and DELETE statements that modify the catalog statistics
to be included in the DDL file. The valid value are:
Y Generate DDL and catalog statistics.
N Generate DDL only. Do not generate catalog statistics.
O Generate catalog statistics only. Do not generate DDL.

The statistic fields that are generated are those that are associated
with the objects that are being generated. (The complete list of
statistics fields are those fields that are set by RUNSTATS that can be
modified and the five statistics columns for table functions in
SYSROUTINES, which are not set by RUNSTATS.)
Target cat qualifier
Specify the qualifier to be used in the INSERT, UPDATE, and
DELETE statements for updating catalog statistics.
v In the third set of fields, specify the output file and execution mode options:
Add to work stmt list
Specify Y to save the output to a work statement list data set. Specify
N to suppress work statement list output.
Data set name
Specify the data set in which DB2 Admin should place the generated
SQL. It must be an valid SPUFI input data set name or SYSOUT=x. The
default is SYSOUT=*. If you leave the field blank, the command output
is created as comments in the output file.
Data set disposition
Specify the disposition of the output data set.
Execution mode

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) 177


BATCH
Specify BATCH to run it as a batch job. If you specify an execution
mode of BATCH, DB2 Admin generates a batch job and displays
the job in an ISPF edit session, ready for any modifications that
you need to make before submitting the job for execution.
TSO
Specify TSO to run the SQL generation online. If you specify TSO,
DB2 Admin generates the SQL statements online and displays
the results.
Commit statements per
Specify how often an SQL COMMIT statement is added to the
generated SQL. Valid values are:
D Commit statements are run for each database.
S Commit statements are run for each table space.
T Commit statements are run for each table.
A Commit statements are run for all objects (default).
N Commit statements are never run.
DB2 defaults handling
Specify whether DB2 default parameters should be removed or kept
in the generated SQL. Valid values are:
K Keeps DB2 default parameters (default).
R Removes DB2 default parameters.
| Prompt to run SQL
| Specifies that after the SQL edit session, a prompt displays that
| allows you to choose whether to run the SQL immediately. This
| option only applies when you are using TSO mode without WSL.
| Valid values are:
| Y After the SQL edit session, display a prompt that allows you to
| choose whether to run the SQL immediately.
| The maximum number of SQL statements that are allowed is
| 8120. The maximum length of an SQL statement is 2097152 bytes
| (2 MB).
| N Do not display a prompt after the SQL edit session (default).
v In the last set of fields, specify the following options for the command
output file:
Data set name
Specify the data set in which DB2 Admin should place the generated
REBIND commands if REBIND PLAN/PACKAGE is selected.
Data set disposition
The disposition of the output data set.

Restriction:
v DB2 Admin does not extract IDCAMS DEFINE CLUSTER
statements for VCAT-defined table spaces and indexes.
| v When you reconstruct a stored procedure that is implemented in
| SQL, DB2 Admin cannot recover the original procedure body
| and replaces the original procedure body with the string

178 User's Guide and Reference


| "LEAVE L0". The procedure body cannot be recovered because it
| is not stored in the catalog. This occurs only for a non-native
| SQL procedure stored procedure that is implemented in SQL
| (SQL - external).

Tip: The ability to generate actual allocated space or actual used space
allocations depends on information in the DB2 catalog. The actual data set
sizes for table spaces and index spaces are not retrieved. Set the Alloc TS
size as field to ALLOC or USED only if you have recently run STOSPACE
and RUNSTATS for the selected objects.
Related information
Chapter 21, “Using masks,” on page 503
IBM Publications Center

| Generating SQL using wildcard characters


| When you reverse engineer objects and have the SQL statements generated in
| batch mode, you can use wildcard characters in the qualifiers and names of the
| objects to be extracted, which gives you the ability to have the DDL extracted
| based on strings that have a certain pattern.

| The GEN operation supports the use of request parameters that name the specific
| objects that are to be generated. The request for an object is specified by providing
| values for three keywords: TYPE, QUAL, and NAME. For example, the following
| request generates the DDL for database DSNDB04 and all of the objects that it
| contains:
| TYPE='DB',QUAL='',NAME='DSNDB04'

| The VERSION attribute is only for an native SQL procedure and indicates which
| native SQL procedure version or versions to extract. The VERSION attribute can be
| used to specify a specific version to extract, to extract the active version, or all
| versions.
| TYPE='SP',QUAL='DEMBIN2',NAME='MYSTP',VERSION='V1';

| Note: VERSION='*' will extract all versions. QUAL='TEST,NAME='*' will extract


| all active stored procedures within schema TEST. If the version is omitted,
| or is set to blank, the active version will be extracted.

| The values for the qualifier and name can contain zero or more of the following
| wildcard characters:
| v Minus sign (-) represents any single character.
| v Percent sign (%) or asterisk (*) represents one or more characters.
| v Any other character represents a single occurrence of itself.
| The rules for the wildcard characters follow the rules that are used for the LIKE
| predicate.

| The following table shows the values to specify in the TYPE, QUAL, and NAME
| keywords for each type of object:
| Table 7. The keyword values of the request parameters for each object type
| Object Type TYPE QUAL NAME Notes
| Database DB n/a dbanme
| Table space TS dbname tsname

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) 179


| Table 7. The keyword values of the request parameters for each object type (continued)
| Object Type TYPE QUAL NAME Notes
| Table TB creator \tbname
| View VW creato\r vwname
| Alias AL creator aliasname
| Index IX creator ixname
| User-defined data type DT schema udtname
| User-defined function FU schema udfname
| Stored procedure SP schema stpname
| Sequence SQ schema seqname For DB2 Version 8 and
| higher
| Schema SC schema n/a
| Trigger TG schema tgname
| Storage group SG n/a sgname
| Synonym SY creator syname
| Trusted context TC n/a tcname For DB2 Version 9 and
| higher
| Role RO n/a roname For DB2 Version 9 and
| higher
|

| The request parameters are specified in a data set with a DD name of IN. The
| request parameters must follow the run parameters in the data set. Modify the JCL
| that is generated to reverse engineer objects or modify the JCL that is provided in
| sample program ADBGEN to specify names with wildcard characters. The
| following figure shows an example of the sample program:
|

180 User's Guide and Reference


| //GENSQL EXEC PGM=IKJEFT01,DYNAMNBR=100
| //STEPLIB DD DISP=SHR,DSN=ADB.V71APAR.ISPLLIB
| // DD DISP=SHR,DSN=DSN.DSN8.SDSNEXIT
| // DD DISP=SHR,DSN=DSN.DSN8.SDSNLOAD
| // DD DISP=SHR,DSN=DMTOOL.AUTHSW.ISPLLIB
| //SYSTSPRT DD SYSOUT=*
| //SYSTSIN DD *
| DSN SYSTEM(DSN8)
| RUN PROG(ADB2GEN) PLAN(ADBDEV) PARMS('/REBIND')
| END
| /*
| //SYSPRINT DD SYSOUT=*
| //SQL DD SYSOUT=*,DCB=(RECFM=FB,LRECL=80)
| //IN DD *
| DB2SYS = 'DSN8',
| DB2ALOC = '',
| DB2SERV = 'DSN8',
| DB2AUTH = 'SINNOTT',
| DB2REL = '815',
| GENSG = 'Y',
| GENDB = 'Y',
| GENTS = 'Y',
| GENTABLE = 'Y',
| GENVIEW = 'Y',
| .
| .
| .
| NEWGRANTOR = '',
| SPCALLOC = 'DEFINED',
| TGTDB2 = '';
| TYPE='DB',QUAL='',NAME='DSNDB04';
|
| Figure 115. Sample program ADB2GEN to generate SQL in batch
|

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) 181


| Related information
| IBM Publications Center

Sample output from generating SQL


The figure in this topic is an example of the SQL that is generated when you use
the GEN command to reverse engineer objects.

***************************** Top of Data ******************************


------------------------------------------------------------------------
-- --
-- Database 2 Administration Tool (DB2 Admin) , program 5697-L90 (C) --
-- --
-- ADB2GEN - Extract object definitions from the DB2 Catalog tables --
-- --
-- Input prepared on : DB2X (810) Extract time : 2005-16-05 01:27 --
-- --
-- Catalog values overridden : none --
-- --
-- Generate : SG=Y DB=Y TS=Y TB=Y VW=Y IX=Y SY=Y AL=Y LB=Y CM=Y FK=Y --
-- TG=Y UT=N UF=N SP=N SQ=N --
-- Grants : SG=Y DB=Y TS=Y TB=Y VW=Y SC=N UT=N UF=N SP=N SQ=N --
-- --
------------------------------------------------------------------------
------------------------------------------------------------------------
-- --
-- ADB2GEN: Generate DDL for Database DSN8D81A --
-- --
------------------------------------------------------------------------
--
--
------------------------------------------------------------------------
-- Database=DSN8D81A Stogroup=DSN8G810
------------------------------------------------------------------------
--
SET CURRENT SQLID='DSCGDB2';
--
CREATE DATABASE DSN8D81A
BUFFERPOOL BP0
INDEXBP BP2
CCSID EBCDIC
STOGROUP DSN8G810 ;
--
GRANT DBADM
ON DATABASE DSN8D81A TO PUBLIC;
--
COMMIT;
--

Figure 116. Sample output from generating SQL

182 User's Guide and Reference


------------------------------------------------------------------------
-- Database=DSN8D81A Stogroup=DSN8G810
-- Tablespace=DSN8D81A.DSN8S81D
------------------------------------------------------------------------
--
CREATE TABLESPACE DSN8S81D
IN DSN8D81A
USING STOGROUP DSN8G810
PRIQTY 32 SECQTY 20
ERASE NO
FREEPAGE 0 PCTFREE 5
GBPCACHE CHANGED
TRACKMOD YES
BUFFERPOOL BP0
LOCKSIZE PAGE
LOCKMAX SYSTEM
CLOSE NO
COMPRESS NO
CCSID EBCDIC
MAXROWS 255;
--
GRANT USE OF TABLESPACE DSN8D81A.DSN8S81D TO PUBLIC;
--
COMMIT;
--
------------------------------------------------------------------------
-- Table=DSN8810.DEPT In DSN8D81A.DSN8S81D
------------------------------------------------------------------------
--
SET CURRENT SQLID='DSN8810';
--
CREATE TABLE DSN8810.DEPT
(DEPTNO CHAR(3) FOR SBCS DATA NOT NULL ,
DEPTNAME VARCHAR(36) FOR SBCS DATA NOT NULL ,
MGRNO CHAR(6) FOR SBCS DATA WITH DEFAULT NULL ,
ADMRDEPT CHAR(3) FOR SBCS DATA NOT NULL ,
LOCATION CHAR(16) FOR SBCS DATA WITH DEFAULT NULL ,
PRIMARY KEY (DEPTNO),
CONSTRAINT DEPTNO UNIQUE (DEPTNO))
IN DSN8D81A.DSN8S81D
AUDIT NONE
DATA CAPTURE NONE
CCSID EBCDIC;
--
SET CURRENT SQLID='DSCGDB2';
--
GRANT DELETE,INSERT,SELECT,UPDATE ON TABLE DSN8810.DEPT
TO PUBLIC AT ALL LOCATIONS;
--
COMMIT;
--

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) 183


------------------------------------------------------------------------
-- Database=DSN8D81A
-- Index=DSN8810.XDEPT1 On DSN8810.DEPT
------------------------------------------------------------------------
--
SET CURRENT SQLID='DSN8810';
--
CREATE UNIQUE INDEX DSN8810.XDEPT1
ON DSN8810.DEPT
(DEPTNO ASC)
USING STOGROUP DSN8G810
PRIQTY 12 SECQTY 12
ERASE NO
FREEPAGE 0 PCTFREE 10
GBPCACHE CHANGED
BUFFERPOOL BP0
CLOSE NO
COPY NO
PIECESIZE 2 G;
--
COMMIT;
--
------------------------------------------------------------------------
-- Database=DSN8D81A
-- Index=DSN8810.XDEPT2 On DSN8810.DEPT
------------------------------------------------------------------------
--
CREATE INDEX DSN8810.XDEPT2
ON DSN8810.DEPT
(MGRNO ASC)
USING STOGROUP DSN8G810
PRIQTY 12 SECQTY 12
ERASE NO
FREEPAGE 0 PCTFREE 10
GBPCACHE CHANGED
BUFFERPOOL BP0
CLOSE NO
COPY NO
PIECESIZE 2 G;
--
COMMIT;
--

184 User's Guide and Reference


------------------------------------------------------------------------
-- Database=DSN8D81A
-- Index=DSN8810.XDEPT3 On DSN8810.DEPT
------------------------------------------------------------------------
--
CREATE INDEX DSN8810.XDEPT3
ON DSN8810.DEPT
(ADMRDEPT ASC)
USING STOGROUP DSN8G810
PRIQTY 12 SECQTY 12
ERASE NO
FREEPAGE 0 PCTFREE 10
GBPCACHE CHANGED
BUFFERPOOL BP0
CLOSE NO
COPY NO
PIECESIZE 2 G;
--
COMMIT;
--
------------------------------------------------------------------------
-- Database=DSN8D81A Stogroup=DSN8G810 (for partition 1)
-- Tablespace=DSN8D81A.DSN8S81E
------------------------------------------------------------------------
--
SET CURRENT SQLID='DSCGDB2';
--
CREATE TABLESPACE DSN8S81E
IN DSN8D81A
USING STOGROUP DSN8G810
PRIQTY 12 SECQTY 12
FREEPAGE 0 PCTFREE 5
GBPCACHE CHANGED
TRACKMOD YES
NUMPARTS 4
(PART 2
USING STOGROUP DSN8G810
PRIQTY 20 SECQTY 20,
PART 3
COMPRESS NO,
PART 4
USING STOGROUP DSN8G810
PRIQTY 20 SECQTY 20)
BUFFERPOOL BP0
LOCKSIZE PAGE
LOCKMAX SYSTEM
CLOSE NO
COMPRESS YES
CCSID EBCDIC
MAXROWS 255;
--
GRANT USE OF TABLESPACE DSN8D81A.DSN8S81E TO PUBLIC;
--
COMMIT;
--
------------------------------------------------------------------------
-- Table=DSN8810.EMP In DSN8D81A.DSN8S81E

In some cases, data-partitioned secondary indexes might appear in the output


because the process to generate the SQL supports these indexes.

Chapter 9. Reconstructing SQL (DB2 Admin Reverse Engineering) 185


Sample output with the Rebind option
If you specified that REBIND commands were to be generated on the Generate
SQL from DB2 Catalog panel, not only is the preceding output displayed but so is
the rebind output.

The following figure shows the rebind output.

-------------------------------------------------------------------------------
EDIT SYS01311.T012717.RA000.ISTJE.R0215994 Columns 00001 00072
Command ===> Scroll ===> PAGE
****** ***************************** Top of Data ******************************

000001 REBIND PACKAGE(DSN8ES81.DSN8ES1)


****** **************************** Bottom of Data ****************************

Figure 117. Sample output of generating SQL with the REBIND option specified

Related reference
“DB2 Admin Reverse Engineering condition codes” on page 637

186 User's Guide and Reference


Chapter 10. Running DB2 Admin performance queries
This information shows you how to run performance queries using DB2 Admin
and describes the different types of performance queries that DB2 Admin supports.

Topics:
v “Option 1. Table Spaces Without RUNSTATS Information panel” on
page 189
v “Option 1X. Indexes Without RUNSTATS Information panel” on page
190
v “Option 2. Table Spaces With More Than n Percent Relocated Rows
panel” on page 191
v “Option 3. Indexes With Clustering Level Problems panel” on page 192
v “Option 4. Table Spaces With More Than n Percent Dropped Space
panel” on page 194
v “Option 5. DB2 Table Spaces With Locking Size = 'S' panel” on page 195
v “Option 6. Indexes with 2 or More Levels panel” on page 196
v “Option 7. Indexes with 150 or more leaf page distance panel” on page
198
v “Option 8. Indexes On Tables With Fewer Than n Pages panel” on page
199
v “Option 9. Indexes Not Used By Any Plan or Package panel” on page
200
v “Option 10. Table Spaces Containing More Than One Table panel” on
page 201
v “Option 11. Table Spaces Without SPACE Information panel” on page
202
v “Option 11X. Indexes Without SPACE Information panel” on page 203
v “Option 12. Table Spaces Exceeding Allocated Primary Quantity panel”
on page 205
v “Option 12X. Indexes Exceeding Allocated Primary Quantity panel” on
page 206
v “Option 13. Allocated and Used Space for Table Spaces panel” on page
207
v “Option 14. Table Space Maintenance Recommendations panel” on page
209
v “Option 14X. Index Space Maintenance Recommendations panel” on
page 211

The DB2 Performance Queries panel (ADB23) is displayed when you select option
3 on the Administration Menu panel. Use this panel to select the DB2 performance
and space utilization query you want to run. Select an option, and enter (part of)
the name of the database for which the query should be run. See the descriptions
that appear on each panel in this chapter for more information about each option
shown in the following figure.

The select field on the performance queries panels lets you select an object, which
is then shown on the corresponding system catalog panel. This lets you further
investigate problems or choose to run utilities such as REORG and RUNSTATS.

© Copyright IBM Corp. 1995, 2010 187


| DB2 Admin ------------------- DB2 Performance Queries ------------------- 06:22
| Option ===> ___________________________________________________________________
|
|
| WHERE database LIKE . . . ________ DB2 System: DSN9
| AND obj has more than . . 4 pages DB2 SQL ID: ULVEMAN
|
| 1 - Table spaces without RUNSTATS within 0 days DB2 System: DB2X
| 1X - Indexes without RUNSTATS within 0 days DB2 SQL ID: ISTJE
| RUNSTATS information is required for options 2 through 9.
| 2 - Table spaces with more than 10 percent relocated rows
| 3 - Indexes with clustering level problems
| 4 - Table spaces with more than 5 percent dropped space
| 5 - Table spaces with locking size = 'S' (table space locking)
| 6 - Index with 2 or more levels
| 7 - Indexes with 150 or more leaf page distance
| 8 - Indexes on tables with fewer than 6 pages
| 9 - Indexes not used by any plan or package
| 10 - Table spaces containing more than one table
| 11 - Table spaces without SPACE information
| 11X - Indexes without SPACE information
| SPACE information is required for options 12 through 13.
| 12 - Table spaces exceeding allocated primary quantity
| 12X - Indexes exceeding allocated primary quantity
| 13 - Allocated and used space for table spaces
| RTS Real-Time Statistics tables are required for options 14 and 14X.
| 14 - Table Space maintenance recommendations
| 14X - Index Space maintenance recommendations
|
| Switch Catalog Copy . . . N (N/S/C)
|
||
| Figure 118. DB2 Performance Queries panel (ADB23)
|
Related concepts
“DB2 Administration Menu panel” on page 97

188 User's Guide and Reference


Option 1. Table Spaces Without RUNSTATS Information panel
The Table Spaces Without RUNSTATS Information panel is displayed when you
select option 1 on the DB2 Performance Queries panel.

Tip: For table spaces that do not have RUNSTATS information, run the RUNSTATS
utility on them.

The R line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the R line command is equivalent to
entering S, UT, and R commands in succession.

The following figure shows the Table Spaces Without RUNSTATS Information
panel.

DB2 Admin --- DB2X Table Spaces Without RUNSTATS ROW 981 TO 1,000 OF 1,000
Command ===> Scroll ===> PAGE

The following table spaces do not have RUNSTATS information. Consider running
the RUNSTATS utility on them.

Commands: R - Runstats UT - Utilities


Line commands: S - Select R - Runstats

Select Name Schema DB Name BP L E S I C Ntable N Active Space


* * * * * * * * * * * *
------ -------- -------- -------- ---- - - - - - ------ ----------- -----------
RGESI24S RGET RGED001 BP0 P N A N N 1 0 0
RGESI26S RGET RGED001 BP0 P N A N N 1 0 0
RGESMDAS RGET RGED001 BP0 P N A N N 1 0 0
RGESM01S RGET RGED001 BP0 P N A N N 1 0 0
RGESM02S RGET RGED001 BP0 P N A N N 1 0 0
RGESOEGS RGET RGED001 BP0 P N A N N 1 0 0
RGESOEIS RGET RGED001 BP0 P N A N N 1 0 0
RGESOE0S RGET RGED001 BP0 P N A N N 1 0 0
RGESOR1S RGET RGED001 BP0 P N A N N 1 0 0
RGESOS1S RGET RGED001 BP0 P N A N N 1 0 0

Figure 119. Table Spaces Without RUNSTATS Information panel (ADB231)

The following fields are shown on this panel:


SELECT
Input field where you enter S to select a table space.
NAME
Name of the table space.
OWNER
Authorization ID of the owner of the table space.
DB NAME
Name of the database.
BP
Name of the buffer pool used for the table space.
L Locking size, which is one of the following:
A Any
P Page
S Table space
E Erase rule, which is one of the following:
Y Erase

Chapter 10. Running DB2 Admin performance queries 189


N No erase
S Status of the table space, which is one of the following:
A Available
N Not available
I Implicit (whether the table space was created implicitly), which is one of the
following:
Y Yes
N No
C Close rule, which is one of the following:
Y Yes
N No
NTABLE
Number of tables defined in the table space.
N ACTIVE
Number of active pages in the table space. This field is 0 if the RUNSTATS
utility has not been run.
SPACE
Kilobytes (KB) of storage allocated to the table space. This field is 0 if the
STOSPACE utility has not been run.

Option 1X. Indexes Without RUNSTATS Information panel


The Indexes Without RUNSTATS Information panel is displayed when you select
option 1X on the DB2 Performance Queries panel.

Tip: For indexes that do not have RUNSTATS information, run the RUNSTATS
utility on the indexes or on the table spaces using INDEX(ALL) option.

The R line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the R line command is equivalent to
entering S, UT, and R commands in succession.

The following figure shows the Indexes Without RUNSTATS Information panel.

190 User's Guide and Reference


DB2 Admin -------- DB2X Indexes Without RUNSTATS Information ----- Row 1 of 54
Command ===> Scroll ===> PAGE

The following indexes do not have RUNSTATS information. Consider running the
RUNSTATS utility on the indexes or on the table spaces using INDEX(ALL).

Commands: R - Runstats UT - Utilities


Line commands: S - Select R - Runstats

Index Table
S Index Name Schema Table Name Schema
* * * *
- ------------------ -------- ------------------ --------
ADBCKPTX ADB ADBCHKPT ADB
JOBJECT_TABLE_IX DBE JOBJECT_TABLE DBE
OBJECT_TABLE_IX DBE OBJECT_TABLE DBE
DSN_REGISTER_APPLI DSNRGCOL DSN_REGISTER_APPL DSNRGCOL
DSN_REGISTER_OBJTI DSNRGCOL DSN_REGISTER_OBJT DSNRGCOL
XMAP_TBL DSN8810 MAP_TBL DSN8810
XPARTS DSN8810 PARTS DSN8810
CK0X ISTFL2 CK0 ISTFL2
TFLXLIM ISTFL2 TFLTLIM ISTFL2
TFLXLIM2 ISTFL2 TFLTLIM2 ISTFL2
TFLXLIM3 ISTFL2 TFLTLIM3 ISTFL2
TFLXLIM4 ISTFL2 TFLTLIM4 ISTFL2
TFLXLIM6 ISTFL2 TFLTLIM6 ISTFL2
TFLXLTTX1 ISTFL2 TFLTLTTX1 ISTFL2
TFLXLTTX2 ISTFL2 TFLTLTTX2 ISTFL2
TFLXLTTX3 ISTFL2 TFLTLTTX3 ISTFL2
TFLXLTTX4 ISTFL2 TFLTLTTX4 ISTFL2
TFLXLTTX5 ISTFL2 TFLTLTTX5 ISTFL2
TFLXNOVX1 ISTFL2 TFLTNOVX1 ISTFL2
TFLXNOVY1 ISTFL2 TFLTNOVY1 ISTFL2
TFLXV71 ISTFL2 TFLTV71 ISTFL2
TFLXXXX ISTFL2 TFLTXXX ISTFL2
TF2XLIM4 ISTFL2 TF2TLIM4 ISTFL2
TF2XLIM5 ISTFL2 TF2TLIM5 ISTFL2
XD ISTFL2 TD ISTFL2
TYY_BX ISTFL3 TYY ISTFL3
MAPX ISTJE MAP ISTJE
MAPX1 ISTJE MAPT1 ISTJE
MAPX2 ISTJE MAPT2 ISTJE

Figure 120. Indexes Without RUNSTATS Information panel (ADB231X)

The following fields are shown on this panel:


S Input field where you enter S to select an index.
INDEX NAME
Name of the index.
INDEX OWNER
Authorization ID of the owner of the index.
TABLE NAME
Name of the table on which the index is defined.
TABLE OWNER
Authorization ID of the owner of the table.

Option 2. Table Spaces With More Than n Percent Relocated Rows


panel
The Table Spaces With More Than n Percent Relocated Rows panel is displayed
when you select option 2 on the DB2 Performance Queries panel.

Chapter 10. Running DB2 Admin performance queries 191


You can change the percent argument by typing over it on the DB2 Performance
Queries panel. The panel in the following figure shows 10 percent as an example.

Tip: For table spaces that have more than 10 percent relocated rows, that is, rows
that are not located in their original page, reorganize the table spaces or
review the pctfree and/or the free page values to leave more space for rows
to grow during an update.

The O line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the O line command is equivalent to
entering S, UT, and O commands in succession.

DB2 Admin ------- DB2X Table Spaces with Relocated Rows > 10 Pct --------------
Command ===> Scroll ===> PAGE

The following table spaces have more than 10 percent relocated rows,
that is, rows not located in their original page. Consider reorganizing the
table spaces or redesigning the programs that update the rows.

Commands: O - Reorg UT - Utilities


Line commands: S - Select O - Reorg

DB TS Near Far Percent


S Name Name Part Org Page Org Page Relocated Rows
* * * * * * *
- -------- -------- ------ ----------- ----------- ----------- -----------
ISTJE2D ISTJE2S 0 196 0 80 245
******************************* END OF DB2 DATA *******************************

Figure 121. Table Spaces With More Than n Percent Relocated Rows panel (ADB232)

The following fields are shown on this panel:


S Input field where you enter S to select a table space.
DB NAME
Name of the database.
TS NAME
Name of the table space.
PART
Partition number (zero if not partitioned).
NEAR ORG PAGE
Number of rows that have been relocated near their original page.
FAR ORG PAGE
Number of rows that have been relocated far from their original page.
PERCENT RELOCATED
Percent of rows that have been relocated.
ROWS
Number of rows in the table space or partition.

Option 3. Indexes With Clustering Level Problems panel


The Indexes With Clustering Level Problems panel is displayed when you select
option 3 on the DB2 Performance Queries panel.

For indexes that have clustering level problems, the message F.O.P TOO BIG is
displayed and indicates that the number of rows in a far offset position is greater

192 User's Guide and Reference


than 10 percent. In addition, CLUSTERED xx indicates that the index was defined as
clustering, but the RUNSTATS utility found the clustering ratio to be less than 95
percent.

The O line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the O line command is equivalent to
entering S, UT, and O commands in succession.

The following figure shows the Indexes With Clustering Level Problems panel.

DB2 Admin -------- DB2X Indexes with Clustering Level Problems ---- Row 1 of 1
Command ===> Scroll ===> PAGE

The following indexes have clustering level problems. 'F.O.P TOO BIG' indicates
that the number of rows in a far offset position is greater than 10 percent.
'CLUSTERED xx' indicates that the index was defined as clustering but RUNSTATS
found the clustering ratio to be less than 95 percent. Consider reorganizing
the table spaces or redesigning your indexes, tables, and/or programs. Things
to consider are insert/update/delete patterns and frequencies, freespace/reorg
frequencies, and clustering sequences.

Commands: O - Reorg UT - Utilities


Line commands: S - Select O - Reorg

Index Pct in Far


S Index Name Part Schema Offset Pos Clstrng Clstrd Comment
* * * * * * *
- ------------------ ------ -------- ----------- ------- ------ ---------------
XEMP2 0 DSN8810 11 N N F.O.P TOO BIG
DSNKAX01 1 V7COPY4 13 N N F.O.P TOO BIG
DSNKAX03 1 V7COPY4 14 N N F.O.P TOO BIG
DSNKDX02 0 V7COPY4 10 N N F.O.P TOO BIG
ITEST 1 V8DDHL1 0 Y Y CLUSTERED 80%
ITEST2 2 V8DDHL1 0 Y Y CLUSTERED 80%
******************************* END OF DB2 DATA *******************************

Figure 122. Indexes With Clustering Level Problems panel (ADB233)

The following fields are shown on this panel:


S Input field where you enter S to select an index.
INDEX NAME
Name of the index.
PART
Number of partitions.
INDEX OWNER
Authorization ID of the owner of the index.
PCT IN FAR OFFSET POS
Percent of rows in a far offset position because of an insert into a full page.
CLUSTERING
Whether CLUSTER was specified when the index was created.
CLUSTERED
Whether the table is actually clustered by the index.
COMMENT
Reason why the index appears in the list.

Consider reorganizing the table spaces or redesigning your indexes, tables, and
programs. Consider the insert/update/delete patterns and frequencies,
freespace/reorganization frequencies, and clustering sequences.

Chapter 10. Running DB2 Admin performance queries 193


Option 4. Table Spaces With More Than n Percent Dropped Space
panel
The Table Spaces With More Than n Percent Dropped Space panel is displayed
when you select option 4 on the DB2 Performance Queries panel.

You can change the percent argument by typing over it on the DB2 Performance
Queries panel. The panel in the following figure shows 5 percent as an example.

When a table is dropped from a table space, the space it occupied cannot be
reused. If the percent of dropped space is significant, consider reorganizing the
table spaces and use segmented table spaces for the tables.

You should also run the MODIFY utility against table spaces that have dropped
tables. Doing so removes the details of the table from the DBD.

The O line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the O line command is equivalent to
entering S, UT, and O commands in succession.

The following figure shows the Table Spaces With More Than n Percent Dropped
Space panel.

DB2 Admin ---- DB2X Table Spaces with More Than 5 Pct Dropped Space -----------
Command ===> Scroll ===> PAGE

The following table spaces have more than 5 percent dropped space. When
a table is dropped from a table space, the space it occupied cannot be reused.
If the percentage of dropped space is significant, you should consider
reorganizing the table spaces and/or using segmented table spaces for the
tables.

Commands: O - Reorg UT - Utilities


Line commands: S - Select O - Reorg

Percent Primary Secondary


S DB Name TS Name Part Dropped Rows Quantity Quantity
* * * * * * *
- -------- -------- ------ ------- ----------- ----------- ---------
DSQ1STBB DSQ1STBT 0 10 135 100 5
D208D001 D208SPRF 0 17 437 3 3
D475D001 D475S088 0 94 8552 88 13
D154D400 D154STPS 0 24 170 3 2
D154D500 D154STEA 0 12 7 125 3
D922D01 D922SINC 0 10 72 3 3
JFDDBO1 JFDSO4 0 39 1201 984 120
JFDDBO1 JFDSO5 0 20 2621 2280 240

Figure 123. Table Spaces With More Than n Percent Dropped Space panel (ADB234)

The following fields are shown on this panel:


S Input field where you enter S to select a table space.
DB NAME
Name of the database.
TS NAME
Name of the table space.
PART
Partition number (zero if not partitioned).

194 User's Guide and Reference


PERCENT DROPPED
Percent of space occupied by dropped tables.
CARD
Number of rows in the table space or partition.
PRIMARY QUANTITY
Primary space allocation in 4K blocks of storage.
SECONDARY QUANTITY
Secondary space allocation in 4K blocks of storage.

Option 5. DB2 Table Spaces With Locking Size = 'S' panel


The DB2 Table Spaces With Locking Size = 'S' panel is displayed when you select
option 5 on the DB2 Performance Queries panel.

DB2 uses table space locking when accessing a table in the table space. Only use
locking size = 'S' for read-only tables or tables that are accessed by only one user
(or batch job) at a time. If concurrency between updating tasks or updaters and
readers is required, then consider changing the locking size to 'A' (any locking) by
altering the locksize with an ALTER SQL statement.

The AL line command enables you to quickly perform an ALTER TABLESPACE


statement to change the LOCK SIZE to ANY. Entering the AL line command is
equivalent to entering the S line command followed by the AL line command, and
then entering ANY in the LOCK SIZE field.

The following figure shows the DB2 Table Spaces With Locking Size = 'S' panel.

DB2 Admin --------- DB2X Table Spaces with Locking Size = 'S'------------------
Command ===> Scroll ===> PAGE

The following table spaces have locking size = 'S'. DB2 will use table space
locking when accessing a table in the table space. You probably only want
locking size = 'S' for read-only tables or tables that are accessed by only one
user (or batch job) at a time. Consider changing the locking size to 'A' (any
locking), for example, by altering the locksize with an ALTER SQL statement.

Commands: UT - Utilities
Line commands: S - Select AL - Alter

Lock Number of
S DB Name TS Name Size Tables
* * *
-- -------- -------- ---- ---------

D402D10 D402SCIF S 1
D402D10 D402STIF S 1
D455D005 KBBSCOM S 1
D455D005 KBBSCTAB S 1
D455D005 KBBSIMS1 S 1
D455D005 KBBSPRO S 1
D455D005 KBBSAPP S 1

Figure 124. DB2 Table Spaces With Locking Size = 'S' panel (ADB235)

The following fields are shown on this panel:


S Input field where you enter S to select a table space.
DB NAME
Name of the database.

Chapter 10. Running DB2 Admin performance queries 195


TS NAME
Name of the table space.
LOCK SIZE
Lock size of the table space.
NUMBER OF TABLES
Number of tables defined in the table space.

Option 6. Indexes with 2 or More Levels panel


The Indexes with 2 or More Levels panel is displayed when you select option 6 on
the DB2 Performance Queries panel.

You can specify the threshold for the number of levels (2 to 99).

The Indexes with 2 or More Levels panel shows the number of index levels. If the
number exceeds 2 or 3, the performance of your application programs might suffer.
Consider reorganizing the indexes more often or redesigning the indexes and
tables. Consider key lengths, free space (pctfree and/or freepage), and
insert/delete/update patterns and frequencies.

The O line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the O line command is equivalent to
entering S, UT, and O commands in succession.

The following figures shows the Indexes with 2 or More Levels panel.

196 User's Guide and Reference


DB2 Admin -------- DB2X Indexes with 2 or More Levels ----- Row 1 to 7 of 177
Command ===> Scroll ===> PAGE

This panel shows indexes with 2 or more levels. If the number exceeds
2 or 3, it might have a negative impact on the performance of your
application programs. You might consider reorganizing the indexes more
often or redesigning the indexes and tables. Things to consider are
key lengths, free space, and insert/delete/update patterns and
frequencies.

Commands: O - Reorg UT - Utilities


Line commands: S - Select O - Reorg

Index Table Index


S Index Name Schema Table Name Owner Levels
* * * * *
- -----------------> -------- -----------------> -------- ------
DSNDOB01 SYSIBM SYSOBDS SYSIBM 2
DSNDOB02 SYSIBM SYSOBDS SYSIBM 2
DSNUCX01 SYSIBM SYSCOPY SYSIBM 2
IBMSNAP_PRUNCNTLXX ASN IBMSNAP_PRUNCNTLXX ASN 2
IBMSNAP_REGISTERXX ASN IBMSNAP_REGISTERXX ASN 2
XACT1 DSN8810 ACT DSN8810 2
XACT2 DSN8810 ACT DSN8810 2
XDEPT1 DSN8810 DEPT DSN8810 2
XDEPT2 DSN8810 DEPT DSN8810 2
XDEPT3 DSN8810 DEPT DSN8810 2
XEMP1 DSN8810 EMP DSN8810 2
XEMP2 DSN8810 EMP DSN8810 2
XEMPPROJACT1 DSN8810 EMPPROJACT DSN8810 2
XEMPPROJACT2 DSN8810 EMPPROJACT DSN8810 2
XPROJ1 DSN8810 PROJ DSN8810 2
XPROJ2 DSN8810 PROJ DSN8810 2
XPROJAC1 DSN8810 PROJACT DSN8810 2
XDSPTXT1 DSN8810 TDSPTXT DSN8810 2
XOPTVAL1 DSN8810 TOPTVAL DSN8810 2
TFLXLTT1 ISTFL2 TFLTLTT1 ISTFL2 2
DSNFNX01 SYSIBM LUNAMES SYSIBM 2
DSNOXX01 SYSIBM SYSAUXRELS SYSIBM 2
DSNOXX02 SYSIBM SYSAUXRELS SYSIBM 2
DSNSDX01 SYSIBM SYSCHECKDEP SYSIBM 2
DSNSCX01 SYSIBM SYSCHECKS SYSIBM 2
DSNCHX01 SYSIBM SYSCHECKS2 SYSIBM 2
DSNTNX01 SYSIBM SYSCOLDIST SYSIBM 2
DSNHFX01 SYSIBM SYSCOLDIST_HIST SYSIBM 2
DSNTPX01 SYSIBM SYSCOLDISTSTATS SYSIBM 2

Figure 125. Indexes with 2 or More Levels panel (ADB236)

The following fields are shown on this panel:


S Input field where you enter S to select an index.
INDEX NAME
Name of the index.
INDEX OWNER
Authorization ID of the owner of the index.
TABLE NAME
Name of the table on which the index is defined.
TABLE OWNER
Authorization ID of the owner of the table.
INDEX LEVELS
Number of levels in the index tree.

Chapter 10. Running DB2 Admin performance queries 197


Option 7. Indexes with 150 or more leaf page distance panel
The Indexes with 150 or more Leaf Page Distance panel is displayed when you
select option 7 on the DB2 Performance Queries panel.

You can specify the threshold for the leaf page distance (150 to 9999).

The leaf distance is defined as 100 times the average number of pages between
successive leaf pages of the index. If this value exceeds 200, consider reorganizing
the index. Also, consider redesigning the indexes. Consider free
space/reorganization frequencies and insert/update/delete patterns and
frequencies.

The O line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the O line command is equivalent to
entering S, UT, and O commands in succession.

The following figure shows the Indexes with 150 or more Leaf Page Distance
panel.

DB2 Admin---- DB2X Indexes with 150 or More Leaf Page Distanc Row 1 to 7 of 11
Command ===> Scroll ===> PAGE

This panel shows indexes with 150 or more leaf page distance. The
leaf page distance is defined as: 100 times the average number of pages
between successive active leaf pages of the index.If this value exceeds
200, consider reorganizing the index. You might also consider redesigning
the indexes. Things to consider are freespace/reorg frequencies and
insert/update/delete patterns and frequencies.

Commands: O - Reorg UT - Utilities


Line commands: S - Select O - Reorg

Index Table Leaf


S Index Name Schema Part Table Name Schema Distance
* * * * * *
- ------------------ -------- ------ ------------------ -------- -----------
DSNAGH01 SYSIBM 0 SYSRESAUTH SYSIBM 200
DSNKAX01 SYSIBM 0 SYSPACKAUTH SYSIBM 272
DSNKAX02 SYSIBM 0 SYSPACKAUTH SYSIBM 400
DSNATX02 SYSIBM 0 SYSTABAUTH SYSIBM 250
DSNDCX01 SYSIBM 0 SYSCOLUMNS SYSIBM 541
DSNDKX01 SYSIBM 0 SYSKEYS SYSIBM 184
DSNHEX01 SYSIBM 0 SYSCOLUMNS_HIST SYSIBM 385
DSNKSX01 SYSIBM 0 SYSPACKSTMT SYSIBM 1492
******************************* END OF DB2 DATA *******************************

Figure 126. Indexes with 150 or more Leaf Page Distance panel (ADB237)

The following fields are shown on this panel:


S Input field where you enter S to select an index.
INDEX NAME
Name of the index.
INDEX OWNER
Authorization ID of the owner of the index.
PART
Partition number (zero if not partitioned).
TABLE NAME
Name of the table on which the index is defined.

198 User's Guide and Reference


TABLE OWNER
Authorization ID of the owner of the table.
LEAF DISTANCE
One hundred times the average number of leaf pages between successive
active leaf pages of the index.

Option 8. Indexes On Tables With Fewer Than n Pages panel


The Indexes On Tables With Fewer Than n Pages panel is displayed when you
select option 8 on the DB2 Performance Queries panel.

You can change the page number argument by typing over it on the DB2
Performance Queries panel. The panel in the following figure shows six pages as
an example.

Consider dropping nonunique indexes that are defined on tables that have less
than 6 pages. Unless the index is on a table in a table space that has multiple
tables, it is unlikely to improve performance but will use resources to maintain its
viability. However, do not drop unique indexes, indexes supporting constraints,
clustering indexes, or the only index on a table without a full evaluation.

The DROP line command enables you to quickly issue a DROP INDEX statement.
Entering the DROP line command is equivalent to entering an S line command and
a DROP line command in succession.

The following figure shows the Indexes On Tables With Fewer Than n Pages panel.

DB2 Admin ------- DB2X Indexes on Tables with Fewer Than 6 Pages Row 30 of 38
Command ===> Scroll ===> PAGE

The following nonunique indexes are defined on tables with less than 6
pages. Such indexes defined on tables with less than 6 pages usually do not
improve performance and should probably be dropped.

Commands: UT - Utilities
Line commands: S - Select DROP - Drop Index

Index Table Table


Sel Index Name Schema Table Name Schema Pages
* * * * *
---- ------------------ -------- -----------------> -------- -----------
DSNTPX01 SYSIBM SYSCOLDISTSTATS SYSIBM 1
DSNAUH01 SYSIBM SYSUSERAUTH SYSIBM 1
DSNAUX02 SYSIBM SYSUSERAUTH SYSIBM 1
XDEPT2 DSN8810 DEPT DSN8810 1
XDEPT3 DSN8810 DEPT DSN8810 1
XEMP2 DSN8810 EMP DSN8810 2
XPROJ2 DSN8810 PROJ DSN8810 1
XEMPPROJACT2 DSN8810 EMPPROJACT DSN8810 1
TFLXLTT1 ISTFL2 TFLTLTT1 ISTFL2 4
******************************* END OF DB2 DATA *******************************

Figure 127. Indexes On Tables With Fewer Than n Pages panel (ADB238)

The following fields are shown on this panel:


SEL
Input field where you enter S to select an index.
INDEX NAME
Name of the index.

Chapter 10. Running DB2 Admin performance queries 199


INDEX OWNER
Authorization ID of the owner of the index.
TABLE NAME
Name of the table on which the index is defined.
TABLE OWNER
Authorization ID of the owner of the table.
TABLE PAGES
Total number of pages on which rows of the table appear.

Option 9. Indexes Not Used By Any Plan or Package panel


The Indexes Not Used By Any Plan or Package panel is displayed when you select
option 9 on the DB2 Performance Queries panel.

Consider dropping indexes that are not used by any plan or package with static
SQL if they are not used in QMF or any other dynamic SQL statement.

The DROP line command enables you to quickly issue a DROP INDEX statement.
Entering the DROP line command is equivalent to entering an S line command and
a DROP line command in succession.

The following figure shows the Indexes Not Used By Any Plan or Package panel.

200 User's Guide and Reference


DB2 Admin -------- DB2X Indexes Not Used by Any Plan or Package - Row 1 of 138
Command ===> Scroll ===> PAGE

The following indexes are not used by any plan or package with static SQL.
Consider dropping the index if it is not used in QMF or any other dynamic SQL
statement.

Commands: UT - Utilities
Line commands: S - Select DROP - Drop Index

Index Table
Sel Index Name Schema Table Name Schema
* * * *
---- ------------------ -------- ------------------ --------
IBMSNAP_CRITSECX ASN IBMSNAP_CRITSEC ASN
IBMSNAP_PRUNCNTLX ASN IBMSNAP_PRUNCNTL ASN
IBMSNAP_REGISTERX ASN IBMSNAP_REGISTER ASN
IBMSNAP_SUBS_COLSX ASN IBMSNAP_SUBS_COLS ASN
IBMSNAP_SUBS_EVENX ASN IBMSNAP_SUBS_EVENT ASN
IBMSNAP_SUBS_MEMBX ASN IBMSNAP_SUBS_MEMBR ASN
IBMSNAP_SUBS_SETX ASN IBMSNAP_SUBS_SET ASN
IBMSNAP_SUBS_STMTX ASN IBMSNAP_SUBS_STMTS ASN
IBMSNAP_UOW_IDX ASN IBMSNAP_UOW ASN
DSN_REGISTER_APPLI DSNRGCOL DSN_REGISTER_APPL DSNRGCOL
DSN_REGISTER_OBJTI DSNRGCOL DSN_REGISTER_OBJT DSNRGCOL
XACT1 DSN8810 ACT DSN8810
XACT2 DSN8810 ACT DSN8810
XDEPT1 DSN8810 DEPT DSN8810
XDEPT2 DSN8810 DEPT DSN8810
XDEPT3 DSN8810 DEPT DSN8810
XEMP1 DSN8810 EMP DSN8810
XEMP2 DSN8810 EMP DSN8810
XEMPPROJACT1 DSN8810 EMPPROJACT DSN8810
XEMPPROJACT2 DSN8810 EMPPROJACT DSN8810
XMAP_TBL DSN8810 MAP_TBL DSN8810
XPARTS DSN8810 PARTS DSN8810
XPROJ1 DSN8810 PROJ DSN8810
XPROJ2 DSN8810 PROJ DSN8810
XPROJAC1 DSN8810 PROJACT DSN8810
XCONA1 DSN8810 TCONA DSN8810
XDSPTXT1 DSN8810 TDSPTXT DSN8810
XOPTVAL1 DSN8810 TOPTVAL DSN8810

Figure 128. Indexes Not Used By Any Plan or Package panel (ADB239)

The following fields are shown on this panel:


SEL
Input field where you enter S to select an index.
INDEX NAME
Name of the index.
INDEX OWNER
Authorization ID of the owner of the index.
TABLE NAME
Name of the table on which the index is defined.
TABLE OWNER
Authorization ID of the owner of the table.

Option 10. Table Spaces Containing More Than One Table panel
The Table Spaces Containing More Than One Table panel is displayed when you
select option 10 on the DB2 Performance Queries panel.

Chapter 10. Running DB2 Admin performance queries 201


In general, nonsegmented table spaces should only contain one table. Unless you
require more than one table per table space (for example, if you want to cluster
small read-only tables in one table space), consider moving the tables to separate
table spaces.

The following figure shows the Table Spaces Containing More Than One Table
panel.

DB2 Admin ----- DB2X Table Spaces Containing More Than One Table -- Row 1 of 6
Command ===> Scroll ===> PAGE

The following nonsegmented table spaces contain more than one table. In most
cases, nonsegmented table spaces should only contain one table. Unless you
have good reasons for having more than one table per table space (for example,
you want to cluster small read-only tables in one table space), consider moving
the tables to separate table spaces.

Commands: UT - Utilities
Line commands: S - Select

Number of
S DB Name TS Name Tables
* * *
- -------- --------- ---------
DBEDB1 DBETS1 2
DSN8D81A DSN8S81R 6
DSQDBCTL DSQTSCT1 2
DSQ1STBB DSQ1STBT 9
ISTJED ISTJES 6
RAADB RAATSQRC 2
******************************* END OF DB2 DATA *******************************

Figure 129. Table Spaces Containing More Than One Table panel (ADB2310)

The following fields are shown on this panel:


S Input field where you enter S to select a table space.
DB NAME
Name of the database.
TS NAME
Name of the table space.
NUMBER OF TABLES
Number of tables defined in the table space.

Option 11. Table Spaces Without SPACE Information panel


The Table Spaces Without SPACE Information panel is displayed when you select
option 11 on the DB2 Performance Queries panel.

For table spaces that do not have SPACE information in the DB2 catalog, use the
DB2 RUNSTATS and STOSPACE utilities to update the SPACE information.
Consider running these utilities on a periodic basis. You can run RUNSTATS with
options that just update the SPACE fields in the catalog.

The R line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the R line command is equivalent to
entering S, UT, and R commands in succession.

The following figure shows the Table Spaces Without SPACE Information panel.

202 User's Guide and Reference


DB2 Admin ------ DB2X Table Spaces Without SPACE Information - Row 1 of 109
Command ===> Scroll ===> PAGE

The following table spaces do not have SPACE information in the DB2 Catalog.
The DB2 RUNSTATS and SPACE utilities can be used to update the SPACE
information. Consider running these utilities on a periodic basis.

Commands: R - Runstats SP - Stospace UT - Utilities


Line commands: S - Select R - Runstats SP - Stospace

Storage VSAM
S DB Name TS Name Part Group Catalog
* * * * *
-- -------- --------- ------ -------- --------
ADBDCH ADBSCH 0 ADBGCH DB2X
DBEDB1 DBETS1 0 SYSDEFLT DB2X
DBEDB2 DBETSSMP 0 SYSDEFLT DB2X
DSNDB04 A 0 SYSDEFLT DB2X
DSNDB04 AABC1OC9 0 SYSDEFLT DB2X
DSNDB04 AABC1Z#Z 0 SYSDEFLT DB2X
DSNDB04 CK0 0 SYSDEFLT DB2X
DSNDB04 CK1 0 SYSDEFLT DB2X
DSNDB04 DSNRFUNC 0 SYSDEFLT DB2X
DSNDB04 DSNRSTAT 0 SYSDEFLT DB2X
DSNDB04 MMRNAMES 0 SYSDEFLT DB2X
DSNDB04 NAMES 0 SYSDEFLT DB2X
DSNDB04 OBJECTRD 0 SYSDEFLT DB2X
DSNDB04 PLANRTAB 0 SYSDEFLT DB2X
DSNDB04 PLAN1$EE 0 SYSDEFLT DB2X
DSNDB04 PLAN1GVH 0 SYSDEFLT DB2X
DSNDB04 PLAN1PW# 0 SYSDEFLT DB2X
DSNDB04 PLAN15TO 0 SYSDEFLT DB2X
DSNDB04 SRP 0 SYSDEFLT DB2X
DSNDB04 STAFF 0 SYSDEFLT DB2X
DSNDB04 TD 0 SYSDEFLT DB2X
DSNDB04 TESTSORT 0 SYSDEFLT DB2X
DSNDB04 TESTSTUF 0 SYSDEFLT DB2X
DSNDB04 TRI2 0 SYSDEFLT DB2X
DSNDB04 TRI21PD3 0 SYSDEFLT DB2X
DSNDB04 TYY 0 SYSDEFLT DB2X
DSNDB04 T1 0 SYSDEFLT DB2X
DSNDB04 T2 0 SYSDEFLT DB2X
DSNDB04 UTLIST 0 SYSDEFLT DB2X

Figure 130. Table Spaces Without SPACE Information panel (ADB2311)

The following fields are shown on this panel:


S Input field where you enter S to select a table space.
DB NAME
Name of the database on which the table space resides.
TS NAME
Name of the table space.
PART
Partition number (zero if not partitioned).
STORAGE GROUP
Name of the storage group for the table space.
VSAM CATALOG
Name of the catalog used for space allocation.

Option 11X. Indexes Without SPACE Information panel


The Indexes Without SPACE Information panel is displayed when you select
option 11X on the DB2 Performance Queries panel.

Chapter 10. Running DB2 Admin performance queries 203


For indexes that do not have SPACE information in the DB2 catalog, use the DB2
RUNSTATS and SPACE utilities to update the SPACE information. Consider
running these utilities on a periodic basis.

The R line command enables you to quickly move to the Batch Job Utility
Parameters panel (ADB2UPA). Entering the R line command is equivalent to
entering S, UT, and R commands in succession.

The following figure shows the Indexes Without SPACE Information panel.

DB2 Admin -------- DB2X Indexes Without SPACE Information ----- Row 1 of 88
Command ===> Scroll ===> PAGE

The following indexes do not have SPACE information in the DB2 Catalog.
The DB2 RUNSTATS and SPACE utilities can be used to update the SPACE
information. Consider running these utilities on a periodic basis.

Commands: R - Runstats SP - Stospace UT - Utilities


Line commands: S - Select R - Runstats SP - Stospace

Index Storage VSAM


S Index Name Schema Part Group Catalog
* * * * *
-- ------------------ -------- ------ -------- --------
ADBCKPTX ADB 0 ADBGCH DB2X
JOBJECT_TABLE_IX DBE 0 SYSDEFLT DB2X
OBJECT_TABLE_IX DBE 0 SYSDEFLT DB2X
DSN_REGISTER_APPLI DSNRGCOL 0 SYSDEFLT DB2X
DSN_REGISTER_OBJTI DSNRGCOL 0 SYSDEFLT DB2X
XMAP_TBL DSN8810 0 DSN8G810 DB2X
XPARTS DSN8810 0 DSN8G810 DB2X
CK0X ISTFL2 0 SYSDEFLT DB2X
TFLXLIM ISTFL2 1 TFLSG DB2X
TFLXLIM ISTFL2 2 TFLSG DB2X
TFLXLIM ISTFL2 3 TFLSG DB2X
TFLXLIM2 ISTFL2 1 TFLSG DB2X
TFLXLIM2 ISTFL2 2 TFLSG DB2X
TFLXLIM2 ISTFL2 3 TFLSG DB2X
TFLXLIM3 ISTFL2 1 TFLSG DB2X
TFLXLIM3 ISTFL2 2 TFLSG DB2X
TFLXLIM3 ISTFL2 3 TFLSG DB2X
TFLXLIM3 ISTFL2 4 TFLSG DB2X
TFLXLIM3 ISTFL2 5 TFLSG DB2X
TFLXLIM4 ISTFL2 1 TFLSG DB2X
TFLXLIM4 ISTFL2 2 TFLSG DB2X
TFLXLIM4 ISTFL2 3 TFLSG DB2X
TFLXLIM4 ISTFL2 4 TFLSG DB2X
TFLXLIM4 ISTFL2 5 TFLSG DB2X
TFLXLIM6 ISTFL2 1 TFLSG DB2X
TFLXLIM6 ISTFL2 2 TFLSG DB2X
TFLXLIM6 ISTFL2 3 TFLSG DB2X
TFLXLIM6 ISTFL2 4 TFLSG DB2X
TFLXLIM6 ISTFL2 5 TFLSG DB2X

Figure 131. Indexes Without SPACE Information panel (ADB2311X)

The following fields are shown on this panel:


S Input field where you enter S to select an index.
INDEX NAME
Name of the index.
INDEX OWNER
Authorization ID of the owner of the index.
PART
Partition number (zero if not partitioned).

204 User's Guide and Reference


STORAGE GROUP
Name of the storage group for the index.
VSAM CATALOG
Name of the catalog used for space allocation.

Option 12. Table Spaces Exceeding Allocated Primary Quantity panel


The Table Spaces Exceeding Allocated Primary Quantity panel is displayed when
you select option 12 on the DB2 Performance Queries panel.

For table spaces that exceed the allocated primary quantity, consider extending the
primary allocation.

The AL line command enables you to quickly move to the Alter Table Space panel
(ADB21SA). Entering the AL line command is equivalent to entering an S line
command and then entering an AL line command.

The following figure shows the Table Spaces Exceeding Allocated Primary
Quantity panel.

DB2 Admin ---- DB2X Table Spaces Exceeding Alloc Primary Quantity Row 14 of 30
Command ===> Scroll ===> PAGE

The following table spaces exceed the allocated primary quantity. Consider
extending the primary allocation.

Note: If the primary or secondary quantity of 4K pages is less than the track
capacity for 4K blocks, then the number of extents shown is too high.

Commands: UT - Utilities
Line commands: S - Select AL -Alter Tablespace

Primary Qty Sec Allocated Pct Alloc


S DB Name TS Name Part (4K pages) Qty (4K pages) of Prim Qty Ext
* * * * * * * *
-- -------- --------- ------ ----------- ------ ----------- ----------- ------
DSNDB04 IBMS13#P 0 3 3 12 400 1
DSNDB04 RAVN 0 3 3 36 1200 3
DSNDB06 SYSSTR 0 72 72 144 200 2
DSN8D81A DSN8S81D 0 8 5 12 150 1
DSN8D81A DSN8S81E 1 3 3 36 1200 3
DSN8D81A DSN8S81E 2 5 5 36 720 3
DSN8D81A DSN8S81E 3 3 3 12 400 1
DSN8D81A DSN8S81E 4 5 5 36 720 3
DSN8D81A DSN8S81P 0 40 20 48 120 1
DSN8D81P DSN8S81C 0 40 20 48 120 1
ISTJED ISTJES 0 3 3 12 400 1
ISTJED TDECP 1 3 3 12 400 1
ISTJED TDECP2 1 3 3 12 400 1
TFLDB TFLSLTT1 1 8 8 12 150 1
TFLDB TFLSLTT1 2 8 8 12 150 1
TFLDB TFLSLTT1 3 8 8 12 150 1
TFLDB TFLSLTT1 4 8 8 12 150 1
******************************* END OF DB2 DATA *******************************

Figure 132. Table Spaces Exceeding Allocated Primary Quantity panel (ADB2312)

The following fields are shown on this panel:


S Input field where you enter S to select a table space.
DB NAME
Name of the database.

Chapter 10. Running DB2 Admin performance queries 205


TS NAME
Name of the table space.
PART
Partition number (zero if not partitioned).
PRIMARY QTY (4K PAGES)
Primary space allocation in 4K blocks of storage.
SEC QTY
Secondary space allocation in 4K blocks of storage.
ALLOCATED (4K PAGES)
Space allocated in 4K blocks of storage.
PCT ALLOC OF PRIM QTY
Percent of the primary quantity of space that is allocated.
EXT
Estimated number of extents for the table space.

Option 12X. Indexes Exceeding Allocated Primary Quantity panel


The Indexes Exceeding Allocated Primary Quantity panel is displayed when you
select option 12X on the DB2 Performance Queries panel.

For indexes that exceed the allocated primary quantity, consider extending the
primary allocation.

The AL line command enables you to quickly move to the Alter Index panel
(ADB21XA). Entering the AL line command is equivalent to entering an S line
command and then entering an AL line command.

The following figure shows the Indexes Exceeding Allocated Primary Quantity
panel.

DB2 Admin --- DB2X Indexes Exceeding Alloc Primary Quantity ROW 1 TO 9 OF 251
Command ===> Scroll ===> PAGE

The following indexes exceed the allocated primary quantity. Consider extending
the primary allocation.

Note: If the primary or secondary quantity of 4K pages is less than the track
capacity for 4K blocks, then the number of extents shown is too high.

Commands: UT - Utilities
Line commands: S - Select AL - Alter Index

Index Index Prim Qty Sec Q Allocated Pct Alloc


S Name Schema Part (4K pgs) (4K) (4K pages) of Prim Q Ext
* * * * * * * *
-- -----------------> -------> ------ -------- ------ ---------- --------- -----
BKAXINC0 BKAT 1 250 25 288 115 3
BKAXINC0 BKAT 2 225 23 240 106 2
BKAXINC3 BKAT 0 1225 123 1320 107 2
BKAXINC4 BKAT 0 3325 333 3420 102 2
BKAXINC5 BKAT 0 1300 130 1452 111 3
BKAXINC7 BKAT 0 250 25 252 100 2
BKAXCUS0 BKAT 1 125 13 144 115 3

Figure 133. Indexes Exceeding Allocated Primary Quantity panel (ADB2312X)

The following fields are shown on this panel:


S Input field where you enter S to select an index.

206 User's Guide and Reference


INDEX NAME
Name of the index.
INDEX OWNER
Authorization ID of the owner of the index.
PART
Partition number (zero if not partitioned).
PRIM QTY (4K PGS)
Primary space allocation in 4K blocks of storage.
SEC Q (4K)
Secondary space allocation in 4K blocks of storage.
ALLOCATED (4K PAGES)
Space allocated in 4K blocks of storage.
PCT ALLOC OF PRIM Q
Percent of the primary quantity of space that is allocated.
EXT
Estimated number of extents for the index.

Option 13. Allocated and Used Space for Table Spaces panel
The Allocated and Used Space for Table Spaces panel is displayed when you select
option 13 on the DB2 Performance Queries panel.

The DB2 Performance Queries panel shows the allocated and used space for the
table spaces in the databases you have selected. If the allocated space is much less
than the used space, consider reducing the size of the table spaces.

The AL line command enables you to quickly move to the Alter Table Space panel
(ADB21SA). Entering the AL line command is equivalent to entering an S line
command and then entering an AL line command.

The following figure shows the Allocated and Used Space for Table Spaces panel.

Chapter 10. Running DB2 Admin performance queries 207


DB2 Admin -------- DB2X Allocated and Used Space for Table Spaces Row 14 of 48
Command ===> Scroll ===> PAGE

This panel shows the allocated and used space for the table spaces in the
databases you have selected. If the allocated space is much less than the used
space, consider reducing the size of the table spaces.

Note: If the primary or secondary quantity of 4K pages is less than the track
capacity for 4K blocks, then the number of extents shown is too high.

Commands: UT - Utilities
Line commands: S - Select AL - Alter Tablespace

Prim Qty Sec Allocated Pct Pct


S DB Name TS Name Part (in 4K) Qty (4K Pages) Active Dropped Ext
* * * * * *
-- -------- --------- ---- -------- ------ ---------- ---------- -------- ------
DSNDB04 IBMS13#P 0 3 3 12 0 0 1
DSNDB04 RAVN 0 3 3 36 34 0 3
DSNDB06 SYSCOPY 0 540 540 540 0 0 1
DSNDB06 SYSDBASE 0 3600 3600 3600 24 0 1
DSNDB06 SYSDBAUT 0 132 132 132 4 0 1
DSNDB06 SYSDDF 0 144 144 144 0 0 1
DSNDB06 SYSGPAUT 0 144 144 144 2 0 1
DSNDB06 SYSGROUP 0 48 48 48 0 0 1
DSNDB06 SYSGRTNS 0 144 144 144 0 0 1
DSNDB06 SYSHIST 0 144 144 144 38 0 1
DSNDB06 SYSJAVA 0 144 144 144 0 0 1
DSNDB06 SYSOBJ 0 1260 1260 1260 1 0 1
DSNDB06 SYSPKAGE 0 1080 1080 1080 92 0 1
DSNDB06 SYSPLAN 0 1260 1260 1260 8 0 1
DSNDB06 SYSSEQ 0 144 144 144 0 0 1
DSNDB06 SYSSEQ2 0 144 144 144 0 0 1
DSNDB06 SYSSTATS 0 1620 1620 1620 1 0 1
DSNDB06 SYSSTR 0 72 72 144 59 0 2
DSNDB06 SYSUSER 0 108 108 108 4 0 1
DSNDB06 SYSVIEWS 0 1800 1800 1800 6 0 1
DSN8D81A DSN8S81D 0 8 5 12 1 0 1
DSN8D81A DSN8S81E 1 3 3 36 1 0 3
DSN8D81A DSN8S81E 2 5 5 36 0 0 3
DSN8D81A DSN8S81E 3 3 3 12 1 0 1
DSN8D81A DSN8S81E 4 5 5 36 0 0 3

Figure 134. Allocated and Used Space for Table Spaces panel (ADB2313)

The following fields are shown on this panel:


S Input field where you enter S to select a table space.
DB NAME
Name of the database.
TS NAME
Name of the table space.
PART
Partition number (zero if not partitioned).
PRIM QTY (IN 4K)
Primary space allocation in 4K blocks of storage.
SEC QTY (4K PAGES)
Secondary space allocation in 4K blocks of storage.
ALLOCATED (4K PAGES)
Space allocated in 4K blocks of storage.
PCT ACTIVE
Percent of the space that is occupied by rows of data from active tables.

208 User's Guide and Reference


PCT DROPPED
Percent of the space this is occupied by rows of data from dropped tables.
EXT
Estimated number of extents for the table space.

Option 14. Table Space Maintenance Recommendations panel


The Table Space Maintenance Recommendations panel is displayed when you
select option 14 on the DB2 Performance Queries panel.

On this panel, you can enter values (or use the default values) that are used to
calculate recommendations for actions to take. These recommendations can help
you to determine when to run maintenance functions, such as COPY, REORG, or
RUNSTATS on table spaces, or when to enlarge your DB2 data sets.

To use this option, real-time statistics tables are required to be present.

Restriction: The recommendations that DB2 Admin provides are based on general
formulas and might not apply or be accurate for every installation.
Further, if the real-time statistics tables contain only a small portion of
information about your DB2 subsystem, the recommendations might
not apply to the entire subsystem.

You can either enter parameters to be used in the formulas that query real-time
statistics tables or you can use the defaults.

The following figure shows the Input Parameters for Real-Time Statistics panel.

Chapter 10. Running DB2 Admin performance queries 209


DB2 Admin -------- DB2X Input Parameters for Real-Time Statistics ------- 09:39
Option ===>

The input values specified below are used in the calculations which determine
the recommended table space actions. For a full description of any parameter,
use panel HELP and refer to the entry indicated by the parenthesized keyword.

Run using default settings: (Yes/No) (default)


More: +
Limit, number of physical extents . . . . . . . . . : (50)
(ExtentLimit)

Limit, number of days since last image copy. . . . . : (7)


(CRDaySncLastCopy)

Ratio, as percent, of updated pages to preformatted


pages in table space or partition. . . . . . . . . : (1)
(CRUpdatedPagesPct)

Ratio, as percent, of distinct updated pages to


total active pages since last image copy . . . . . : (1)
(ICRUpdatedPagesPct)

Ratio, as percent, of INSERTs, UPDATEs, DELETEs to


total rows or LOBs since last full image copy. . . : (10)
(CRChangesPct)

Ratio, as percent, of INSERTs, UPDATEs, DELETEs to


total rows or LOBs since last incremental image
copy . . . . . . . . . . . . . . . . . . . . . . . : (1)
(ICRChangesPct)

Ratio, as percent, of INSERTs, UPDATEs, DELETEs


to total rows or LOBs since last REORG . . . . . . : (20)
(RRTInsDelUpdPct)

Ratio, as percent, of unclustered INSERTs to


total rows or LOBs . . . . . . . . . . . . . . . . : (10)
(RRTUnclustInsPct)

Ratio, as percent, of imperfectly chunked LOBs to


total rows or LOBS . . . . . . . . . . . . . . . . : (10)
(RRTDisorgLOBPct)

Ratio, as percent, of overflow records to total


of rows or LOBs since last REORG or LOAD REPLACE . : (10)
(RRTIndRefLimit)

Limit, number of mass deletes or dropped tables


since last REORG or LOAD REPLACE . . . . . . . . . : (0)
(RRTMassDelLimit)

Ratio, as percent, of INSERTs, UPDATEs, DELETEs


to total rows or LOBs since last RUNSTATS. . . . . : (20)
(SRTInsDelUpdPct)

Limit, sum of INSERTs, UPDATEs, DELETEs since


last RUNSTATS. . . . . . . . . . . . . . . . . . . : (0)
(SRTInsDelUpdAbs)

Limit, number of mass deletes since last REORG


or LOAD REPLACE. . . . . . . . . . . . . . . . . . : (0)
(SRTMassDelLimit)

Figure 135. Input Parameters for Real-Time Statistics panel (ADB2314T)

You can specify your own user values for the fields in the panel in the previous
figure, and switch between these user values and the system default values. Use
the RESET primary command to reset all user values to the system default values.

210 User's Guide and Reference


The Table Space Maintenance recommendations panel in the following figure
shows a sample results panel that displays recommendations.

| ADB2314 n ---------- DB2X Table Space Maintenance ------- Row 1 to 31 of 1,000


| Command ===> ________________________________________________ Scroll ===> PAGE
| Max no of rows reached
| Commands: C - Full Copy CI - Inc Copy O - Reorg R - Runstats
| (Add 'A' to primary commands to process all partitions
| in a single step, for example: CA , CIA , OA , RA )
| Line commands: C - Full Copy CI - Inc Copy O - Reorg R - Runstats
| AL - Resize S - Select
| Pct Num <---Recommendations--->
| Sel TSname DBname Part Space(KB) Used Ext Copy Reorg Runst Resize
| * * * ___________ * * * * * *
| --- -------- -------- ------ ----------- ---- ------ ---- ----- ----- ------
| ___ DSN8S91E DSN8D91A 1400 ? ? ? FUL YES YES NO
| ___ XPUR0000 DSN8D91X 0 720 100 1 FUL YES YES NO
| ___ XSUP0000 DSN8D91X 0 720 100 1 FUL YES YES NO
| ___ DSQTSRDO DSQDBCTL 0 48 100 1 FUL YES YES NO
| ___ LI6510TS VNDS148 1 48 100 1 FUL YES YES NO
| ___ LI6510TS VNDS148 2 48 100 1 FUL YES YES NO
| ___ LI6510TS VNDS148 3 48 100 1 FUL YES YES NO
| ___ LI6510TS VNDS148 4 48 100 1 FUL YES YES NO
| ___ ARCHIVE1 DBADD101 0 48 100 1 FUL YES YES NO
| ___ RETRIEV1 DBADD101 0 48 100 1 FUL YES YES NO

Figure 136. Table Space Maintenance recommendations panel (ADB2314), which is the
result of panel ADB2314T

Option 14X. Index Space Maintenance Recommendations panel


The Index Space Maintenance Recommendations panel is displayed when you
select option 14X on the DB2 Performance Queries panel.

On this panel, you can enter values (or use the default values) that are used to
calculate recommendations for actions to take. These recommendations can help
you to determine when to run maintenance functions, such as COPY, REORG, or
RUNSTATS on index spaces, or when to enlarge your DB2 data sets.

Requirement: To use this option, real-time statistics tables must be present.

Restriction: The recommendations that DB2 Admin provides are based on general
formulas and might not apply or be accurate for every installation.
Further, if the real-time statistics tables contain only a small portion of
information about your DB2 subsystem, the recommendations might
not apply to the entire subsystem.

You can either enter parameters to be used in the formulas that query real-time
statistics tables or you can use the defaults.

The following figure shows the Input Parameters for Real-Time Statistics panel.

Chapter 10. Running DB2 Admin performance queries 211


DB2 Admin -------- DB2X Input Parameters for Real-Time Statistics ------- 10:11
Option ===>

The input values specified below are used in the calculations which determine
the recommended index space actions. For a full description of any parameter,
use panel HELP and refer to the entry indicated by the parenthesized keyword.

Run using default settings: YES (Yes/No) (default)


More: +
Limit, number of physical extents. . . . . . . . . . : 50 (50)
(ExtentLimit)

Limit, number of days since last image copy. . . . . : 7 (7)


(CRDaySncLastCopy)

Ratio, as percent, of updated pages to preformatted


pages. . . . . . . . . . . . . . . . . . . . . . . : 1 (1)
(CRUpdatedPagesPct)

Ratio, as percent, of INSERTs, UPDATEs, DELETEs


to total rows or LOBs since last image copy. . . . : 10 (10)
(CRChangesPct)

Limit, number of active pages. . . . . . . . . . . . : (50)


(CRIndexSize)

Ratio, as percent, of sum of inserted and deleted


index entries to total since last REORG. . . . . . : (20)
(RRIInsertDeletePct)

Ratio, as percent, of inserted index entries with


key greater than max to total since last REORG,
REBUILD INDEX or LOAD REPLACE. . . . . . . . . . . : (10)
(RRIAppendInsertPct)
Ratio, as percent, of pseudo-deleted index entries
to total since last REORG, REBUILD INDEX or
LOAD REPLACE . . . . . . . . . . . . . . . . . . . : (10)
(RRIPseudoDeletePct)

Limit, number of mass deletes since last REORG,


REBUILD, or LOAD REPLACE . . . . . . . . . . . . . : (0)
(RRIMassDelLimit)

Ratio, as percent, of number of index page splits


far from original to total since last REORG,
REBUILD INDEX or LOAD REPLACE. . . . . . . . . . . : (10)
(RRILeafLimit)

Limit, number of added or removed levels in index


tree since last REORG, REBUILD INDEX, or LOAD
REPLACE. . . . . . . . . . . . . . . . . . . . . . : (0)
(RRINumLevelsLimit)

Ratio, as percent, of number of inserted and deleted


index entries to total since last RUNSTATS . . . . : (20)
(SRIInsDelUpdPct)

Limit, number of inserted and deleted index entries


since last RUNSTATS. . . . . . . . . . . . . . . . : (0)
(SRIInsDelUpdAbs)

Limit, number of mass deletes since last REORG,


REBUILD INDEX or LOAD REPLACE. . . . . . . . . . . : (0)
(SRIMassDelLimit)

Figure 137. Input Parameters for Real-Time Statistics panel (ADB2314I)

You can specify your own user values for the fields in the previous figure, and
switch between these user values and the system default values. Use the RESET
primary command to reset all user values to the system default values.

212 User's Guide and Reference


The Index Space Maintenance recommendations panel in the following figure
shows a sample results panel that displays recommendations.

ADB23214X ---------- DB2X Index Space Maintenance ---------- Row 1 to 13 of 13


Command ===> Scroll ===> CSR

Commands: C - Copy O - Reorg R - Runstats


Line commands: C - Copy O - Reorg R - Runstats AL - Resize S - Select

Index <---Recommendations--->
Sel Space DBname Part Nactive Space Ext Copy Reorg Runst Resize
* * * * * * * * * *
--- -------- -------- ---- ----------- ----------- --- ---- ----- ----- ------
AUXTST1X DSNDB04 0 12 48 1 YES YES YES NO
XCUSTLAS DSNDB04 0 12 48 1 YES YES YES NO
XCUST000 DSNDB04 0 12 48 1 YES YES YES NO
AUXBB31X DSNDB04 0 12 48 1 YES YES YES NO
SALE1FAM DSNDB04 0 12 48 1 YES YES YES NO
PLAN1L@B DSNDB04 0 12 48 1 YES YES YES NO
XTBIDENT DSNDB04 0 12 48 1 YES YES YES NO

Figure 138. Index Space Maintenance recommendations panel (ADB2314X), which is the
result of panel ADB2314I

Chapter 10. Running DB2 Admin performance queries 213


214 User's Guide and Reference
Chapter 11. Using LISTDEFs and TEMPLATEs
LISTDEFs are used to specify multiple target objects either by specifying explicit
names or patterns of names using wild cards, and TEMPLATEs allow you to
define a data set pattern or mask to be used in place of JCL DD statements for
various utilities.

A LISTDEF is a DB2 utility statement, which is used list of database objects. DB2
Utility processing generates a list of objects that matches the LISTDEF pattern or
definition, and passes that list to the intended utility.

For example, if you want to make an image copy of all the table spaces in database
ABC, you no longer need to explicitly list each table space. Instead, you can tell
DB2 to make an image copy of every table space in database ABC. DB2 utility
processing builds the list of objects during execution. The LISTDEF approach not
only saves time, but also prevents an object from being erroneously omitted.

The TEMPLATE utility control statement eliminates the need for certain JCL DD
statements during utility processing. In its simplest form, the TEMPLATE control
statement defines the data set naming convention, but it can also control other
allocation attributes, such as size or location.

TEMPLATE definitions can be used with or without LISTDEFs; therefore, within


DB2 Admin the usage state for TEMPLATEs remains in effect for LISTDEF as well
as non-LISTDEF utility invocations.

The template data set name is constructed during the processing of the utility, and
is based on the template's data set name mask or pattern. The data set name mask
or pattern is also likely to include an object-identifying pattern as part of its name,
such as database or space name. Many variables can be used and combined
together to form distinct and unique data set names. This allows a single utility job
step to cover many data objects (using LISTDEFs, for example) and allows the
target output data sets to be defined dynamically with TEMPLATEs.

DB2 Admin also supports the use of TEMPLATEs for DB2 Admin work data sets
that are created and used in the jobs that are generated for the following functions:
alter, restore, redefine, migrate, and object comparison. As with the utility data
sets, TEMPLATES allow you to define your own data set naming convention and
also control other allocation attributes for these non-utility work data sets. The set
of variables that can be specified for the data set names for these non-utility work
data sets depends on the DB2 Admin function.

Topics:
v “Managing LISTDEFs” on page 217
v “Managing TEMPLATEs” on page 226
v “TEMPLATE usage” on page 234
v “Using the utility template to unload data from LOBs” on page 236
| v “Using the utility template to unload data from an XML column” on
| page 237

© Copyright IBM Corp. 1995, 2010 215


Related concepts
“DB2 Administration Menu panel” on page 97
Related information
IBM Publications Center

216 User's Guide and Reference


Managing LISTDEFs
With DB2 Admin, you can manage LISTDEFs by creating LISTDEF control tables,
and by adding, editing, and deleting LISTDEFs.

Topics:
v “Creating the LISTDEF control tables”
v “Adding a LISTDEF” on page 219
v “Editing a LISTDEF” on page 221
v “Editing a single LISTDEF clause” on page 224
v “Deleting a LISTDEF” on page 226

Creating the LISTDEF control tables


Before you can create and use LISTDEFs, you must create two DB2 control tables
to store the LISTDEF definitions.

These tables have the following default names:


v DSNACC.UTLIST contains basic LISTDEF definitions.
v DSNACC.UTLISTE contains detailed LISTDEF definitions.
If you are using the DB2 Control Center, these tables might have already been
created during installation by the DSNTIJCC.job. Before proceeding with the
following steps, determine whether these tables already exist. If they do exist, go to
“Editing a LISTDEF” on page 221.

To create the LISTDEF control tables:


1. Select option 5 on the Administration Menu panel. The Utility generation using
LISTDEFs and TEMPLATEs panel is displayed, as shown in the following
figure.

| ADB25 min ----- DSN9 Utility generation using LISTDEFs and TEMPLATEs ---- 00:33
| Option ===>
|
| L - Manage LISTDEFs DB2 System: DSN9
| T - Manage TEMPLATEs DB2 SQL ID: ISTJE
| TU - Specify TEMPLATE usage
|
| CL - Create LISTDEF control table
| UL - Upgrade LISTDEF control table
| CT - Create TEMPLATE control table
| UT - Upgrade TEMPLATE control table
|
| LISTDEF control table:
| Table owner . . . DSNACC >
| Table name . . . UTLIST >
|
| TEMPLATE control table:
| Table owner . . . DSNACC >
| Table name . . . UTTEMPLATE >
||
| Figure 139. Utility generation using LISTDEFs and TEMPLATEs panel (ADB25)
|
2. Select option CL. The LISTDEF Control Table panel is displayed, as shown in
the following figure.

Chapter 11. Using LISTDEFs and TEMPLATEs 217


DB2 Admin ------------- DB2X LISTDEF Control Table----------------------- 11:05
Command ===>

Create LISTDEF control table

Creator ===> DSNACC > (optional, default is ISTJE)


Name ===> UTLIST > (? to look up)

IN
Database ===> (optional, default is DSNDB04. ? to look up)
Table space ===> (optional, if blank DB2 implicitly creates a TS. ?))

Index Creator ===> > (optional, default is ISTJE)


Index Name ===> UTLSTX01 >
Index Creator ===> > (optional, default is ISTJE)
Index Name ===> UTLEX01 >

Figure 140. LISTDEF/TEMPLATE Control Table panel (ADB25C)

3. Specify the following values:


v In the Creator and Name fields, specify a name for the control tables. Accept
the default name (DSNACC.UTLIST) or enter a unique name. The control
table that contains detailed LISTDEF definitions is automatically appended
with an “E.”

Tip: Use the default name if you intend to use the DB2 Control Center in the
future. Using the standard name eliminates the need to populate the
DSNACC tables when you start using the Control Center. However, if
you do choose the default name, be aware that running the DSNTIJCC
job will drop any existing LISTDEF control tables.
v In the Database and Table Space fields, specify location information for the
control tables.
v In the first set of Index Creator and Index Name fields, specify the name of
the index creator and the name of the index for the basic LISTDEF definition
table (DSNACC.UTLIST by default).
v In the second set of Index Creator and Index Name fields, specify the name
of the index creator and the name of the index for the detailed LISTDEF
definition table (DSNACC.UTLISTE by default). The index creator should
match the name specified for the DSNACC.ULIST table, but the index creator
name must be unique.
4. Press Enter to create the tables.
Related tasks
“Running utilities on LISTDEFs” on page 368

| Upgrading the LISTDEF control tables


| Use the UL command option to upgrade a LISTDEF control table to the current
| DB2 version.

| To upgrade the LISTDEF control tables:


| 1. Select option 5 on the Administration Menu panel. The Utility generation using
| LISTDEFs and TEMPLATEs panel is displayed.
|

218 User's Guide and Reference


| ADB25 min ----- DSN9 Utility generation using LISTDEFs and TEMPLATEs ---- 00:33
| Option ===>
|
| L - Manage LISTDEFs DB2 System: DSN9
| T - Manage TEMPLATEs DB2 SQL ID: ISTJE
| TU - Specify TEMPLATE usage
|
| CL - Create LISTDEF control table
| UL - Upgrade LISTDEF control table
| CT - Create TEMPLATE control table
| UT - Upgrade TEMPLATE control table
|
| LISTDEF control table:
| Table owner . . . DSNACC >
| Table name . . . UTLIST >
|
| TEMPLATE control table:
| Table owner . . . DSNACE >
| Table name . . . UTTEMPLATE >
||
| Figure 141. Utility generation using LISTDEFs and TEMPLATEs panel (ADB25)
|
| 2. Select option UL on the option command line and press Enter. Validation of the
| table name is done to make sure it is a LISTDEF control table. The validation is
| based on the following column names and data types: NAME VARCHAR(18),
| TYPE VARCHAR(2), CREATEDBY VARCHAR(8), MODIFIEDBY VARCHAR(8),
| REMARKS VARCHAR(254). If the LISTDEF control table name is note at the
| current version, an upgrade is performed.

Adding a LISTDEF
Use the LISTDEFs panel to add a LISTDEF to the LISTDEF control tables.

To add a LISTDEF to the LISTDEF control tables:


1. Select option 5 on the Administration Menu panel.
2. Select option L. The LISTDEFs panel is displayed, as shown in the following
figure.

Chapter 11. Using LISTDEFs and TEMPLATEs 219


DB2 Admin --------- DB2X LISTDEFs in DSNACC.UTLIST -------- Row 1 to 17 of 17
Command ===> Scroll ===> CSR

Line commands:
A - Add D - Delete E - Edit UT - Utility selection
U.x - Utility generation

Select Name Creator Type Remarks


* * * *
------ ------------------ -------- ---- -------------------------------------->
DBLT0301 SYSADM B linner, segmented and partitioned table
DBLT0302 SYSADM B linner, segmented and partitioned table
DBLT0303 SYSADM B linner, segmented and partitioned table
DBLT0304 SYSADM B linner, segmented and partitioned table
LISTLT03 SYSADM B dblt0301, dblt0302, dblt0303, and dblt0
LT03I SYSADM I
LT03T SYSADM T
LT0301I SYSADM I
LT0301T SYSADM T
LT0302I SYSADM I
LT0302T SYSADM T
LT0303I SYSADM I
LT0303T SYSADM T
LT0304I SYSADM I
LT0304T SYSADM T
MYTABLES DSNACC B
SYSIBM DSNACC T
******************************* END OF DB2 DATA *******************************

Figure 142. LISTDEFs panel (ADB25L)

The following fields are shown on this panel:


SEL Input field where you enter the line command. The following line
commands are valid:
A Add a new LISTDEF.
D Delete a LISTDEF.
E Edit a LISTDEF.
UT Invoke a utility against a LISTDEF.
NAME
The name of a LISTDEF.
CREATOR
Creator of the definition, or the last ID to update it.
TYPE This field is included for compatibility with DB2 Control Center/390
(CC/390) and can have one of three values. For LISTDEFs that are
added with DB2 Admin, the value is B (the default). This field is
updatable.
T Table space
I Index space
B Both table space and index space
REMARKS
This field contains an optional description of the LISTDEF. You can
modify this field.
3. Issue the A line command. The Add LISTDEF panel is displayed, shown in the
following figure.

220 User's Guide and Reference


DB2 Admin --------------- DB2X Utility LISTDEF - Add -------------------- 11:10
Command ===>

Enter the following information:

Name ===> (LISTDEF name)


Remarks ===>

Figure 143. Add LISTDEFs panel (ADB25LA)

The following fields are shown on this panel:


NAME
Enter the name of the LISTDEF. This name must be unique for the
control table being used.
REMARKS
Enter an optional description of the LISTDEF.
4. Enter a unique name for the LISTDEF, identify the type of objects that the
LISTDEF will apply to (T for table spaces, I for index spaces, or B for both) and
optionally include a description of the LISTDEF.
5. Press Enter to add the LISTDEF to the LISTDEF control tables.
Related tasks
“Editing a LISTDEF”
“Running utilities on LISTDEFs” on page 368

Editing a LISTDEF
With DB2 Admin, you can add, delete, or edit a clause contained in a LISTDEF.

Each LISTDEF consists of one or more clauses; each clause represents a separate
line on the panel. When you initially define a LISTDEF, an empty clause is created.
Use the following instructions to complete the definition of a new, empty clause, to
edit an existing clause, or to delete a clause. You then fill in the fields to complete
the definition of the clause; if you fail to fill in a required field, DB2 Admin
prompts you for it. After a clause is created, you can edit it by typing over the
field you wish to change or you can enter an E to the left of the clause to be
changed. This latter approach can be used to edit a single clause.
1. From the LISTDEFs panel, issue the E line command against the LISTDEF that
you want to edit. The Edit LISTDEF panel is displayed, as shown in the
following figure.

DB2 Admin -------------- DB2X Utility LISTDEF A234567890123456 Row 1 to 2 of 2


Command ===> Scroll ===> PAGE

Line commands:
A - Add D - Delete E - Edit UT - Utility generation
C - Copy
Sel # Incl/ Targ Srch Obj Srch Obj Srch Obj Name Cpy Part LOB RI
Excl Obj Type Qual or Pattern
* * * * * * * * * *
--- ---- ------- ---- ---------- -------- ------------------ --- ---- --- --
1 INCLUDE TBSP TABLESPACE DSNDB04 *
2 INCLUDE IXSP TABLE DSNDB04 * Y
******************************* END OF DB2 DATA *******************************

Figure 144. Edit LISTDEF control table panel (ADB25LE)

New, empty clauses are identified by a question mark (?) in the Incl/Excl field.
The following fields are shown on this panel:

Chapter 11. Using LISTDEFs and TEMPLATEs 221


SEL Action field where you enter the line command. The following line
commands are valid:
A Adds a new clause to the LISTDEF.
D Deletes a clause.
E Edits a LISTDEF clause. Use the Edit LISTDEF clause panel to
edit a single clause.
UT Invokes a utility against a single clause of the LISTDEF.
# The sequence number is part of a unique key which means that no two
clauses within the same LISTDEF can have the same sequence number.
The sequence of your clauses is important, because clauses are executed
in ascending order. If you need to reorder the clauses in a LISTDEF,
make room by updating the lowest clause that needs to be changed
with a sequence number greater than the others, then renumbering the
rest as needed.
INCL/EXCL
Include or exclude objects based on the search criteria. It is sufficient to
enter I or E.
TARG OBJ
This field refers to whether a list of table spaces or index spaces is to be
created. It is sufficient to enter T for table spaces or I for index spaces.
SRCH OBJ TYPE
This field refers to the type of object for which to search. The following
values are permissible:
D Database
L List
T Table
TS Table space
I or IX
Index
IS Index space
SRCH OBJ QUAL
For object types table and index, this field indicates the owner.
For object types table space and index space, this field indicates the
database name.
For certain object types, partial or complete wild-carding is available by
using an asterisk (*). For example, DB01*.
SRCH OBJ NAME OR PATTERN
This field indicates the name of the search object, with partial or
complete wild-carding available for certain object types. The wild card
character is the asterisk (*).
CPY This field refers to COPY YES or COPY NO, and is applicable only to
index spaces. For COPY YES, enter Y. For COPY NO, enter N.
PART This field refers to the PARTLEVEL keyword, or, if a number is
specified, to the partition that is to be included. Permissible values are:

222 User's Guide and Reference


blank
The PARTLEVEL keyword is not added to the LISTDEF clause. As
a result, the entire set of partitions in a partitioned table space is
included as one unit. A sample LISTDEF might look like this:
LISTDEF T -- 00000010 OBJECTS
INCLUDE TABLESPACE R148286.DB2CLEAN
INCLUDE TABLESPACE R148286.DSN8S81D
INCLUDE TABLESPACE R148286.DSN8S81E
INCLUDE TABLESPACE R148286.DSN8S81P
INCLUDE TABLESPACE R148286.EMP1
INCLUDE TABLESPACE R148286.PART
INCLUDE TABLESPACE R148286.PLANRTAB
INCLUDE TABLESPACE R148286.T1
INCLUDE TABLESPACE R148286.T2
INCLUDE TABLESPACE R148286.T3
Y Each partition is included as a separate object; the result might look
like this:
LISTDEF T -- 00000014 OBJECTS
INCLUDE TABLESPACE R148286.DB2CLEAN
INCLUDE TABLESPACE R148286.DSN8S81D
INCLUDE TABLESPACE R148286.DSN8S81E PARTLEVEL(00001)
INCLUDE TABLESPACE R148286.DSN8S81E PARTLEVEL(00002)
INCLUDE TABLESPACE R148286.DSN8S81E PARTLEVEL(00003)
INCLUDE TABLESPACE R148286.DSN8S81E PARTLEVEL(00004)
INCLUDE TABLESPACE R148286.DSN8S81P
INCLUDE TABLESPACE R148286.EMP1
INCLUDE TABLESPACE R148286.PART PARTLEVEL(00001)
INCLUDE TABLESPACE R148286.PART PARTLEVEL(00002)
INCLUDE TABLESPACE R148286.PLANRTAB
INCLUDE TABLESPACE R148286.T1
INCLUDE TABLESPACE R148286.T2
INCLUDE TABLESPACE R148286.T3
1-4096
Enter a single partition number in this range for it to be included.
(For releases of DB2 prior to Version 8, the allowable range of
values is 1 to 254.) The resultant LISTDEF might look like the
following example:
LISTDEF T -- 00000010 OBJECTS
INCLUDE TABLESPACE R148286.DB2CLEAN
INCLUDE TABLESPACE R148286.DSN8S81D
INCLUDE TABLESPACE R148286.DSN8S81E PARTLEVEL(00001)
INCLUDE TABLESPACE R148286.DSN8S81P
INCLUDE TABLESPACE R148286.EMP1
INCLUDE TABLESPACE R148286.PART PARTLEVEL(00001)
INCLUDE TABLESPACE R148286.PLANRTAB
INCLUDE TABLESPACE R148286.T1
INCLUDE TABLESPACE R148286.T2
INCLUDE TABLESPACE R148286.T3
LOB This field indicates a large object type. Specify one of the following
values:
A Enter an A for ALL (base table spaces, related index spaces, and
large objects).
B Enter a B for base table spaces and related index spaces.
L Enter an L for a large object.
RI Specify Y to include objects that are related through referential integrity.
2. To edit existing clauses, you can either type over the field or fields that you
want to change or you can issue the E line command to edit a single clause.

Chapter 11. Using LISTDEFs and TEMPLATEs 223


3. To add a clause, issue the A line command. A new empty clause, as identified
by a question mark (?), is inserted, as shown in the panel in the following
figure.

DB2 Admin -------------- DB2X Utility LISTDEF A234567890123456 Row 1 to 3 of 3


Command ===> Scroll ===> PAGE

Line commands:
A - Add D - Delete E - Edit UT - Utility generation
C - Copy
Sel # Incl/ Targ Srch Obj Srch Obj Srch Obj Name Cpy Part LOB RI
Excl Obj Type Qual or Pattern
* * * * * * * * * *
--- ---- ------- ---- ---------- -------- ------------------ --- ---- --- --
1 INCLUDE TBSP TABLESPACE DSNDB04 *
2 INCLUDE IXSP TABLE DSNDB04 * Y
3 ?
******************************* END OF DB2 DATA *******************************

Figure 145. LISTDEF panel (ADB25LE) – adding a clause

4. Type in the fields to complete the definition of the clause and press Enter to
complete the addition. Alternatively, you can enter an E to the left of the clause
to bring up the Edit LISTDEF clause panel, which can be used to edit a single
clause.
5. To delete a clause, issue the D line command against the clause that you want
to delete.
Related tasks
“Adding a LISTDEF” on page 219
“Editing a single LISTDEF clause”
“Editing a single LISTDEF clause”

Editing a single LISTDEF clause


Use the Edit LISTDEF clause panel to edit a single LISTDEF clause.

To edit a single LISTDEF clause:


1. To display the Edit LISTDEF clause, issue the E line command against a
LISTDEF. The following figure shows the Edit LISTDEF clause panel.

DB2 Admin --------------- DB2X Utility LISTDEF - A ---------------------- 10:55


Command ===>

Incl/Excl ===> INCLUDE (Include or Exclude)


Target Obj ===> TBSP (TBSP or IXSP)
Copy ===> (Yes/No)
Srch Obj Type ===> TABLESPACE (List, Database, TableSpace, IndexSpace,
Table, Index)
Srch Obj Qual ===> DSNDB04 (Owner or Database to qualify NAME)
Srch Obj Name ===> * (Name - Full or partial using *)
Partlevel ===> (Y, 1-4096, or blank)
RI Related
Objects ===> (Y)
LOB ===> (All, Base, or LOB)

Sequence ===> 1 (Processing order)

Press ENTER to update the LISTDEF clause.

Statement ===> INCLUDE TABLESPACES TABLESPACE DSNDB04.*

Figure 146. Edit LISTDEF clause panel (ADB25LEA)

224 User's Guide and Reference


2. Specify the following values. As you enter information in the fields, the
generated LISTDEF clause is shown at the bottom of the panel.
The following fields are shown on this panel:
INCL/EXCL
Include or exclude objects based on the search criteria. It is sufficient to
enter I include objects or E to exclude objects.
TARGET OBJ
Permissible values are:
T Table space
I Index space
COPY This field refers to COPY YES or COPY NO, and is applicable only to
index spaces. For COPY YES, enter Y. For COPY NO, enter N.
SRCH OBJ TYPE
This field refers to the type of DB2 Admin Look Up object for the initial
search. The following values are permissible:
L List
D Database
TS Table space
IS Index space
TB Table
I or IX
Index
SRCH OBJ QUAL
For DB2 Admin Look Up types table and index, this field indicates the
owner.
For DB2 Admin Look Up types table space and index space, this field
indicates the database name.
For some DB2 Admin Look Up types, partial or complete wild-carding
is available by using an asterisk (*). For example, DB01*.
SRCH OBJ NAME
This field indicates the name of the DB2 Admin Look Up object, with
partial or complete wild-carding available for some DB2 Admin Look
Up types. The wild card character is the asterisk (*).
PARTLEVEL
This field refers to the PARTLEVEL keyword, or, if a number is
specified, to the partition that is to be included.
RI Specify Y to include objects that are related through referential integrity.
LOB This field indicates a large object type. Specify one of the following
values:
A Specify an A for ALL (base table spaces, related index spaces,
and large objects).
B Specify a B for base table spaces and related index spaces.
L Specify an L for LOB.

Chapter 11. Using LISTDEFs and TEMPLATEs 225


SEQUENCE
The sequence number is part of a unique key, which means that no two
clauses with the same LISTDEF can have the same sequence number.
The sequence of your clauses is important because they are executed in
ascending order. If you need to reorder the clauses in a LISTDEF, create
room by updating the lowest clause that needs to be changed with a
sequence number greater than the others; then renumber the rest as
needed.
Related tasks
“Editing a LISTDEF” on page 221
“Editing a LISTDEF” on page 221

Deleting a LISTDEF
Use the LISTDEFs panel to delete a LISTDEF from the LISTDEF control tables.

To delete a LISTDEF from the LISTDEF control tables:


1. Select option 5 on the Administration Menu panel. The Utility generation using
LISTDEFs and TEMPLATEs panel is displayed.
2. Select option L. The LISTDEFs panel is displayed.
3. Issue the D line command to delete the corresponding LISTDEF from the
LISTDEF control tables.

The LISTDEF is removed from the control tables.

Managing TEMPLATEs
With DB2 Admin, you can create and maintain TEMPLATEs.

Topics:
v “Adding, editing, or deleting a TEMPLATE”
v “Utility Template panel” on page 228
v “Utility Template — Dataset Name panel” on page 231
Related concepts
“Using table space utilities” on page 356
“Using table utilities” on page 362
“Using index utilities” on page 365

Adding, editing, or deleting a TEMPLATE


Use the TEMPLATEs panel to add, edit, or delete a TEMPLATE.

The TEMPLATEs panel, as shown in the following figure, is displayed when you
select option T on the Utility generation using LISTDEFs and TEMPLATEs panel.
The panel also displays when you enter a question mark (?) on the Utility
Template Use panel. The TEMPLATEs panel presents the existing TEMPLATEs
within the control table; the table name is shown in the panel header (in this case,
DSNACC.UTTEMPLATE).

Use this panel to add, edit, or delete a TEMPLATE definition.

226 User's Guide and Reference


DB2 Admin --------- DB2X TEMPLATEs in DSNACC.UTTEMPLATE --- Row 1 to 21 of 21
Command ===> Scroll ===> CSR

Line commands: A - Add E - Edit D - Delete

Sel Name Creator Remarks


* * *
----- ------------------ -------- ---------------------------------------------
* COPYLOC SYSADM
COPYREM SYSADM
COPYREM2 SYSADM
FTERDDN SYSADM
INDDN SYSADM
SCOPY SYSADM
SCOPY2 SYSADM
SCOPY3 SYSADM
SCOPY4 SYSADM
SCOPY5 SYSADM
SDISC SYSADM
SERR SYSADM
SMAP SYSADM
SORTOUT SYSADM
SPUNCH SYSADM
SRCPY1 SYSADM
SRCPY2 SYSADM
SREC SYSADM
SUT1 SYSADM
UNLDDN SYSADM
WORKDDN SYSADM
******************************* END OF DB2 DATA *******************************

Figure 147. TEMPLATEs panel (ADB25T)

The following fields are shown on this panel:


SEL Input field where you enter a line command. The following line commands
are valid:
A Enter an A to add a new TEMPLATE.
E Enter an E to edit a TEMPLATE definition.
D Enter a D to delete a TEMPLATE.
+ Enter a plus sign (+) to associate the template with a keyword on
the Utility Template Use panel.
NAME
This is the TEMPLATE name.
CREATOR
Creator of the TEMPLATE, or the last ID to update it.
REMARKS
This field contains an optional description of the TEMPLATE. You can
modify this field.
Related tasks
“TEMPLATE usage” on page 234

| Upgrading the TEMPLATE control tables


| Use the UT command option to upgrade a TEMPLATE control table to the current
| DB2 version.

| To upgrade the TEMPLATE control tables:

Chapter 11. Using LISTDEFs and TEMPLATEs 227


| 1. Select option 5 on the Administration Menu panel. The Utility generation using
| LISTDEFs and TEMPLATEs panel is displayed.
|
| ADB25 min ----- DSN9 Utility generation using LISTDEFs and TEMPLATEs ---- 00:33
| Option ===>
|
| L - Manage LISTDEFs DB2 System: DSN9
| T - Manage TEMPLATEs DB2 SQL ID: ISTJE
| TU - Specify TEMPLATE usage
|
| CL - Create LISTDEF control table
| UL - Upgrade LISTDEF control table
| CT - Create TEMPLATE control table
| UT - Upgrade TEMPLATE control table
|
| LISTDEF control table:
| Table owner . . . DSNACC >
| Table name . . . UTLIST >
|
| TEMPLATE control table:
| Table owner . . . DSNACC >
| Table name . . . UTTEMPLATE >
||
| Figure 148. Utility generation using LISTDEFs and TEMPLATEs panel (ADB25)
|
| 2. Select option UT on the option command line and press Enter. Validation of the
| table name is done to make sure it is a TEMPLATE control table. The validation
| is based on the following column names and data types: NAME VARCHAR(8),
| CREATEDBY VARCHAR(8), MODIFIEDBY VARCHAR(8), DSN
| VARCHAR(254), DISPSTATUS VARCHAR(3), DISPNTERM VARCHAR(7),
| DISPATERM VARCHAR(7), DEVICETYPE VARCHAR(8), MODELDCB
| VARCHAR(53), BUFNO SMALLINT, DATACLAS VARCHAR(8), MGMTCLAS
| VARCHAR(8), STORCLAS VARCHAR(8), DSVOLSER VARCHAR(1784),
| GDGLIMIT INTEGER, EXPDL VARCHAR(10), RETPD INTEGER, UNITTYPE
| CHAR(1), PQTY INTEGER, SQTY INTEGER, SPACEUNIT VARCHAR(3),
| PCTPRIME INTEGER, MAXPRIME INTEGER, NBRSECND INTEGER, UNCNT
| SMALLINT, STACK CHAR(1), JES3DD VARCHAR(8), TRTCH VARCHAR(6),
| REMARKS VARCHAR(254), and VOLCNT SMALLINT. If the TEMPLATE
| control table name is note at the current version, an upgrade is performed.

Utility Template panel


Use the Utility Template panel to add or edit a TEMPLATE utility control
statement.

The Utility Template panel is displayed, as shown in the following figure, when
you select option A or E on the TEMPLATEs panel. When adding a TEMPLATE,
the input fields contain blanks. When editing a TEMPLATE, the previously stored
values are displayed, which you can overwrite.

228 User's Guide and Reference


DB2 Admin -------------------- DB2X Utility Template -------------------- 11:20
Command ===>

Enter name and optional remark:

TEMPLATE ===> (Template Name)


Remark ===>
>
Common Options:
UNIT ===> (Device Number, Type or Group Name)
DSN ===>

Change other common options ===> (Yes or No)


Change disk options ===> (Yes or No)
Change tape options ===> (Yes or No)

Statement ===> TEMPLATE

Figure 149. Utility Template panel (ADB25TE)

To create a new template, provide a TEMPLATE and a DSN and press Enter.

The following input fields are shown on this panel:


TEMPLATE
Enter a name for the template. The template name must be unique within
the control table that you are using.
REMARK
Enter an optional description of the template.
UNIT Use this field to specify the device number, device type, or group name for
the data set.
DSN Use this field to provide a data set name pattern for the template. The data
set name can be composed of variables whose value is determined and
substituted during execution of the utility that is using the template or
execution of the job that DB2 Admin generated for alter, restore, redefine,
migrate, or object comparison processing that is using the template.
To construct a data set name pattern by using substitution variables,
specify a question mark (?) as the first character of the DSN field. When
you press Enter, the Utility Template — Dataset Name panel is displayed.
The variables displayed on the Utility Template — Dataset Name panel are
the variables that are supported for normal DB2 utility template
processing. Therefore, any variable displayed is valid for the data set name
pattern for a utility data set template. However, not all of the variables are
valid for the templates for non-utility work data sets, and additional
variables might apply.
Change other common options
Use this field to specify additional attributes for the data set. When you
specify Yes and press Enter, the Template Common Options panel
(ADB25TC) is displayed, as shown in the following figure. See the online
help for the description of the fields on this panel.

Chapter 11. Using LISTDEFs and TEMPLATEs 229


DB2 Admin ----------------- DB2X Template Common Options --------------- 11:21
Command ===>

MODELDCB ===>
BUFNO ===> (Number of BSAM buffers)
DATACLAS ===> (SMS Data class)
MGMTCLAS ===> (SMS Management class)
STORCLAS ===> (SMS Storage class)
RETPD ===> or EXPDL ===>
VOLUMES( ===> > )
VOLCNT ===> (Volume Count)
GDGLIMIT ===> (GDG Limit)
DISP( ===> , , )

Figure 150. Template Common Options panel (ADB25TC)

Change disk options


Use this field to specify additional options for the data set—those options
that are applicable only to data sets that are on disk. When you specify Yes
and press Enter, the Template Disk Options panel (ADB25TS) is displayed,
as shown in the following figure. See the online help for the description of
the fields on the panel.

DB2 Admin ------------------ DB2X Template Disk Options ----------------- 11:22


Command ===>

SPACE( ===> , ) (Primary, Secondary)


===> (CYL TRK or MB)
PCTPRIME ===> (Percentage of space obtained as primary)
MAXPRIME ===> (Maximum allowable primary space
allocation)
NBRSECND ===> (Number of secondary allocation divisions)

Figure 151. Template Disk Options panel (ADB25TS)

Change tape options


Use this field to specify additional options for the data set—those options
that are applicable only for data sets on tape. When you specify Yes and
press Enter, the Template Tape Options panel (ADB25TT) is displayed, as
shown in the following figure. See the online help for the description of
the fields on the panel.

DB2 Admin ------------------ DB8A Template Tape Options ----------------- 11:23


Command ===>

UNCNT ===> (Number of devices to allocate)


STACK ===> (Yes/No, Stack on same tape volumes)
JES3DD ===> (JES3 DDname for tape allocation)
TRTCH ===> (Track recording technique - NONE COMP or NOCOMP)

Figure 152. Template Tape Options panel (ADB25TS)

230 User's Guide and Reference


Related tasks
“Utility Template — Dataset Name panel”
“Restoring a changed table” on page 270
Related reference
“Work data sets used by the DB2 Admin Alter ALC function” on page 273
“Work data sets used by the DB2 Admin Alter Redefine function” on page 249
“Work data sets used by the DB2 Admin Migrate function” on page 300
Related information
IBM Publications Center

Utility Template — Dataset Name panel


Use the Utility Template — Dataset Name panel to construct a template data set
name by selecting the substitution variables to use.

To construct a template data set name by selecting the substitution values to use:
1. From the Utility Template panel, enter a ? in the DSN field. The Utility
Template – Data Set Name panel is displayed, as shown in the following figure.

DB2 Admin ------------- DB2X Utility Template - Dataset Name ----------- 11:30
Command===>

Select symbolic variables or enter non-symbolic characters. Processing for


this panel occurs in left to right, and top to bottom sequence. Hit ENTER to
process any current choices.

DSN Model:

Non-Symbolic characters ===>

Symbolic Variables:

JOBNAME ===> MVS jobname STEPNAME ===> MVS step name


UTILID ===> Utility ID SSID ===> Subsystem ID

ICTYPE ===> Image Copy Type UTILNAME ===> Utility Name


SEQ ===> Sequence Number LOCREM ===> IC DDN usage
PRIBAC ===> IC DDN Usage

LIST ===> List Name DB ===> Database name


TS ===> Table space IS ===> Index Space
SN ===> Space name PART ===> Part number (5-digit)

DATE ===> YYYYDDD TIME ===> HHMMSS


JDATE ===> YYYYDDD YYYY ===> Year
MM ===> Month DD ===> Day
JDAY ===> DDD HOUR ===> HH portion of time
MINUTE ===> MM portion SECOND ===> SS portion of time

USERID ===> Batch userid

Figure 153. Utility Template — Data Set Name panel (ADB25TD)

2. Specify substitution variables.


v To specify non-symbolic characters, type them in the Non-Symbolic
characters field. Press Enter to transfer and append the characters you
entered to the DSN Model field near the top of the panel, which contains the
template data set name pattern.
v To select a symbolic variable, type any character (such as a slash) to the right
of the ===> arrow. Press Enter to transfer your choices to the DSN model,
which causes the variable name, followed by either one or two periods, to be

Chapter 11. Using LISTDEFs and TEMPLATEs 231


appended to the DSN model statement. The first period marks the end of the
variable name, not the end of the qualifier. If the preceding item is a variable,
two periods are required in succession to begin a new name segment
(qualifier). The first period marks the end of the variable and the second
period marks the beginning of the next qualifier.
The variable names are appended to the data set name template in
left-to-right and top-to-bottom order each time Enter is pressed. To append
an earlier variable after a later variable, first select the later variable and
press Enter; then append the earlier variable.
3. Verify that the data set name in the DSN Model field contains the appropriate
number of periods. Also, for variables that will return numeric characters,
ensure that an alphabetic character (A to Z) or national character (# @ $)
precedes the variable if it begins a qualifier. Type directly in the field to make
any changes.

Restriction: Not all the symbolic variables that are listed are valid variables for
the data set name pattern for the templates for DB2 Admin work
data sets for alter, restore, redefine, migrate and object comparison
processing, and additional variables might apply. To specify any
additional variables that are not listed, use the Non-Symbolic
characters field or type them directly into the DSN Model field.

Example: &JOBNAME..&STEPNAME. displays two variables in succession. If the


preceding item is a non-symbolic character and not a variable, only one period is
used.

Example: In the example, &JOBNAME.DSNCOPY, no period follows DSNCOPY because


it is the last qualifier and it is not a variable.

Example: In the example, &USERID..D&DAY..M&MONTH..&DB(3,4)., an alphabetic


character precedes the variables DAY and MONTH because they return numeric
characters. The use of substring notation on variables enables limiting the number
of characters that are returned. Here, only four characters of the database name,
starting at the third character, are returned.

Recommendation: Although it is permissible to enter variables in the DSN model


by simply typing in the variables, use the panel fields to avoid
spelling errors.

The example in the following figure uses the previous panel to show a partially
completed DSN model statement; the non-symbolic .TEST. is about to be
appended, followed by the jobname substitution variable.

232 User's Guide and Reference


| ADB25TD n ------------- DB2X Utility Template - Data Set Name ----------- 11:32
| Command===>
|
| Select symbolic variables or enter non-symbolic characters. Processing for
| this panel occurs in left to right, and top to bottom sequence. Hit ENTER to
| process any current choices.
|
| DSN Model: &DB..&TS..&UTILID..D&DATE..H&HOUR.&MINUTE.
|
| Non-Symbolic characters ===> .TEST.
|
| Symbolic Variables:
|
| JOBNAME ===> / MVS jobname STEPNAME ===> MVS step name
| UTILID ===> Utility ID SSID ===> Subsystem ID
|
| ICTYPE ===> Image Copy Type UTILNAME ===> Utility Name
| SEQ ===> Sequence Number LOCREM ===> IC DDN usage
| PRIBAC ===> IC DDN Usage
|
| LIST ===> List Name DB ===> Database name
| TS ===> Table space IS ===> Index Space
| SN ===> Space name PART ===> Part number (5-digit)
|
| DATE ===> YYYYDDD TIME ===> HHMMSS
| JDATE ===> YYYYDDD YEAR ===> YYYY
| MONTH ===> MM DAY ===> DD
| JDAY ===> DDD HOUR ===> HH portion of time
| MINUTE ===> MM portion SECOND ===> SS portion of time
|
| USERID ===> Batch userid
||
| Figure 154. Utility Template — Data Set Name example (ADB25TD)
|
Related concepts
“Utility Template panel” on page 228
Related reference
“Work data sets used by the DB2 Admin Alter ALC function” on page 273
“Work data sets used by the DB2 Admin Alter Redefine function” on page 249
“Work data sets used by the DB2 Admin Migrate function” on page 300
Related information
IBM Publications Center

| Substitution variables in utility templates for PUNCHDDN


| when using a WSL
| Typically, the template data set names for a utility are constructed by DB2 when
| the utility is processed, based on the template's data set name mask or pattern and
| substitution variables. However, when you use the DB2 Admin functions for alter
| (ALC), migrate. redefine (RDEF), rename database, and object comparison and you
| save the statements to a work statement list (WSL), the data set name that is
| associated with PUNCHDDN for a utility is resolved fully at JCL build time.

| The data set name must be fully resolved and have valid qualifiers when the JCL
| is built because the data set for PUNCHDDN also becomes the input to the LOAD
| utility as the //SYSIN DD card. However, when the JCL is built for the data set
| name for PUNCHDDN, the value of some variables is unknown, and placeholder
| values are used instead. For example, if &JO or &JOBNAME is used as a
| substitution variable, JOBNAME is used as the value in the data set name.

Chapter 11. Using LISTDEFs and TEMPLATEs 233


| The following table shows the replacement values for the symbolic variables that
| cannot be resolved at JCL build time for PUNCHDDN for ALC, migrate, RDEF,
| rename database, and object comparison:
| Table 8. Replacement values for symbolic variables for templates for
| PUNCHDDN. Replacement values for symbolic variables for templates for PUNCHDDN
| Symbolic variable Replacement value
| JOBNAME or JO JOBNAME
| UTILID UTILID
| STEPNAME STEPNAME
| SSID The SSID
| ICTYPE ICTYPE
| SEQ SEQ
| PRIBAC PRIBAC
| UTILNAME UTILNAME
| LOCREM LOCREM
| LIST LIST
| TS The table space
| SN SN
| DB The database name
| IS IS
| PART ALL
| DATE Build date in form YYJJJ, for example, 09190
| JDATE Julian date, for example, 190
| MONTH The month, for example, 07
| JDAY The Julian day, for example, 190
| MINUTE The minute, for example, 54
| TIME The time HHMMSS, for example, 135433
| YEAR The year, for example, 2009
| DAY The day, for example, 09
| HOUR The hour, for example, 13
| SECOND The second, for example, 33
| USERID The userid
|
|
TEMPLATE usage
You can associate a template with a particular data set—either a DB2 utility data
set or a DB2 Admin work data set.

Many DB2 utilities use templates for certain ddnames used by the utility. The DB2
utilities that support the use of templates do so via a ddname keyword clause. For
example, REORG TABLESPACE has a WORKDDN() keyword. The WORKDDN
entries in the Template Usage panel correspond to any utility with the WORKDDN
clause that supports templates. Certain keywords allow two parameters, such as

234 User's Guide and Reference


WORKDDN for REORG TABLESPACE. The 'keyword 1' entry corresponds to the
first subparameter for the keyword, while 'keyword 2' corresponds to the second
subparameter.

The DB2 Admin work data sets that support the use of templates do so via a
template keyword. For example, the work data set that the DB2 Admin Alter ALC
function uses for the DDL that is extracted from the catalog is ALDDL.

To associate a template with the ddname keyword of a utility data set or template
keyword of a non-utility work data set:
1. Issue the TU (Template Usage) option on the LISTDEFs panel. The Utility
Template Use panel that is similar to the panel that is shown in the following
figure is displayed. The panel contains a list of keywords and columns showing
whether a template is actively associated with that keyword, the name of the
template, and the template's comment.

| Note: Panel ADB25TU4 is used for the CLONE template type.

| ADB25TU3 ------------------ DB2X Utility Template Use ------------------ 11:45


| Command ===>
|
| Line commands:
| T - Toggle Use On/Off C - Clear data ? - Choose Template for the Keyword
| E - Edit Template
| Template type . . . . . . . . . UTIL (UTIL,ALT,MIG,RDEF,RES,OC,MISC
| CLONE)
| Generate template statements . . YES (Yes/No)
| Sel Keyword Use Template Comment
| --- ------------ --- -------- ------------------------------------------------
| COPYDDN 1 / SCOPY
| COPYDDN 2 / COPYLOC
| DISCARDDN / COPYREM
| ERRDDN / COPYREM
| FILTERDDN / COPYREM2
| INDDN / COPYREM2
| MAPDDN / COPYREM
| PUNCHDDN / SPUNCH
| RECOVERYDDN1 / COPYLOC
| RECOVERYDDN2 / SRCPY1
| UNLDDN / UNLDDN
| WORKDDN 1 / WORKDDN
| WORKDDN 2 / SORTOUT
| LOBCOLDDN / CLOBDD
| XMLCOLDDN / CXMLDD
| Note: The LOBCOLDDN and XMLCOLDDN data set names cannot
| exceed 35 bytes. They must be in PDS format. Do
| not specify a member name.
||
| Figure 155. Utility Template Use panel (ADB25TU3)
|
2. To change the list of template keywords and keyword associations that are
displayed, overwrite the value in the Template Type field and press Enter. The
following values are permissible:
UTIL Utility data set keywords used by DB2 utilities
ALT Alter data set keywords used by DB2 Admin Alter (ALC) function
MIG Migrate data set keywords used by the DB2 Admin Migrate function
RDEF Redefine data set keywords used by the DB2 Admin Alter Redefine
function
RES Restore data set keywords used by the DB2 Admin Alter (ALC)
function

Chapter 11. Using LISTDEFs and TEMPLATEs 235


OC Object compare data set keywords used by Object Comparison Tool
| MISC SYSPRINT data set keywords used by DB2 Admin for generating work
| statement lists (WSLs) online
| CLONE
| Utility templates used for cloned table spaces.

For example, if you specify RDEF, the Specify RDEF TEMPLATE Usage panel is
displayed, as shown in the figure below.

DB2 Admin ------------- DB2X Specify RDEF TEMPLATE Usage ------------ 11:44
Command ===>

Line commands:
T - Toggle Use On/Off C - Clear data ? - Choose Template for the Keyword
E - Edit Template
| Template type ===> RDEF (UTIL,ALT,MIG,RDEF,RES,OC,MISC)
Generate template statements ===> NO (Yes/No)
Sel Keyword Use Template Comment
--- ------------ --- -------- -------------------------------------------------
RDSQL / JPKRDQL
RDLOAD
RDDROP
RDUNLD
RDUTRELD
RDBIND
RDUTCHK
RDUTRUNS
RDUTCOPY
RDUTUNLD
RDWDD

Figure 156. Specify RDEF TEMPLATE Usage panel (ADB25TU3)

3. Enter ? in the SEL field and press Enter to associate a template with a
keyword. The Templates panel that shows a list of defined templates is
displayed.
4. Select a template by entering a plus sign (+) next to its name and pressing
Enter. Figure 155 on page 235 is displayed again with a slash (/) in the Use
field and with the template name and its associated comment in the other two
columns. A slash in the USE column for a keyword indicates a TEMPLATE
statement will be built for any utility supporting templates for that keyword.
Related concepts
“Adding, editing, or deleting a TEMPLATE” on page 226
“Using table space utilities” on page 356
“Using table utilities” on page 362
“Using index utilities” on page 365

| Using the utility template to unload data from LOBs


| If you want to unload data from a LOB column, you should use a utility template.

| When a table that contains multiple LOB columns needs to be unloaded, each LOB
| column requires a partitioned data set (PDS). You can use any utility-supported
| variables to define this template. The variables must be unique to ensure that data
| is not overwritten during unloads. If you do not specify a template, the functions
| (such as ALC, RDEF, and MIG) will use the default template that DB2 Admin
| assigns.

236 User's Guide and Reference


| The utility template for LOBs is used as follows:
| 1. The function (such as ALC, RDEF, MIG) generates the unload.
| 2. The utility template statements are added to the WSL.
| 3. The WSL runs, and ADBTEP2 converts the UNLOAD syntax before passing it
| to DB2.

| To set up and use the utility template for LOBs, follow the steps in “TEMPLATE
| usage” on page 234. After you have associated the template name with the
| LOBCOLDDN keyword, the following panel is displayed.
|
| DB2 Admin ------------------ DB2X Utility Template Use ------------------ 11:45
| Command ===>
|
| Line commands:
| T - Toggle Use On/Off C - Clear data ? - Choose Template for the Keyword
| E - Edit Template
| Template type ===> UTIL (UTIL,ALT,MIG,RDEF,RES,OC,MISC)
| Generate template statements ===> YES (Yes/No)
| Sel Keyword Use Template Comment
| --- ------------ --- -------- ------------------------------------------------
| COPYDDN 1 / SCOPY
| COPYDDN 2 / COPYLOC
| DISCARDDN / COPYREM
| ERRDDN / COPYREM
| FILTERDDN / COPYREM2
| INDDN / COPYREM2
| MAPDDN / COPYREM
| PUNCHDDN / SPUNCH
| RECOVERYDDN1 / COPYLOC
| RECOVERYDDN2 / SRCPY1
| UNLDDN / UNLDDN
| WORKDDN 1 / WORKDDN
| WORKDDN 2 / SORTOUT
| LOBCOLDDN / LOBTMPL1
|
|
| Figure 157. Utility Template Use panel (ADB25TU)

| Notes:
| v The ADBL prefix is reserved for LOB template names that will be
| generated by the Run WSL function.
| v The LOBCOLDDN data set name cannot exceed 35 bytes and must be a
| PDS.
| v Do not specify a member name (for example,
| ADB.TEST.LOBCOL.OUT(MEMB2)).
| Related concepts
| “Running WSL with the utility template for LOBs” on page 329
| “Using ADBTEP2 with LOBs” on page 348
| “Using utility options for XML and LOBs” on page 362

| Using the utility template to unload data from an XML column


| If you want to unload data from an XML column, you should use a utility
| template.

| When a table that contains multiple XML columns needs to be unloaded, each
| XML column requires a partitioned data set (PDS). You can use any
| utility-supported variables to define this template. The resulting data set name that
| is built using the variables must be unique to ensure that data is not overwritten. If

Chapter 11. Using LISTDEFs and TEMPLATEs 237


| you do not specify a template, the functions (such as ALC, RDEF, and MIG) will
| use the default template that DB2 Administration Tool assigns.

| The utility template for XML is used as follows:


| 1. The function (such as ALC, RDEF, MIG) generates the unload.
| 2. The utility template statements are added to the WSL.
| 3. The WSL runs, and ADBTEP2 converts the UNLOAD syntax before passing it
| to DB2.

| To set up and use the utility template for XML data, follow the steps in
| “TEMPLATE usage” on page 234. After you have associated the template name
| with the XMLCOLDDN keyword, the following panel is displayed.
|
| DB2 Admin ------------------ DB2X Utility Template Use ------------------ 11:45
| Command ===>
|
| Line commands:
| T - Toggle Use On/Off C - Clear data ? - Choose Template for the Keyword
| E - Edit Template
| Template type ===> UTIL (UTIL,ALT,MIG,RDEF,RES,OC,MISC)
| Generate template statements ===> YES (Yes/No)
| Sel Keyword Use Template Comment
| --- ------------ --- -------- ------------------------------------------------
| COPYDDN 1 / SCOPY
| COPYDDN 2 / COPYLOC
| DISCARDDN / COPYREM
| ERRDDN / COPYREM
| FILTERDDN / COPYREM2
| INDDN / COPYREM2
| MAPDDN / COPYREM
| PUNCHDDN / SPUNCH
| RECOVERYDDN1 / COPYLOC
| RECOVERYDDN2 / SRCPY1
| UNLDDN / UNLDDN
| WORKDDN 1 / WORKDDN
| WORKDDN 2 / SORTOUT
| XMLCOLDDN / XMLTMPL1
|
|
| Figure 158. Utility Template Use panel (ADB25TU)

| Notes:
| v The ADBX prefix is reserved for XML template names that will be
| generated by the Run WSL function.
| v The XMLCOLDDN data set name cannot exceed 35 bytes and must be a
| PDS.
| v Do not specify a member name (for example,
| ADB.TEST.XMLCOL.OUT(MEMB2)).
| Related concepts
| “Running WSL with the utility template for unloading XML data” on page 330
| “Using utility options for XML and LOBs” on page 362

238 User's Guide and Reference


Chapter 12. Changing DB2 objects
With DB2 Admin, you can change a database, table space, table, index, or view.

Topics:
v “Changing databases” on page 240
v “Changing table spaces” on page 245
v “Changing tables” on page 252
v “Changing indexes” on page 280
v “Changing views” on page 287
v “Using authorization switching” on page 287“Implicit LOB and XML
table support” on page 289

© Copyright IBM Corp. 1995, 2010 239


Overview of changing objects in DB2 Admin
With DB2 Admin, you can change a database, table space, table, index, or view.

For certain changes that are supported by the DB2 ALTER statement, DB2 Admin
uses a DB2 ALTER statement to makes the changes.

Other types of changes are more-complex and are not supported by the DB2
ALTER statement. DB2 Admin allows certain complex changes and creates the
steps that are necessary to carry out those changes. DB2 Admin attempts to
preserve as many of the dependent definitions as possible, such as indexes, views,
check constraints, synonyms, aliases, and authorizations to these objects. To make
these more-complex changes, DB2 Admin generates a set of batch jobs. For
example, to make complex changes to a table, DB2 Admin generates a set of batch
jobs that extracts the existing table definition, unloads the table data, converts the
table definition to the new definition, and reloads the data.

After DB2 Admin generates the batch jobs, you can review them and then submit
them to perform the changes.

You can use the Batch Restart program, ADBTEP2, to restart or resume the
execution of an Alter job at an intermediate point, in the event that one of the SQL
statements in the input stream fails. In addition, you can combine the generated
Alter batch jobs into a single job.
Related information
Chapter 15, “Using the Batch Restart programs: ADBTEP2 and ADBTEPA,” on
page 339

Changing databases
You can change some of the attributes of a database, including the name of the
database.

You can either ALTER or RENAME the database.


v Use ALTER to make certain changes that are supported by the ALTER
DATABASE statement.DB2 Admin issues an ALTER DATABASE statement to
make the changes.
v Use RENAME to rename the database. RENAME invokes the DB2 Admin
Rename Database function, which generates a batch job that creates a work
statement list. The work statement list performs these basic tasks to rename the
database:
1. Starts the database to be renamed in utility mode
2. Unloads the table spaces in the database
3. Drops RESTRICT ON DROP
4. Drops the database to be renamed
5. Creates the new database and underlying objects.
6. Starts the new database in utility mode
7. Loads the table spaces in the new database
8. Runs the CHECK DATA utility
9. Starts the new database

240 User's Guide and Reference


Altering a database
Use ALTER to make certain changes that are supported by the ALTER DATABASE
statement.

To alter a database:
1. Use the AL line command on the Databases panel. The Alter Database panel is
displayed, as shown in the following figure.

DB2 Admin DB2X Alter Database 16:05


Command ===>

Type of Operation ===> (Alter/Rename)

Figure 159. Alter Database panel (ADB21DAO)

2. Specify Alter in the Type of Operation field. The Alter Database panel is
displayed, as shown in the following figure.

DB2 Admin --------------------- DB2X Alter Database --------------------- 16:06


Command ===>

ALTER DATABASE
Database ===> EMPDB

BUFFER POOL
Buffer pool ===> BP0 (BP0-BP49, BP8K0-9, BP16K0-9, BP32K-BP32K9 or blank)

INDEXBP
Index Bpool ===> BP0 (BP0, BP1,... or BP49or blank)

STOGROUP
Storage group ===> SYSDEFLT > (storage group name)

Figure 160. Alter Database panel (ADB21DA)

3. Alter the buffer pool, index buffer pool, or storage group values.
4. Press Enter to run the ALTER DATABASE statement.
Related tasks
“Renaming a database”

Renaming a database
Use RENAME to rename the database.

To rename a database:
1. Use the AL line command on the Databases panel to display the Alter Database
panel.
2. Specify Rename in the Type of Operation field. The Rename Database panel is
displayed, as shown in the following figure.

Chapter 12. Changing DB2 objects 241


| DB2 Admin ---------------- DB2X DB2 Admin Rename Database --------------- 16:11
| Option ===>
|
| Please specify the following for DB2 Admin ALTER: DB2 System: DB2X
| DB2 SQL ID: R148286
|
| New database name . . . . : TSTEMPDB Database : EMPDB
|
| Data set information:
| Worklist name . . . . . . : USERNAME (also used as middle qualifier in DSNs)
| PDS for jobs . . . . . . : RENAME01.JCL
| Prefix for datasets . . . : R148286
|
| Output job options:
| Member Name for batch job : ADBDB (default ADBREN)
| Run SQLID . . . . . . . . : (Blank, an SQLID, or <NONE>)
|
| Optional steps after ALTER:
| Run IMAGE COPY . . . . . : N (Yes/No)
| Run RUNSTATS . . . . . . : N (Yes/No)
| Run REBIND . . . . . . . : N (Yes/No)
|
| Utility control options:
| Generate template statements : NO (Yes/No)
|
| BP - Change batch job parameters
| TU - Specify Template Usage
||
| Figure 161. Rename Database panel (ADB21DAJ)
|
3. Enter a new name for the database, specify values for the other options on the
panel, and press Enter. The job to create the work statement list is generated,
and an ISPF Edit session is displayed.
4. Edit and submit the job to create the work statement list.
5. Run the work statement list in batch to generate the apply jobs that will
rename the database.
When either a single unload and reload operation is required or no load and
reload operations are required, DB2 Admin creates a single apply job for the
work statement list.
When multiple unload and reload operations are required, you can specify
whether you want a single apply job generated for all operations or whether
you want multiple apply jobs generated.
When you run the work statement list, the Specify Job Parameters panel is
displayed, as shown in the following figure.

| ADB2W1R n ---------------- Specify Job Parameters --------------- 09:08


|
| Enter/verify the following:
| Generate one job ===> NO (Yes,No or Per Process)
| Job library PDS ===> 'SMITHAJ.JOB'
| Member prefix ===> ABC (Prefix, max 6 chars)
| Jobname = member? ===> YES (Yes/No)
||
| Figure 162. Specify Job Parameters panel (ADB2W1R)
|
| 6. Specify Yes , No , or Per Process to indicate whether to have a single batch job
| generated from the work statement list that combines all of the processes or to
| have multiple batch jobs for the processes generated from the work statement
| list.
| v If you specify Yes, the remaining fields on the panel are not applicable.

242 User's Guide and Reference


| v If you specify No so that multiple jobs will be generated, enter a library
| name, a member prefix name, and whether the jobname is to be the same as
| the member name.
| Multiple jobs will be generated with the member prefix that you specified
| and then saved in the Job library PDS that you specified. See the following
| table for a description of the jobs that are generated, and the order in which
| they must be submitted.
| v If you specify Per Process, one job is generated per process. All unloads will
| be in the same job/member instead of generated in separate member as
| when No is chosen.
| Table 9. Sequence of applying multiple jobs from a work statement list for renaming a
| database
| Job name Description
| prefix1 Job that starts the database in utility mode.
|| prefixU001 Jobs that unload the table spaces in the database. One job is
|| prefixU002 created for each table space that is unloaded.
|| .
.
| .
| prefixUnnn
| prefix2 Job that drops the database that is being renamed, creates a
| database with the new name and all the underlying objects,
| and starts the new database in utility mode.
|| prefixL001 Jobs that load the table spaces in the new database. One job
|| prefixL002 is created for each table space that is loaded.
|| .
.
| .
| prefixLnnn
| prefix3 Job that runs any optional utilities that were specified and
| starts the new database.
| Remember: prefix is the member prefix that you specified on the Specify Job Parameters
| panel (ADB2W1R) when you ran the work statement list in batch.
|
| 7. Submit the apply job or jobs that were generated from the work statement list
to rename the database. If multiple jobs were generated, you must submit them
in the sequence that is shown in the previous table.
Related tasks
“Altering a database” on page 241
Related reference
“Work data sets used by the DB2 Admin Rename Database function”
Related information
Chapter 14, “Using work statement lists,” on page 305

Work data sets used by the DB2 Admin Rename Database


function
When you rename a database, the DB2 Admin Rename Database function creates
and uses one or more data sets.

The data sets that are created and used by the DB2 Admin Rename Database
function are shown in the following table.

Chapter 12. Changing DB2 objects 243


Table 10. Work data sets for DB2 Admin Rename Database
Template
Default data set name Description keyword
prefix.worklist.DDL DDL extracted from the catalog for ALDDL
the database to be renamed
prefix.worklist.DDL.MOD DDL for the renamed database ALMOD
prefix.worklist.WDD Work data set to store the ALWDD
DDNAMEs for the WSL
prefix.worklist.WLS Prefix to create general usage data ALWLS
sets to add an element to WSL

prefix.worklist.CNTL.database. SYSPUNCH data set that is PUNCHDDN


tablespace.PT produced by the unload step

prefix.worklist.UNLD.database. SYSREC data set that is produced UNLDDN


tablespace.PT by the unload step

Related tasks
“Renaming a database” on page 241
“Creating naming conventions for work data sets that are created by the DB2
Admin Rename Database function”

Creating naming conventions for work data sets that are created
by the DB2 Admin Rename Database function
You can use templates to create your own naming conventions for the work data
sets that are created by the DB2 Admin Rename Database function.

To use templates to create naming conventions for work data sets that are created
by the DB2 Admin Rename Database function:
1. Specify Yes in the Generate template statements field on the Rename Database
Parameters panel (ADB21DAJ).
2. Ensure that you have constructed template data set names and have associated
the templates with the appropriate work data sets. You can use the TU primary
command on the Rename Database Parameters panel (or option 5 on the
Administration Menu panel) to manage the templates for the work data sets.
You can specify the following variables when you construct the data set name
pattern for a template for a redefine work data set:
v The following functional variable:

&DDNAME.
An internal DDNAME for the data set, not the DDNAME in the JCL
v The following variables that are supported for normal DB2 utility template
processing:

&DB. Database name


&TS. Table space name
&USERID.
Batch user ID
&DATE.
YYYYDD
&TIME.
HHMMSS
&JDATE.
YYYYDDD

244 User's Guide and Reference


&YEAR.
YYYY
&MONTH.
MM
&DAY.
DD
&JDAY.
DDD
&HOUR.
HH
&MINUTE.
MM
&SECOND.
SS
This list of variables is a subset of the variables that are supported for
normal DB2 utility template processing. The other variables that are
supported for normal DB2 utility processing are not valid.
Related reading: For more information about the variables that can be used for
normal DB2 utility processing, see DB2 UDB for z/OS Utility Guide and Reference.
Related reference
“Work data sets used by the DB2 Admin Rename Database function” on page 243

Changing table spaces


When you change a table space, DB2 Admin issues an ALTER TABLESPACE
statement for certain changes that are supported by the ALTER TABLESPACE
statement.

To make changes that are more complex and are not supported by the ALTER
TABLESPACE statement, DB2 Admin generates a set of batch jobs to implement
the changes.

To change a table space, you issue either the AL command or the AL command
followed by the RDEF primary command.
v Use the AL line command to make changes that are supported by the ALTER
TABLESPACE statement.
v Use the AL line command followed by the RDEF command to make
more-complex changes that are not supported by the ALTER TABLESPACE
statement. RDEF invokes the DB2 Admin Alter Redefine function, which
generates the batch jobs that are required to redefine the table space (unload the
existing table space, drop the table space, create the new definition of the table
space, and reload the data).
You can use authorization switching when you redefine table spaces if
authorization switching is enabled on the subsystem.
When you specify your table space redefinition parameters, you can choose to
save your request to a work statement list.
When you redefine table spaces , the DB2 Admin Redefine function creates and
uses one or more work data sets.

Altering a table space


Use the AL line command to alter a table space.

To alter a table space:

Chapter 12. Changing DB2 objects 245


1. Use the AL line command on either the Table Spaces panel or on the Table
Space Parts panel. The Alter Table Space panel is displayed, as shown in the
following figure.

| ADB21SA n --------------------DB2X Alter Table Space -------- Row 1 to 2 of 2


| Command ===> ________________________________________________ Scroll ===> PAGE
|
|
| Line commands:
| D - Display Database I - Interpret
|
| ALTER TABLESPACE : DSN05383.A (Partitioned by growth )
|
| Buffer Pool . . . . BP0 Close Rule . . . YES Max Rows . . 255
| Lock Size . . . . . ROW Lock Part . . . NO Lock Max . . SYSTEM
| Max Partitions . . . 256 LOG . . . . . . YES
|
| Primary Secondary Free Pct Com E T S
| S Part Quantity Quantity Page Free prs R M T VCAT Stogroup GBPCache
| - ------ ----------- ----------- ---- ---- --- - - - -------- -------> -------
| All Part ___________ ___________ ___ __ ___ _ _ _ ________ ________ ________
| _ 1 -1 -1 0 5 NO _ Y I DSN9 SYSDEFLT CHANGED
| ******************************* END OF DB2 DATA *******************************
||
| Figure 163. Alter Table Space panel (ADB21SA)
|
2. Alter the table space attributes or one or more partitions within a table space.
The SQL ALTER TABLESPACE statement is executed when you change a
parameter and press Enter. Changes to other parameters, such as the Primary
Quantity, do not take effect until the object is reorganized.

For partitioned table spaces, a detail line is displayed for each partition. You can
alter any partition by updating the attributes, such as Pct Free. To apply the same
change to all partitions within the table space, provide a value on the All Part
field.

To change certain parameters, you must stop and restart the associated object. In
these cases, DB2 Admin runs a STOP table space or STOP index (or partition)
command and checks that the object is in a fully-stopped state. If stopped, it runs
an ALTER TABLESPACE statement, followed by a START command. If the object is
not in a fully-stopped state, the STOP Check – Action panel, as shown in the
following figure, prompts you to perform one of the following actions:
v Re-check and continue if in STOP state.
v Issue the ALTER statement.
v Cancel the operation.
If an object is not stopped when the ALTER TABLESPACE statement runs (for
example, if others are holding locks on the object), a -626 SQLCODE is displayed.

246 User's Guide and Reference


DB2 ADMIN ------------------- DB2X STOP Check - Action ----- Row 1 to 11 of 15
Option ===> Scroll ===> PAGE

Object is not in a fully-stopped state (STATUS field has STOP), and must be in
order for the pending actions to be successful. The current USE information is
displayed below.
What do you want to do now:
1 - Re-check and continue if in STOP state. Re-display USE if not
2 - Perform any pending actions, regardless of the object's state
3 - Exit and do not perform any pending actions

*******************************************************************************
DSNT360I @ ***********************************
DSNT361I @ * DISPLAY DATABASE SUMMARY
* GLOBAL USE
DSNT360I @ ***********************************
DSNT362I @ DATABASE = DSN8D81A STATUS = RW
DBD LENGTH = 16142
DSNT397I @
NAME TYPE PART STATUS CONNID CORRID USERID
-------- ---- ---- ------------------ -------- ------------ --------
DSN8S81D TS STOPP TSO SYSADM SYSADM
- MEMBER NAME V81A
******* DISPLAY OF DATABASE DSN8D81A ENDED **********************
DSN9022I @ DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION
******************************* Bottom of data ********************************

Figure 164. STOP Check — Action (ADBWSTOP)

You can use the RDEF command to further redefine the table space definition.
Related tasks
“Redefining a table space”

Redefining a table space


Use the RDEF command to redefine a table space.

To redefine a table space:


1. Use the AL line command on either the Table Spaces panel or on the Table
Space Parts panel. The Alter Table Space panel is displayed.
2. Use the RDEF command. The Redefine Table Space panel is displayed, as
shown in the following figure.

Chapter 12. Changing DB2 objects 247


| ADB21SAR ------------------ DB2X Redefine Table Space ------- Row 1 to 1 of 1
| Command ===> Scroll ===> CSR
|
| Commands: CONTINUE ORIGINAL BALANCE VALUES MAKEPBG MAKEPBR
| Line commands: S - Split part R - Remove part O - Original data
| C - Clear data
|
| CREATE TABLESPACE: TSFGR IN DBFGR
|
| Numparts . . . . . 0 Large . . . . NO LOB . . . . . NO
| Define . . . . . . YES DSSIZE . . . . LOG . . . . .
| Member Cluster . . NO SEGSIZE . . . 4 CCSID . . . . EBCDIC
| Buffer Pool . . . BP0 Close Rule . . YES Max Rows . . 255
| Lock Size . . . . ANY Lock Part . . Lock Max . . SYSTEM
| Max Partitions . . 256
| Free Pct E T S
| S Part Pqty Sqty Page Free Compr R M T VCAT Stogroup GBPCache
| - ------ ---------- ---------- ---- ---- ----- - - - -------- -------> --------
|
| 0 -1 -1 0 4 NO N Y I DSN9 SYSDEFLT CHANGED
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 165. Redefine Table Space panel (ADB21SAR)
|
3. Enter changes for redefining a table space beyond those definitions performed
by the Alter Table Space panel and the ALTER TABLESPACE statement.
4. Issue the CONTINUE primary command to generate the batch jobs that will
make the changes to the table space. The Alter Tablespace Redefine - JCL panel
(ADB21SAJ) is displayed.
5. Enter values for the options on the panel and press Enter. The jobs to perform
the changes are generated and an ISPF Edit session is displayed.
6. Edit and submit the generated jobs.

By using this panel, you can change many table space attributes. You can also
convert to or from a partitioned table space and change the segment size. When
converting to or from a partitioned table space, a second panel is displayed to help
you either create a partitioning index or to convert a clustering index to a
partitioning index, or vice-versa.

Remember: The actual changes to the table space attributes, such as splitting a
partition or removing a partition for a partitioned table space, do not
take place until you submit the batch jobs. When you submit the
batch jobs, data is unloaded and reloaded according to the new table
space definitions.

Restriction: The following restrictions apply to using the RDEF command:


v You cannot change the definition of a table space that was implicitly
created.
v You cannot convert a table space that contains more than one table
into a partitioned table space.
v If you change the table space name, you must specify a unique
name for the table space. You cannot specify the name of a table
space that already exists in the specified database.
v If you change the database name, you must specify the name of a
database that exists.

The following primary commands are available:

248 User's Guide and Reference


BALANCE
Distributes the total primary and secondary quantities equally among all
partitions. This command is available only for partitioned table spaces.
CONTINUE
After you update the attributes on the panel, you can continue the process by
using this command. If you request partition changes, the Redefine Partitioning
Index panel is displayed. Otherwise, a panel for JCL parameters is displayed.
ORIGINAL
Restores all fields on the panel to their original values.
VALUES
Displays the partitioning limit key values for an existing partitioning index.
| MAKEPBG
| Initialize input fields Numparts=0 and Max Partitions>0 to allow convert to
| Partition-By-Growth (PBG) table space.
| MAKEPBR
| Initialize input fields Numparts>0, Max Partitions=0, and SEGSIZE>0 to allow
| convert to Partition-By-Range (PBR) table space.

The following line commands are available:


S Splits the partition to add a new partition as the next partition, and splits the
space parameters between the two. When the batch jobs are run, the data for
the split partition is unloaded and then reloaded into the two partitions
according to the partitioning scheme.
R Removes the partition.
O Restores the fields on the panel for the partition to their original values.
C Clears the fields on the panel for the partition. Any field that you clear or
leave blank inherits the values from partition 1.

You can also perform partition redistribution to create a partitioning index, to


convert a clustering index to or from a partitioning index, or to redefine the
existing partitioning index when partitions are added or removed. The Partition
Redistribution panel (ADB21SAV) helps you to complete this task.
Related tasks
“Altering a table space” on page 245
“Redefining a table with the ALC line command” on page 257

Work data sets used by the DB2 Admin Alter Redefine


function
When you redefine table spaces (or indexes), the DB2 Admin Redefine function
creates and uses one or more data sets.

The data sets that are created and used by the DB2 Admin Redefine function are
shown in the following table.
Table 11. Work data sets for DB2 Admin Redefine
Template
Default data set name Description keyword
prefix.worklist.CREBIND Rebind statements RDBIND
prefix.worklist.DDL DDL extracted from the catalog RDSQL

Chapter 12. Changing DB2 objects 249


Table 11. Work data sets for DB2 Admin Redefine (continued)
Template
Default data set name Description keyword
prefix.worklist.DDDL DDL to drop the original object RDDROP
prefix.worklist.DDL.MOD Modified DDL with the new table None1
space or index statements or both

prefix.worklist.CNTL.database. SYSPUNCH data set that is PUNCHDDN


tablespace.PT produced by the unload step

prefix.worklist.UNLD.database. SYSREC data set that is produced UNLDDN


tablespace.PT by the unload step

prefix.worklist.CNT.Tnnnn SYSPUNCH data set that is RDLOAD


produced by the unload step when
using High Performance Unload
(HPU), where Tnnnn is a string
assigned to the data set, with nnnn
beginning with 1
prefix.worklist.ULD.Tnnnn SYSREC data set that is produced RDUNLD
by the unload step when using
High Performance Unload (HPU),
where Tnnnn is a string assigned to
the data set, with nnnn beginning
with 1
prefix.worklist.UTRELD LOAD utility statements when RDUTRELD
building a WSL
prefix.worklist.UTCHK CHECK utility statements when RDUTCHK
building a WSL
prefix.worklist.UTRUNS RUNSTATS utility statements when RDUTRUNS
building a WSL
prefix.worklist.UTCOPY COPY utility statements when RDUTCOPY
building a WSL
prefix.worklist.UTUNLD REORG and REBUILD utility RDUTUNLD
statements when building a WSL
prefix.worklist.WDD File names to include when RDWDD
building a WSL
Note:
1. The data set name is derived from the data set pattern that is specified for RDSQL. The
data set name for RDSQL cannot be greater than 40 bytes.

Related concepts
“Utility Template panel” on page 228
“Changing indexes” on page 280
Related tasks
“Utility Template — Dataset Name panel” on page 231
“Creating naming conventions for work data sets that are created by the DB2
Admin Redefine function”
“Redefining an index” on page 282

Creating naming conventions for work data sets that are created
by the DB2 Admin Redefine function
You can use templates to create your own naming conventions for the work data
sets that are created by the DB2 Admin Redefine function.

250 User's Guide and Reference


To use templates to create naming conventions for the work data sets that are
created by the DB2 Admin Redefine function:
1. Specify Yes in the Generate template statements field on the Alter Tablespace
Redefine - JCL panel (ADB21SAJ).
2. Ensure that you have constructed template data set names and have associated
the templates with the appropriate work data sets. You can use the TU primary
command on the Alter Tablespace Redefine - JCL panel (or Option 5 on the
Administration Menu panel) to manage the templates for the work data sets.
You can specify the following variables when you construct the data set name
pattern for a template for a redefine work data set:
v The following functional variables:

&DDNAME.
An internal DDNAME for the data set, not the DDNAME in the JCL
&DB2SYS.
The DB2 subsystem ID
&TBCTR.
Table counter (applicable only when HPU is used for unloading)
&WORKLIST.
Worklist name specified on the Alter Tablespace Redefine panel
(ADB21SAJ)
v The following variables that are supported for normal DB2 utility template
processing:

&DB. Database name


&TS. Table space name
&IS. Index space name (valid only when the object is an index)
&PART.
If the variable is specified, the value 'ALL' is used
&USERID.
Batch user ID
&DATE.
YYYYDD
&TIME.
HHMMSS
&JDATE.
YYYYDDD
&YEAR.
YYYY
&MONTH.
MM
&DAY.
DD
&JDAY.
DDD
&HOUR.
HH
&MINUTE.
MM
&SECOND.
SS
This list of variables is a subset of the variables that are supported for
normal DB2 utility template processing. The other variables that are
supported for normal DB2 utility processing are not valid.

Chapter 12. Changing DB2 objects 251


Related reference
“Work data sets used by the DB2 Admin Alter Redefine function” on page 249
Related information
IBM Publications Center

Changing tables
With DB2 Admin, you can make changes to columns in a table and to views, keys,
and indexes that are related to tables.

DB2 Admin enables you to perform the following tasks:


v Change the database, table space, owner, and the name of a table
v Modify the definitions of table columns (with some restrictions)
v Change views, foreign keys, and indexes that are related to a table
v Change the sequence of the columns in a table
v Drop columns
v Insert new columns

In addition, DB2 Admin supports the following DB2 Version 8 functionality for
changing a table:
Adding partitioning key
When creating a partitioned table, table-controlled partitioning is initiated
by specifying the new PARTITIONING KEY clause, which identifies the
columns and values used to delimit partition boundaries. When the new
clause is used, the definition of the table is complete and data can be
inserted into the table. After establishing table-controlled partitioning,
index-controlled partitioning is no longer an option. Any attempt to create
an index on this table with the VALUES clause is disallowed.
Adding partitions
You can add partitions to a partitioned table, up to the maximum limit, as
determined by the parameters that are specified when the table was
initially created. The next available physical partition number is used.
Partitions can be added to the table using the ALTER TABLE ADD PART
statement.
Changing partition boundaries
You can modify the limit keys of the partitions in tables that use
table-controlled partitioning using the ALTER TABLE ALTER PART
VALUES statement.
Rotating partitions
Rotating partitions allows old data to roll away, while reusing the partition
for new data. The ALTER TABLE ALTER PART ROTATE FIRST TO LAST
statement is used. You can specify that all data rows in the oldest partition
be deleted by using the RESET keyword and then by specifying a new
high boundary so that the partition becomes the last logical partition in
sequence and is ready to hold new data that is added.
Clustered tables
The VOLATILE clause indicates to DB2 that a table should be treated as a
clustered table. Clustered tables are accessed with index access whenever
possible for SQL statements. Clustered tables experience a high incidence
of lock contention because the clustered rows logically belong together and

252 User's Guide and Reference


are accessed in the same sequence. DB2 uses index access whenever
possible to minimize contention between applications.
Security label columns
The AS SECURITY LABEL clause indicates that the table is defined with
multilevel security with row level granularity and that the column will
contain the security label values. A table can have only one security label
column.

To change a table, you issue either the AL line command or ALC line command
against a table on the Tables, Views, and Aliases panel:
v Use the AL line command to make certain changes that are supported by the
ALTER TABLE statement. DB2 Admin issues an ALTER TABLE statement to
make the changes.
v Use the ALC line command to make more-complex changes that are not
supported by the ALTER TABLE statement. ALC invokes the DB2 Admin Alter
ALC function, which generates the batch jobs that are required to redefine the
table. In some cases, DB2 Admin detects that an ALTER TABLE statement can be
used to make the changes, and you are given the choice of using DB2 Smart
Alter to run the ALTER TABLE statement immediately instead of generating and
using batch jobs to update the table.
You can use authorization switching while redefining tables if authorization
switching is enabled on the subsystem.
When you redefine tables, the DB2 Admin Redefine function creates and uses
one or more work data sets.

Restrictions:
v Changes to column names are retrofitted into views. All other
column actions are not retrofitted, and any changes to a column's
data type are not verified against the views.
The views that require editing are documented in both the
converted DDL and in the batch job output with messages
ADBC053W and ADBC053I.
v Columns that are involved in partitioning should not be modified
because DB2 Admin does not drop the underlying table space with
its definition of partitioning values. It is possible to change
partitioning values.
v A warning is displayed if you attempt to modify columns in the
primary key. With line command UP (update primary key), you
can circumvent the warning. You can use the ADDFK primary
command to propagate the primary key update to foreign-key
related tables.
v If you modify columns that are in a foreign key, DB2 Admin does
not automatically modify the primary key of parent tables. To
propagate the column updates to primary and foreign key tables,
use the ADD primary command from the Alter Table panel
(ADB27C) to initiate the Alter Tables dialog, where RI-related
tables or other tables can be included in the Alter JCL stream.
v DB2 Admin informs you when a specific data type conversion is
allowed. Data type conversions can be one of the following types:
– Numeric to numeric (small integer, integer, decimal float)
– Character to character (character and VARCHAR)
– Date time to date time (date, time, time stamp)

Chapter 12. Changing DB2 objects 253


v If you modify a table that has a security label column, you cannot
specify the value for HPU in the Unload Method field on the Alter
Parameters panel.
v On the Alter Parameters panel, you cannot specify the value for
DSNTIAUL or HPU in the Unload Method field if you are
creating a work statement list. For work statement lists, you can
choose the Unload value.
v DB2 Admin supports unloading table (spaces) that produce a
record length of less than 32K. When a table (space) with LOB
objects is unloaded, it is possible that the required record length
exceeds 32K. In this case, you must modify the unload job or WSL
to specify the utility statements and parameters that allow
unloading the table (space). For more information, see the DB2
UDB for z/OS Utility Guide and Reference.
| v HPU cannot be used when altering a table with LOB columns.
Related concepts
“Changing objects related to a table being changed” on page 276
Related tasks
“Altering a table with the AL line command”
“Redefining a table with the ALC line command” on page 257
“Changing multiple tables” on page 278
Related reference
Chapter 27, “DB2 Admin data type conversions,” on page 627
Related information
IBM Publications Center

Altering a table with the AL line command


Use the AL line command to alter a table.

To alter a table with the AL line command:


1. From the main menu, select option 1.T. The Tables, Views, and Aliases panel is
displayed, as shown in the following figure.

DB2 Admin ----------- DB2X Tables, Views, and Aliases -------- Row 1 to 7 of 7
Command ===> Scroll ===> CSR

Commands: GRANT MIG


Line commands:
C - Columns A - Auth L - List X - Indexes S - Table space D - Database
V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
? - Show all line commands

Sel Name Owner T DB Name TS Name Cols Rows Checks


* * * * * * * *
----- ------------------ -------- - -------- -------- ------ ----------- ------
ACT DSN8810 T DSN8D81A DSN8S81R 3 24 0
DEPT DSN8810 T DSN8D81A DSN8S81R 5 53 0
AL EMP DSN8810 T DSN8D81A DSN8S81R 14 138 1
EMPPROJACT DSN8810 T DSN8D81A DSN8S81P 6 24 0
PROJ DSN8810 T DSN8D81A DSN8S81R 8 66 0
PROJACT DSN8810 T DSN8D81A DSN8S81R 7 794 0
******************************* END OF DB2 DATA *******************************

Figure 166. Tables, Views, and Aliases panel (ADB21T) - Using the AL command

254 User's Guide and Reference


2. Issue the AL line command against a table. The Alter Table panel (ADB21TA) is
displayed, as shown in the following figure.

| ADB21TA n -----------------------DB2X Alter Table ---------------------- 13:18


| Command ===>
|
| Table schema . . : DSN8810 >
| Table name . . . : EMP >
|
| AUDIT . . . . . . . . . NONE (None, Changes, or All)
| DATA CAPTURE . . . . . NONE (None/Changes)
| VALIDPROC . . . . . . . NULL (NULL/Program name)
| RESTRICT ON DROP . . . NO (Yes/No)
| VOLATILE . . . . . . . NO (Yes/No)
| APPEND . . . . . . . . NO (Yes/No)
|
| ALTER TABLE with any of the above changes OR select one of the options below
|
|
| ADD column ADD MATERIALIZED QUERY
| ADD PRIMARY KEY DROP MATERIALIZED QUERY
| DROP PRIMARY KEY REFRESH MATERIALIZED TABLE
| ADD FOREIGN KEY ADD PARTITIONING KEY
| DROP FOREIGN KEY ADD/ALTER PART TABLE
| ADD CHECK constraint ADD CLONE
| DROP CHECK constraint DROP CLONE
| ADD UNIQUE constraint
| DROP UNIQUE constraint
|
|
| Figure 167. Alter Table panel (ADB21TA)
|
3. Change any of the input field values, such as AUDIT or VOLATILE. You can
also select one of the options in the lower portion of the panel by entering an S,
as shown in the previous figure, for ADD CHECK constraint.
4. Press Enter to run the ALTER TABLE statement.
Related concepts
“Changing tables” on page 252

Examples of altering a table with the AL line command


The examples in this topic show how to alter a table with the AL line command.

Adding a primary key to a table


To add a primary key to a table:
1. From the Tables, Views, and Aliases panel (ADB21T), issue the AL line
command against the table that you want to add a primary key to. The Alter
Table panel (ADB21TA) is displayed.
2. On the Alter Table panel, specify an S before ADD PRIMARY KEY and press
Enter. The Add Primary Key Constraint panel (AB21TAN) is displayed. If you
need help selecting the columns for the primary key, use the COLUMNS
primary command to display a list of the columns. Use the sequence line
command to specify a number for the relative position of each column that you
want in the primary key. Press PF3 to return to the previous panel.
3. Optional: Specify a name for the primary key constraint.
4. Press Enter to run the ALTER TABLE statement. The primary key is created.

Adding a partitioning key to table


1. From the Tables, Views, and Aliases panel (ADB21T), issue the AL line
command against the table that you want to add a partitioning key to. The
Alter Table panel (ADB21TA) is displayed.

Chapter 12. Changing DB2 objects 255


2. Type an S before ADD PARTITIONING KEY and press Enter. The Alter Table
panel (AB21TAP) is displayed.
3. Select the columns to be part of the partitioning key and their order (A is
ascending, D is descending). You can also use the 3D line command to assign a
specific column sequence.
4. Enter the CONTINUE primary command to display the Alter Partitioned Table
panel (ADB21TAV). If you need to start over and eliminate the changes you
make, use the ORIGINAL primary command. If you want to remove a
particular column from the set of selected columns for the key, use the R line
command. If you need help entering limit key values, use the COLUMNS
primary command to list the details of the columns that are selected to be part
of the key on the previous panel ADB21TAP.
5. After you enter the limit key values for all partitions, enter the CONTINUE
primary command to run the ALTER TABLE statement and create a
partitioning key. Panel ADB21TA is displayed again.

Adding a partition to a table


1. From the Tables, Views, and Aliases panel (ADB21T), issue the AL line
command against the partitioned table that you want to add a partition to. The
Alter Table panel (ADB21TA) is displayed.
2. Type an S before ADD/ALTER PART and press Enter. The Alter Partitioned
Table panel (ADB21TAV) is displayed.
3. Issue the ADD primary command to add a row with the next partition number
generated.
4. Enter the partition limit key values, according to the Partitioning index/Data
partitioned secondary index that is already created for the table.
5. After entering the limit key values for the new partition, use the CONTINUE
primary command to display the ALTER - STOP command confirmation panel
(ADB21TAS).
6. Enter the appropriate choice. For example, option 1 runs the stop database
statements, alters the table, and runs the start database statements. The
partition is then added to the table.
7. Press Enter to run the ALTER TABLE statement.

Altering a partition
1. From the Tables, Views, and Aliases panel (ADB21T), issue the AL line
command against the partitioned table that you want to alter a partition for.
The Alter Table panel (ADB21TA) is displayed.
2. Type an S before ADD/ALTER PART and press Enter. The Alter Partitioned
Table panel (ADB21TAV) is displayed.
3. Change the limit key values for any of the partitions.
4. Use the CONTINUE primary command to run the ALTER TABLE statement.
The partitions are altered with their new values.

Rotating a partition
1. From the Tables, Views, and Aliases panel (ADB21T), issue the AL line
command against the partitioned table that you want to rotate partitions for.
The Alter Table panel (ADB21TA) is displayed.
2. Type an S before ADD/ALTER PART and press Enter. The Alter Partitioned
Table panel (ADB21TAV) is displayed.
3. Use the ROTATE primary command to rotate a partition. A pop-up panel
(ADB21TAV) is displayed.

256 User's Guide and Reference


4. Select Option 1 - Execute the statement on the ADB2PSTM panel. The Alter
Table - Utilities panel (ADB21TAU) is displayed. The ROTATE statement is held
until all the other ALTER statements are executed. If the first logical partition of
the table space is in REORG, run the REORG utility before running ROTATE.
5. Press Enter. Press Enter and the JCL screen appears. The ALTER TABLE
statement shows a successful rotate partition, as shown in the following
example:
ALTER TABLE "SMITHJR"."TBADAJ01" ROTATE PARTITION FIRST TO LAST ENDING
AT ('10500') RESET;

Redefining a table with the ALC line command


Use the ALC line command to redefine a table.

Before you redefine a table, see “How the DB2 Admin Alter ALC function works”
on page 272.

To redefine a table with the ALC line command:


1. From the main menu, select option 1.T. The Tables, Views, and Aliases panel is
displayed, as shown in the following figure.

DB2 Admin ----------- DB2X Tables, Views, and Aliases -------- Row 1 to 6 of 6
Command ===> Scroll ===> PAGE

Commands: GRANT MIG


Line commands:
C - Columns A - Auth L - List X - Indexes S - Table space D - Database
V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
? - Show all line commands

Sel Name Owner T DB Name TS Name Cols Rows Checks


* * * * * * * *
----- ------------------ -------- - -------- -------- ------ ----------- ------
USERNAMES SYSIBM T DSNDB06 SYSDDF 6 4 1
LUNAMES SYSIBM T DSNDB06 SYSDDF 9 4 6
ALC DEPT DSN8810 T DSN8D81A DSN8S81D 6 13 0
VDEPT DSN8810 V DSN8D81A DSN8S81D 4 -1 0
VHDEPT DSN8810 V DSN8D81A DSN8S81D 5 -1 0
EMP DSN8810 T DSN8D81A DSN8S81E 14 42 2
******************************* END OF DB2 DATA *******************************

Figure 168. Tables, Views, and Aliases panel (ADB21T) - Invoking the Alter ALC function

2. Issue the ALC line command against the table that you want to change. The
Alter Table panel is displayed, as shown in the following figure. The panel
displays some identifying information about the table, the action that is
required to change the table, the number of rows that fit in the current page
size, and the current columns of the table.
| The following restrictions for DB2 V9 apply to the Alter Table panel:
| v The target table space must be of the same partitioning type as the existing
| table space (partition by growth or partition by range).
| v XML NOT NULL NO DEFAULT columns cannot be added to the table since
| there is no DB2 default value to use.
| v RENAME COLUMN is not possible if a view exists on the table. DB2 only
| requires that the column not be referenced in a view, but it is
| programmatically difficult to make that determination.

Chapter 12. Changing DB2 objects 257


DB2 Admin ------------------- DB2X ALTER Table ------------------ Row 1 from 5
Command ===> Scroll ===> PAGE

New owner ===> DSN8810 > Old owner : DSN8810


New name ===> DEPT > Old name : DEPT
Volatile ===> NO Action : NONE New DB : DSN8D81A
Rows/Page : 48.188 Partitions: 0 New TS : DSN8S81D
Commands : CONTINUE PRIMKEY ADD REL ALTPART
Line commands :
I - Insert U - Update D - Delete R - Repeat LAB - Label COM - Comment
M - Move A - After B - Before X - Index RES - Reset update
Old Operation
Select Column Name Col No Col Type Length Scale Null D Col No Type
* * * * * * * * *
------ ------------------ ------ -------- ------ ------ ---- - ------ ---------

DEPTNO 1 CHAR 3 0 N N 1
DEPTNAME 2 VARCHAR 36 0 N N 2
MGRNO 3 CHAR 6 0 Y Y 3
ADMRDEPT 4 CHAR 3 0 N N 4
LOCATION 5 CHAR 16 0 Y Y 5
******************************* END OF DB2 DATA *******************************

Figure 169. Alter Table panel (ADB27C)

The following fields are shown on the Alter Table panel:


New owner
The new owner of the table.
New name
The new name of the table.
New DB
The new database name of the table.
If you specify the name of a database that does not exist, DB2 Admin
prompts you to create the database by displaying the Create Database
panel (ADB26CD).
New TS
The new table space name of the table.
If you specify the name of a table space that does not exist, DB2 Admin
prompts you to create the table space by displaying the Create Table
Space panel (ADB26CS).
Volatile
Enter YES or NO to alter the VOLATILE parameter on the table.
The panel columns on the Alter Table panel are:
Select Input field for entering line commands. If you enter a line command on
the first blank line, it applies to the beginning of the table.
Column Name
New name of the column.
Col No
New position of the column.
Col Type
New type of the column.
Length
New length attribute of a column. For a decimal column, it represents
the precision, which can range from 1 to 31.

258 User's Guide and Reference


Scale For decimal a column, it represents the number of decimal points to the
right. It can range from 0 to the value of the length for the column.
Null Specifies whether the column can contain null values.
D New default value. Possible values are:
N None
Y Yes
B Yes
1–5 User defined
S SQLID
U User
Old Col No
Old position of the column.
Operation Type
Last operation performed on the column.
The following primary commands on the Alter Table panel are valid:
CONTINUE
Generates the jobs to run the changes to the tables.
PRIMKEY
Adds or alters the primary key for the table. Because a primary key
requires a unique index for the chosen columns, you are prompted to create
a new index or redefine an existing index when you add or change a
primary key. The Alter Primary Key - Columns panel (ADB26CTP) is
displayed. In the Select column, you can enter any number from 1 to 99 to
add or change the primary key sequence. When you are finished, enter the
CONTINUE primary command to return to the Alter Table panel
(ADB27C).
When you return to the Alter Table panel, a message that indicates that a
primary key is required is displayed. If you press Enter, the Alter Related
panel (ADB27CR) is displayed. To redefine an existing index, issue the A
line command for the index to be changed. To define a new index, issue the
ADDINDEX primary command to go to the Create Index panel (ADB26CX)
where you can define the index.
After you redefine an existing index or define a new index for the primary
key and return to the Alter Tables panel (ADB27CA), you can issue the A
line command to redisplay the Alter Table panel to complete any other
changes to the table, or you can issue the ALTER command to generate the
jobs that will change the table and change or create the index. You can then
edit and submit the generated jobs.

Restriction: If a column is added to an existing primary key in a referential


constraint, the changes to the table are not eligible for DB2
Admin Smart Alter. The table is dropped and re-created. The
ALTER TABLE statements that reconstruct the referential
constraint must be updated in the SQL file that is produced by
the Alter Table process to include the desired column from the
foreign key table.
ADD
Displays a panel on which to add additional tables to the ALTER JCL.

Chapter 12. Changing DB2 objects 259


ADDFK
If you are altering a primary key column of a table, an additional primary
command, ADDFK, is available on panel ADB27C to propagate the primary
key column updates for the target table to all tables affected by the update.
All tables become part of the ALTER JCL and are displayed on the Alter
Tables panel (ADB27CA).
REL
Displays a panel on which you can alter related indexes and views.
ALTPART
For DB2 Version 8 and later, this command adds or alters partition-based
tables.
3. Change any of the input field values, such as Volatile or New TS, or use any of
the line commands on the displayed columns to change the attributes of
existing columns, add new columns, change the sequence of columns, and
delete columns. For example, enter a D line command to delete a column.
4. From the Alter Table panel (ADB27C), issue the CONTINUE primary command
to generate the batch jobs that will make the changes to the table.
If you changed the table (added columns or altered column lengths) such that
its maximum row size exceeds the page size or such that a smaller page size
could be used, the Alter Table Space Option panel is displayed, as shown in
Figure 170 on page 261. Otherwise, the Alter Parameters panel is displayed, as
shown in Figure 172 on page 262.If the Alter Table Space Option panel is
displayed, review the information on the panel about the page size utilization
and make any needed adjustments to the column definition or to the page size
of the table space.
The Alter Table Space Option panel indicates that either the maximum row
length of the table exceeds the page size of the table space and no rows will fit
on the current page size, or that you can reduce the current page size to
improve space utilization. Either go back to the Alter Tables panel and change
the column definitions to better utilize the current page size or change the table
space to use a larger or smaller page size.
Attention: If the row length is larger than the current page size and you do
not alter the table or table space such that at least one row fits in the current
page size, the alter process continues but will fail later at the job step that
creates the new table definition.
For example, the Alter Table Space Option panel that is shown in the following
figure indicates that the row length of 8206 does not fit into the current page
size of 8192 (8K). If you cannot change the table definition to decrease the row
length, you need to increase the page size to 16K or 32K. With 16K,
approximately 50.1% of the page is used (8178 bytes are unused). With 32K,
approximately 75.1% of the page is used (8150 bytes are unused).

260 User's Guide and Reference


DB2 Admin ------------------ DB2X ALTER Table Space option -----------------
Command ===>

Page size Utilizations

The new ROW length 8206 is HIGHER than PGSIZE 8192


Alter the table space to change the page size OR
change the table size to better utilize the space.
Maximum rows per page is 255.

PGSIZE Rows per Page Percent Utilization


4K 0.4991 0.0
8K 0.9971 0.0
16K 1.9963 50.1
32K 3.9932 75.1

Figure 170. Alter Table Space Option panel (ADB27C) - example of a larger row length than
page size

If the row length is smaller than the current page size, you do not need to alter
the table or table space; the alter process will continue, and the job step that
creates the new table definition will succeed. However, you can improve space
utilization either by changing the table definition or by changing the page size,
especially when the current page size allows for more rows than the DB2 limit
of 255 rows per page.
For example, the Alter Table Space Option panel that is shown in the following
figure indicates that the current page size is 8192 (8K), but that it would save
space to change the page size to 4K. Fewer rows exceed the 255 maximum with
4K page size than with the other page sizes.

DB2 Admin ------------------ DB8A ALTER Table Space option -----------------


Command ===>

Page size Utilizations

The new ROW length 10 is LOWER than PGSIZE 8192


Alter the table space to change the page size OR
change the table size to better utilize the space.
Maximum rows per page is 255.

PGSIZE Rows per Page Percent Utilization


4K 409.600 100.0
8K 818.200 100.0
16K 1638.20 100.0
32K 3276.80 100.0

Figure 171. Alter Table Space Option panel (ADB27C) - example of a smaller row length than
page size

5. Fill in the fields of the Alter Parameters panel and press Enter. Specify the
following items:
v Whether the ALTER TABLE (ALC) request should be placed in a work
statement list
v Data set information for the generated jobs
v Output job options
v Optional utility job steps, such as RUNSTATS and REBIND
v Whether to use active templates
The jobs to perform the alter are generated, and an ISPF Edit session is
displayed. If you specified YES for the Enable Restore field, you will be
prompted for the name of data set for the restore jobs before DB2 Admin
generates the jobs.

Chapter 12. Changing DB2 objects 261


| Important: If you choose to have the statements to perform the alter put in a
| work statement list (WSL) and specify that the WSL is to be
| generated online, JCL to create the WSL is generated and run
| online. Before the online processing starts, you are prompted for the
| WSL information and restore job information (if you specified that
| option). When the online processing is complete, a work data set is
| displayed. This work data set contains the messages that would be
| seen in the job output if the WSL had been generated with a batch
| job. After you review the messages and press F3, a message is
| displayed to indicate whether the WSL was created or the online
| processing was incomplete.

| DB2 Admin --------------------- DB2X DB2 Admin ALTER -------------------- 15:47


| Option ===>
|
| Please specify the following for DB2 Admin ALTER: DB2 System: DB2X
| DB2 SQL ID: R148286
| Worklist information:
| Worklist name . . . . . . : USERNAME (also used as middle qualifier in DSNs)
|
| Data set information:
| PDS for jobs . . . . . . : ALTER01.JCL
| Prefix for datasets . . . : R148286
|
| Output job options:
| Combine job steps . . . . : YES (Yes/No)
| Add to work stmt list . . : NO (Yes/No, to append to work stmt)
| Generate WSL online . . : NO (Yes/No)
| Member name of single job : ADBALTER (default ADBALTER)
| Member name of Delete job : (Blank, name to delete work data sets)
| Enable Restore. . . . . . : YES (Yes/No)
| Unload Method . . . . . . : R (Dsntiaul, Reorg unload, HPU or Unload)
| DROP Alias . . . . . . . : NO (Yes/No)
| Parallel Unload/Load . . : (Yes/No, DB2 UNLOAD utility only)
| Run SQLID . . . . . . . . : (Blank, an SQLID, or <NONE>
| VIEW Column List . . . . : YES (Yes/No,generate column list for views)
| Authorization Switch ID . : (SQLID to connect as, blank or <NONE>)
|
| Optional steps after redefinition:
| Run REORG . . . . . . . : NO (Yes/No, for Smart-Altered tables)
| Run CHECK DATA . . . . . : NO (Yes/No/Always)
| Run IMAGE COPY . . . . . : NO (Yes/No/Always)
| Run RUNSTATS . . . . . . : NO (Yes/No/Always)
| Run REBIND . . . . . . . : NO (Yes/No, for dropped objects)
|
| Utility control options:
| Generate template statements : NO (Yes/No)
| Use customized utility options: NO (Yes/No)
|
| BP - Change batch job parameters
| TU - Specify Template Usage
| UO - Change utility options
||
| Figure 172. Alter Parameters panel (ADB27A)
|
6. Edit and submit the generated jobs. An example ISPF edit session is shown in
the following figure.

262 User's Guide and Reference


****** ***************************** Top of Data ******************************
000001 //R148286 JOB,'DB2 UTILITY',
000002 //* RESTART=STEPNAME, <== FOR RESTART REMOVE * AND ENTER STEP NAME
000003 // REGION=0000K,NOTIFY=R148286
000004 // MSGCLASS=X,
000005 // CLASS=A
000006 //*
000007 /*JOBPARM S=SY4A
000008 //*
000009 //* ******************************************************ADB27OPT******
000010 //* ****** LISTING OF OPTION FROM PANEL ADB27A *************************
000011 //* WORKLIST INFORMATION: ********* SKEL ADB27OPT
000012 //* WORKLIST NAME . . . . . . : USERNAME
000013 //*
000014 //* DATA SET INFORMATION:
000015 //* PDS FOR BATCH JOBS . . . : ALTER01.JCL
000016 //* PREFIX FOR DATASETS . . . : R148286
000017 //*
000018 //* OUTPUT JOB OPTIONS:
000019 //* COMBINE JOB STEPS . . . . : Y
000020 //* ADD TO WORK STMT LIST . . : N
000021 //* MEMBER NAME OF SINGLE JOB : ADBALTER
000022 //* MEMBER NAME OF DELETE JOB :
000023 //* ENABLE RESTORE. . . . . . : YES
000024 //* UNLOAD METHOD . . . . . . : R
000025 //* DROP ALIAS . . . . . . . : NO
000026 //* PARALLEL UNLOAD/LOAD . . :
000027 //* RUN SQLID . . . . . . . . :
000028 //* VIEW COLUMN LIST . . . . : Y
000029 //* AUTHORIZATION SWITCH ID . :
000030 //*
000031 //* OPTIONAL STEPS AFTER REDEFINITION:
000032 //* SMART ALTER (ONLY):
000033 //* RUN REORG . . . . . . . : N
000034 //* DROP TABLE :
000035 //* RUN CHECK DATA . . . . . : N
000036 //* RUN IMAGE COPY . . . . . : N
000037 //* RUN RUNSTATS . . . . . . : N
000038 //* RUN REBIND . . . . . . . : N
000039 //*
000040 //* UTILITY CONTROL OPTIONS: .
000041 //* GENERATE TEMPLATE STATEMENTS : N
000042 //*
000043 //* END OF ADB27A OPTIONS

Figure 173. Edit alter job panel, Part 1 of 2

Chapter 12. Changing DB2 objects 263


000044 //***********************************************************ADB2GEN***
000045 //* STEP GNSQL10: GENERATE SQL FROM DB2 CATALOG
000046 //*
000047 //* RESTART JOB STEP NAME IF FAILED IN THIS STEP : GNSQL10
000048 //*
000049 //**********************************************************************
000050 //GNSQL10 EXEC PGM=IKJEFT01,DYNAMNBR=100
000051 //STEPLIB DD DISP=SHR,DSN=ADB.V72JFKD.ISPLLIB
000052 // DD DISP=SHR,DSN=ADB.V71CMDB.ISPLLIB
000053 // DD DISP=SHR,DSN=GOC.V71CMDB.ISPLLIB
000054 // DD DISP=SHR,DSN=DMTOOL.ADB7APAR.SADBLLIB
000055 // DD DISP=SHR,DSN=DMTOOL.GOC7APAR.SGOCLLIB
000056 // DD DISP=SHR,DSN=DSN.DB8A.SDSNEXIT
000057 // DD DISP=SHR,DSN=DSN.DB8A.SDSNLOAD
000058 // DD DISP=SHR,DSN=DMTOOL.AUTHSW.ISPLLIB
000059 //SYSTSPRT DD SYSOUT=*
000060 //SYSTSIN DD *
000051 DSN SYSTEM(DB8A)
000058 RUN PROG(ADB2GEN) PLAN(ADBDEV)
000059 END
000060 /*
000061 //SYSPRINT DD SYSOUT=*
000062 //SQL DD DISP=SHR,DSN=R148286.USERNAME.DDL
000063 //IN DD *
000064 DB2SYS = 'DB8A',
000065 DB2ALOC = '',
000066 DB2SERV = 'DB8A',
000067 DB2AUTH = 'R148286',
.
.
.

Figure 174. Edit alter job panel, Part 2 of 2

Related concepts
“Changing tables” on page 252
“How the DB2 Admin Alter ALC function works” on page 272
“Using DB2 Admin Smart Alter” on page 269
Related tasks
“Redefining a table space” on page 247
“Restoring a changed table” on page 270
“Recovering a table if changes fail” on page 270

Example: Inserting a column


To insert a column into a table:
1. From the main menu, select option 1.T. The Tables, Views, and Aliases panel is
displayed.
2. Issue the ALC command against the table to be changed. The Alter Table panel
is displayed. (For information about any of the fields in this panel, access the
online help.)
3. Issue the I line command, as shown in Figure 175 on page 265, to insert a new
column at the specified position. The Alter Table panel is redisplayed with a
new row inserted, as shown in Figure 176 on page 265.

264 User's Guide and Reference


DB2 Admin ------------------- DB2X ALTER Table ------------------ Row 1 from 5
Command ===> Scroll ===> PAGE

New owner ===> DSN8810 > Old owner : DSN8810


New name ===> DEPT > Old name : DEPT
Volatile ===> NO Action : NONE New DB : DSN8D81A
Rows/Page : 48.188 Partitions: 0 New TS : DSN8S81D
Commands : CONTINUE PRIMKEY ADD REL ALTPART
Line commands :
I - Insert U - Update D - Delete R - Repeat LAB - Label COM - Comment
M - Move A - After B - Before X - Index RES - Reset update
Old Operation
Select Column Name Col No Col Type Length Scale Null D Col No Type
* * * * * * * * *
------ ------------------ ------ -------- ------ ------ ---- - ------ ---------

DEPTNO 1 CHAR 3 0 N N 1
I DEPTNAME 2 VARCHAR 36 0 N N 2
MGRNO 3 CHAR 6 0 Y Y 3
ADMRDEPT 4 CHAR 3 0 N N 4
LOCATION 5 CHAR 16 0 Y Y 5
******************************* END OF DB2 DATA *******************************

Figure 175. Alter Table panel (ADB27C) - Inserting a column

4. Fill in the fields, as shown in the following figure, to define the new column
and press Enter. The Alter Table panel is displayed again.

DB2 Admin ------------------- DB2X ALTER Table ------------------ Row 1 from 6


Command ===> Scroll ===> PAGE

New owner ===> DSN8810 > Old owner : DSN8810


New name ===> DEPT > Old name : DEPT
Volatile ===> NO Action : NONE New DB : DSN8D81A
Rows/Page : 48.188 Partitions: 0 New TS : DSN8S81D
Commands : CONTINUE PRIMKEY ADD REL ALTPART
Line commands :
I - Insert U - Update D - Delete R - Repeat LAB - Label COM - Comment
M - Move A - After B - Before X - Index RES - Reset update
Old Operation
Select Column Name Col No Col Type Length Scale Null D Col No Type
* * * * * * * * *
------ ------------------ ------ -------- ------ ------ ---- - ------ ---------

DEPTNO 1 CHAR 3 0 N N 1
DEPTNAME 2 VARCHAR 36 0 N N 2
? 5 ? ? ? 0 INSERT
MGRNO 3 CHAR 6 0 Y Y 4
ADMRDEPT 4 CHAR 3 0 N N 5
LOCATION 5 CHAR 16 0 Y Y 6
******************************* END OF DB2 DATA *******************************

Figure 176. Alter Table panel (ADB27C) - Specifying attributes for the inserted column

Requirement: If you insert a new column at the end of an existing table, the
column must be defined with a null value or a specified default
value.
To specify a user-defined data type or a default value for the new column, you
can use the U line command to display the Update Column panel, as shown in
the following figure. Press Enter to return to the Alter Table panel.

Chapter 12. Changing DB2 objects 265


DB2 Admin ------------- DB2X ALTER: UPDATE Column Number 6 ------------- 10:53
Command ===>

DB2 Admin ALTER Owner ===> DSN8810


Name ===> DEPT
Column name ===> COMMENT (column number 6)

Data type ===> CHAR (CHAR,DECIMAL,INTEGER,SMALLINT,etc)


Data length ===> 30
Precision ===> (used only w/FLOAT and DECIMAL)
Scale ===> (used only w/DECIMAL)
Schema name ===> (User-defined only)
Type name ===>

Allow Nulls ===> N (Yes-Nullable, No-NOT NULL)


FOR ? DATA ===> (B-Bit, S-SBCS, M-Mixed, blank-N/A)
w/DEFAULT ===> Y (Yes, No, L (SECLABEL) or enter value below)
Def. value ===>

GENERATED ===> (A-ALWAYS, D-DFLT, J-DFLT AS IDENT)


FIELDPROC
Program name ===> (optional)
Program parm ===> >

Figure 177. Update Column panel (ADB26CTU)

5. Complete Step 4 through Step 6 to generate and run the jobs that will insert the
column.

Example: Updating a column


To update a column:
1. From the main menu, select option T.1. The Tables, Views, and Aliases panel is
displayed.
2. Issue the ALC command against the table to be changed. The Alter Table panel,
as shown in the following figure, is displayed.

DB2 Admin ------------------- DB2X ALTER Table ------------------ Row 1 from 5


Command ===> Scroll ===> PAGE

New owner ===> DSN8810 > Old owner : DSN8810


New name ===> DEPT > Old name : DEPT
Volatile ===> NO Action : NONE New DB : DSN8D81A
Rows/Page : 48.188 Partitions: 0 New TS : DSN8S81D
Commands : CONTINUE PRIMKEY ADD REL
Line commands :
I - Insert U - Update D - Delete R - Repeat LAB - Label COM - Comment
M - Move A - After B - Before X - Index RES - Reset update
Old Operation
Select Column Name Col No Col Type Length Scale Null D Col No Type
* * * * * * * * *
------ ------------------ ------ -------- ------ ------ ---- - ------ ---------

DEPTNO 1 CHAR 3 0 N N 1
DEPTNAME 2 VARCHAR 36 0 N N 2
MGRNO 3 CHAR 6 0 Y Y 3
ADMRDEPT 4 CHAR 3 0 N N 4
U LOCATION 5 CHAR 16 0 Y Y 5
******************************* END OF DB2 DATA *******************************

Figure 178. Alter Table panel (ADB27C) - Updating a column

3. Either type over the fields of the column that you want to update, or issue the
U line command against the column. The U line command allows you to
change more attributes. When you use the U line command, the Update
Column panel, as shown in the following figure, is displayed. The current

266 User's Guide and Reference


attributes for that column are displayed and are available for updating. (For
information about any of the fields in this panel, access the online help.)

Restriction: When you update a column, you can increase its length but not
decrease it. If you decrease the length, existing data might be
truncated. To decrease the length, you must unload the table, drop
the table definition, re-create the table using the new format, and
reload the data.

DB2 Admin ------------- DB2X ALTER: UPDATE Column Number 5 ------------- 10:54
Command ===>

DB2 Admin ALTER Owner ===> DSN8810


Name ===> DEPT
Column name ===> LOCATION (column number 5)

Data type ===> CHAR (CHAR,DECIMAL,INTEGER,SMALLINT,etc)


Data length ===> 16
Precision ===> (used only w/FLOAT and DECIMAL)
Scale ===> (used only w/DECIMAL)
Schema name ===> (User-defined only)
Type name ===>

Allow Nulls ===> Y (Yes-Nullable, No-NOT NULL)


FOR ? DATA ===> (B-Bit, S-SBCS, M-Mixed, blank-N/A)
w/DEFAULT ===> Y (Yes, No, L (SECLABEL) or enter value below)
Def. value ===>

GENERATED ===> (A-ALWAYS, D-DFLT, J-DFLT AS IDENT)


FIELDPROC
Program name ===> (optional)
Program parm ===> >

Figure 179. Update Column panel (ADB26CTU)

4. Make your changes to the column and press Enter to redisplay the Alter Table
panel.
About primary key columns
If you are altering a primary key column of a table, an additional
primary command, ADDFK, is available on panel ADB27C to propagate
the primary key column updates for the target table to all tables
affected by the update. All tables become part of the ALTER JCL and
are displayed on the Alter Tables panel (ADB27CA).
About identity columns
If you are altering a table that contains an identity column and the
table is being dropped and re-created, the column definition becomes
GENERATED BY DEFAULT to preserve current data values. The first
value that will be generated for the identity column (the START WITH
clause) is also changed. The new START WITH value, which is the
value that will be assigned next to the identity column, is the last
unassigned value (MAXASSIGNEDVAL in SYSIBM.SYSSEQUENCES)
plus the increment value (INCREMENT in SYSIBM.SYSSEQUENCES).
If values were cached, any existing unassigned values in the cache that
have not been used are lost. Loss of unassigned cached values causes a
gap between the last assigned value of the identity column and the
new starting value.
5. Complete Step 4 through Step 8 to generate and run the jobs that will insert the
column.

Chapter 12. Changing DB2 objects 267


Example: Changing a foreign key
To change a foreign key:
1. From the main menu, select option T.1 to display the Tables, Views, and Aliases
panel.
2. Issue the FK line command against a table to display the Foreign Keys panel,
which shows the foreign keys for the table.
3. Issue the ALC line command against the foreign key that you want to change,
as shown in the following figure.
The Alter Related panel is displayed.
DB2 Admin --- DB2X Foreign Keys for Table: DSN8810.PROJACT --- Row 1 to 2 of 2
Command ===> Scroll ===> PAGE

Line commands:
FC - From Column TC - To Column T - To Table ALC - Alter FK
From: To:
Sel Column Name Rel Name Owner Name Column Name
* * * * *
--- ------------------ -------- -------- ------------------ -------------------
ALC ACTNO RPAA DSN8810 ACT ACTNO
PROJNO RPAP DSN8810 PROJ PROJNO

Figure 180. Foreign Keys panel (ADB21TFK) - Changing a foreign key

4. As shown in the following figure, issue the A line command against the foreign
key that you want to change.

ADB21TAF ----------------------- DB8A Alter Table ---------------------- 18:07


Command ===>

ALTER TABLE

Table owner ===> DSN8810 >


Table name ===> PROJACT >

FOREIGN KEY Constraint name ===> RPAA >

Column name 1 ===> ACTNO > 5 ===> >


2 ===> > 6 ===> >
3 ===> > 7 ===> >
4 ===> > 8 ===> >

REFERENCES Table creator ===> DSN8810 >


Table name ===> ACT >

ON DELETE ===> RESTRICT (RESTRICT, CASCADE, SET NULL, or NO ACTION)

Figure 181. Alter Table (ADB21TAF) - Changing a foreign key

5. As shown in the following figure, make your changes for the foreign key in the
Alter Table panel that is displayed.
6. Press F3 twice to return to the Alter Tables panel.
7. Complete Step 4 through Step 8 to generate and run the jobs that will change
the foreign key.

Example: Renaming a table


To rename a table:
1. From the main menu, select option T.1 to display the Tables, Views, and Aliases
panel.
2. Issue the ALC line command against the table that you want to rename.

268 User's Guide and Reference


Tip:

Another way to rename a table without using the ALC line command to
redefine the table is to use the REN line command from the Tables, Views,
and Aliases panel.
The Alter Table panel is displayed.
3. Type the new name of the table in the New name field.
4. Complete Step 4 through Step 8 to generate and run the jobs that will rename
the table.
In some cases, DB2 Admin can determine that the table can be renamed by
executing a RENAME TABLE statement online without having to generate
batch jobs that will drop and re-create the table. When this is possible, you will
be prompted as to whether you want to use this smart alter process.

Using DB2 Admin Smart Alter


Under certain conditions when you use the ALC line command to redefine a table,
DB2 Admin can perform a smart alter to determine whether a table can be updated
without unloading its current contents, dropping the table definition, redefining it
in its new format to DB2, then reloading the data.

You can use the DB2 Admin Smart Alter function in the following situations only:
v To add a new column to the end of an existing table. The column must be
defined as having a null value or a specified default value.
v To update a column if the column data type is specified as VARCHAR. Only the
length can be increased.
| v To rename a table if the table does not have a trigger, view, or synonym defined
| on it.

| Remember: If you make any other changes to the table that would require that the
| table be dropped and re-created, you lose the ability to use DB2
| Admin Smart Alter. DB2 Admin Smart Alter also cannot be used if
| you are altering multiple tables and any one of the tables must be
| dropped and re-created; batch jobs are generated to make the changes
| to all of the tables.

For example, to use the DB2 Admin Smart Alter function to insert a new column
named COMMENT into table NEWDEPT, enter the ALTER primary command on
the Alter Table panel (ADB27C) and press Enter. The next Alter Table panel
(ADB27CTC) is displayed, as shown in the following figure.

Chapter 12. Changing DB2 objects 269


DB2 Admin ----------------------- DB2X Alter Table ---------------------- 10:09
Command ===>

DB2 Admin has determined that this table might be altered by executing the SQL
statement below rather than through a set of generated batch jobs.
All statements might not be visible due to space limitations.

ALTER TABLE "DSN8810"."NEWDEPT" ADD "COMMENT" CHAR(30) NOT NULL WITH DEFAULT;

Choose an option to : 1 - use SQL statement(s) above


2 - use generated batch jobs
3 - Alter Related indexes, views or foreign keys

Figure 182. Alter Table panel (ADB27CTC)

On this panel, you can either immediately run the SQL statement or you can
generate a batch job to update the table.
Related tasks
“Redefining a table with the ALC line command” on page 257

Recovering a table if changes fail


If a table modification fails and the original table is dropped, you can restore the
table to its original state.

To recover a table:
1. Drop the new table if it has been created.
2. Re-create the original table using the extracted DDL.
3. Load the table by using the unload data set. Remember to change the LOAD
utility statement to RESUME YES if other tables exist in the table space.
4. Create a new image copy of the table space.
5. Run RUNSTATS on the table.
Related tasks
“Redefining a table with the ALC line command” on page 257

Restoring a changed table


After you alter the columns of a table, you might decide that the changes were
incorrect and want to restore the table to its original state prior to the alter.

To be able to restore a table, you must specify whether restore should be enabled
when you alter the table. Only changes that are made by using the ALC line
command can be restored.

To enable a table to be restored:


1. From the Tables, Views, and Aliases panel (ADB21T), invoke the Alter function
by issuing the ALC line command against the table.
2. Change the table definition and then issue the CONTINUE primary command
on the Alter Table panel (ADB27C) or issue the ALTER primary command on
the Alter Tables panel (ADB27CA).
3. On the Alter Parameters panel, specify YES in the Enable Restore field.

270 User's Guide and Reference


4. When the Specify Dataset Name for Restore panel (ADB27AJ) is displayed,
specify the name of the data set in which DB2 Admin should place the restore
jobs.

When DB2 Admin generates the jobs for the alter, it also generates the jobs that are
necessary to restore the table to its original condition and places them in the data
set that you identified. The restore jobs will return the table to its original
definition and reload the original data. The restore jobs include any changes that
are made by the Smart Alter function.

To return the table to its original definition with its original underlying data after it
is altered, submit the restore jobs.

If you do submit the restore jobs to undo the changes, be aware that any changes
that are made to the data after the alter (ALC process) is performed are lost. Also,
after the work statement list is generated, any changes that are made directly to
the work statement list without going through the ALC process are not considered
for the restore process.
Related concepts
“Utility Template panel” on page 228
Related tasks
“Redefining a table with the ALC line command” on page 257
Related reference
“Work data sets used by the DB2 Admin Alter Restore function”
“Work data sets used by the DB2 Admin Alter ALC function” on page 273

Work data sets used by the DB2 Admin Alter Restore function:

The DB2 Admin Alter Restore function creates and uses work data sets to restore a
table to its original state.

The following figure shows the data sets that the DB2 Admin Alter Restore
function creates and uses to restore a table to its original state.
Table 12. Work data sets for DB2 Admin Alter Restore
Template
Default data set name Description keyword
prefix.worklist.RSTR.DDL DDL for the objects before restore RSDDL
prefix.worklist.RSTR.CNT Load control cards for the objects RSPUNCH
before restore
prefix.worklist.RSTR.ULD Unloaded data from the objects RSUNLDD
before the restore
prefix.worklist.DDL.ALL DDL for all objects before applying RSALTDDL
alters (including Smart Alters)

You can use templates to create your own naming conventions for the work data
sets. You enable the templates the same way that you enable the templates for the
work data sets that are used by the DB2 Admin Alter ALC function. The valid
variables for the templates for the restore work data sets are the same as the valid
variables for the work data sets for the ALC function.

Chapter 12. Changing DB2 objects 271


Related tasks
“Restoring a changed table” on page 270

How the DB2 Admin Alter ALC function works


When you use the ALC command to change a table, you invoke the DB2 Admin
Alter ALC function.

After you specify your changes in the online dialogs, you use the CONTINUE
primary command to generate the batch jobs that perform the actual alter
operation. (In some cases, DB2 Admin detects that an ALTER TABLE statement can
be used to make the changes, and you are given the choice of using DB2 Smart
Alter to run the ALTER TABLE statement immediately instead of generating and
using batch jobs to update the table.)

Before the required batch jobs are generated, the Alter Parameters panel is
displayed. On the Alter Parameters panel, you specify various information, such
as:
v The worklist name
v The PDS where you want the various jobs placed and the prefix to be used for
generated data sets (the prefix is not used if templates are used)
v The prefix to be used for generated data sets (the prefix is not used if templates
are used)
v The member name of a single job, if you want to combine the generated jobs
v Optional steps to run after the table is redefined, such as REORG

You can also use the BP command to update the unit type and space parameters
that are used for allocating the work and unload data sets.

When you press Enter on the Alter Parameters panel, the DB2 Admin Alter ALC
function generates the jobs and displays a PDS EDIT session for the specified job
PDS that contains the jobs. The generated jobs are:
v ST1RE - Reverse engineering
v ST1REALL - Reverse engineering when restore is enabled (optional)
v ST2ULnnn - Unload data for table nnn
v ST3AC - Convert
v ST4AR - Alter related merge DDL (optional)
v ST5DC - Drop and re-create
v ST6RLnnn - Reload data
v ST7CD - Check Data (optional)
v ST8ICnnn - Image Copy
v ST9RS - Runstats (optional)
v ST10RB - Rebind (optional)
v ST11DL - Delete work data sets, except those for restore and unload (optional)

DB2 Admin does not generate the conversion job step if it can determine that data
conversion is not needed.

The numeric values in these job names are adjusted to occur sequentially if you
omit optional steps or DB2 Admin determines that the conversion step is not
needed. For example, if related objects are not included, ST5DC becomes ST4DC.

272 User's Guide and Reference


Review the jobs and submit the jobs in the sequence shown above to perform the
changes.

| If you choose to have the statements that are necessary to make the changes put in
| a work statement list (WSL) and specify that the WSL is to be generated online
| instead of with a batch job, JCL to create the WSL is generated and run online.
| Messages are displayed to indicate the status as each step is run. When the online
| processing is complete, a work data set is displayed. This work data set contains
| the messages that would be seen in the job output if the WSL had been generated
| with a batch job.

You can use authorization switching when you redefine tables if authorization
switching is enabled on the subsystem.
Related tasks
“Redefining a table with the ALC line command” on page 257
“Redefining a partitioning index” on page 284
Related reference
Chapter 27, “DB2 Admin data type conversions,” on page 627
“Work data sets used by the DB2 Admin Alter ALC function”

Work data sets used by the DB2 Admin Alter ALC function
The DB2 Admin Alter ALC function creates and uses work data sets.

The following figure shows the work data sets that the DB2 Admin Alter ALC
function creates and uses.
Table 13. Work data sets for DB2 Admin Alter ALC
Template
Default data set name Description keyword
prefix.worklist.DDL DDL extracted from the catalog ALDDL
prefix.worklist.DDL.CONV DDL for the modified table ALDDLC
prefix.worklist.DDL.CONV.MOD Additional DDL added to the DDL ALDDLCM
for the modified table (ALDDLC)
prefix.worklist.DDL.MOD DDL modified for dropped objects ALMOD
prefix.worklist.IFF Interface file to batch jobs ALIFF
prefix.worklist.CMD Rebind control statements ALCMD
prefix.worklist.CNT.Tnnn LOAD utility statements, where ALCNT
Tnnn is a string assigned to the
object by DB2 Admin, with nnn
beginning with 1
prefix.worklist.ULD.Tnnn Unload data set of records, where ALULD
Tnnn is a string assigned to the
object by DB2 Admin, with nnn
beginning with 1
prefix.worklist.CNC.Tnnn Converted LOAD utility ALCNC
statements, where Tnnn is a string
assigned to the object by DB2
Admin, with nnn beginning with 1
prefix.worklist.ULC.Tnnn Converted unload data set of ALULDC
records, where Tnnn is a string
assigned to the object by DB2
Admin, with nnn beginning with 1

Chapter 12. Changing DB2 objects 273


Table 13. Work data sets for DB2 Admin Alter ALC (continued)
Template
Default data set name Description keyword
prefix.worklist.ULDD.Tnnn Discard data set for LOAD DISCARDDN (in
(optional), where Tnnn is a string the UTIL
assigned to the object by DB2 template type)
Admin, with nnn beginning with 1
prefix.worklist.WDD Generate worklist data set ALWDD
prefix.worklist.WLS General usage file to add an ALWLS
element to a WSL
| prefix.worklist.PRINT File for messages when the WSL is ALWORK
| generated online instead of in a
| batch job

The relationships between tables and their associated data sets are included in
summary format in the JCL as a comment on the Convert step. In addition, the
table being loaded is included as a comment in each LOAD step.
Related concepts
“Utility Template panel” on page 228
“How the DB2 Admin Alter ALC function works” on page 272
Related tasks
“Utility Template — Dataset Name panel” on page 231
“Restoring a changed table” on page 270
“Creating naming conventions for work data sets that are created by the DB2 Alter
ALC function”

Creating naming conventions for work data sets that are created by the DB2
Alter ALC function:

You can use templates to create your own naming conventions for the work data
sets that are created by the DB2 Admin Alter ALC function.

To use templates to create naming conventions for the work data sets that are
created by the DB2 Admin Alter ALC function:
1. Specify Yes in the Generate template statements field on the Alter Parameters
panel.
2. Ensure that you have constructed template data set names and have associated
the templates with the appropriate work data sets. You can use the TU primary
command on the Alter Parameters panel (or option 5 on the Administration
Menu panel) to manage the templates for the work data sets. You can use the
TU primary command on the Alter Tablespace Redefine - JCL panel (or Option
5 on the Administration Menu panel) to manage the templates for the work
data sets.
You can specify the following variables when you construct the data set name
pattern or mask for a template for a DB2 Admin Alter ALC (or DB2 Admin
Alter Restore) work data set:
&DB. Database name
&TS. Table space name
&USERID.
Batch user ID

274 User's Guide and Reference


&DATE.
YYYYDD
&TIME.
HHMMSS
&JDATE.
YYYYDDD
&YEAR.
YYYY
&MONTH.
MM
&DAY.
DD
&JDAY.
DDD
&HOUR.
HH
&MINUTE.
MM
&SECOND.
SS
This list of variables is a subset of the variables that are supported for normal
DB2 utility template processing. The other variables that are supported for
normal DB2 utility processing are not valid.
Related reference
“Work data sets used by the DB2 Admin Alter ALC function” on page 273
Related information
IBM Publications Center

When the DB2 Admin Alter ALC function skips the conversion
job step
Under certain conditions when you use the ALC command to change a table, DB2
Admin can determine that the step that occurs between the unload and load steps
to convert the data is not necessary.

Performance can improve when DB2 Admin can omit the conversion step from the
batch job.

In general, DB2 Admin will not generate a conversion step when:


v The table space or database in which the table resides is renamed.
v The table is renamed.
v The VOLATILE attribute of the table is changed.
v Columns in the table are:
– Moved
– Renamed
– Deleted
– Inserted with an attribute of WITH DEFAULT or NULLS
v Only the attributes of a column are changed.
v The data types and lengths are changed according to the matrix in the following
table:

Chapter 12. Changing DB2 objects 275


Table 14. Matrix for data type and length changes that do not require data conversion
To data type

SMALL VAR LVAR TIME


From data type INT INT DEC FLOAT CHAR CHAR CHAR DATE TIME STAMP RID
SMALLINT Y Y A Y - - - - - - -
INT - Y A Y - - - - - - -
DEC A A A Y - - - - - - -
FLOAT(1-21) - - - Y - - - - - - -
FLOAT(22-53) - - - Y - - - - - - -
CHAR A A A - Y Y Y - - - -
VARCHAR A A A - Y Y Y - - - -
LVARCHAR - - - - Y Y Y - - - -
DATE - - - - - - - Y - - -
TIME - - - - - - - - Y - -
TIMESTAMP - - - - - - - Y Y Y -
RID - - - - - - - - - - Y
Note:
Y = YES, data conversion will be skipped unless Z is chosen as the action on DB2 Admin ALTER Column Truncation panel (ADB27CT) if you are
prompted to specify what to do if the new length is smaller than the old length.
A = ACTION, , data conversion will be skipped unless T or Z is chosen as the action on the DB2 Admin ALTER Column Truncation panel
(ADB27CT) if you are prompted to specify what to do if the new length is smaller than the old length.

When the data conversion step is skipped, a converted unload data set is not
created. Data is loaded into the table from the unload data set.

Changing objects related to a table being changed


You can alter indexes, views, or foreign keys that are related to one or more tables
being altered in an Alter list.

To alter indexes, views, or foreign keys that are related to tables being altered on
the Alter Table panel (ADB27C), issue either the REL primary command or REL
line command on the Alter Tables panel (ADB27CA). The Alter Related panel
(ADB27CR) is displayed, shown in the following figure, showing indexes, views,
and foreign keys for that table. By using line commands, you can add the related
object to the Alter list.

276 User's Guide and Reference


DB2 Admin ------- DB2X Alter Related : DSN8810.NEWDEPT ----- Row 1 to 12 of 12
Command ===> Scroll ===> PAGE

Commands: ADDINDEX
Line commands: A - Alter object S - Show object
Dep.
S Type Creator Name Views Rel Name Note
* * * * * *
- ----------- -------- ------------------ ------ -------- ---------------------
INDEX DSN8810 XEMP1 0
INDEX DSN8810 XEMP2 0
VIEW DSN8810 VASTRDE2 0
VIEW DSN8810 VDEPMG1 2
VIEW DSN8810 VEMP 0
VIEW DSN8810 VEMPDPT1 0
VIEW DSN8810 VEMPLP 0
VIEW DSN8810 VPHONE 0
VIEW DSN8810 VPROJRE1 3
VIEW DSN8810 VSTAFAC2 0
VIEW VND03TB DAVES 0
VIEW WSCHRAY TEST_ONEROW_V 0
******************************* END OF DB2 DATA *******************************

Figure 183. Alter Related panel (ADB27CR) - Changing related objects

You can use the ADDINDEX command to create a new index on the table. You can
use the A line command to alter an object. For views, the view DDL is displayed in
an edit session. If you modify or save the view DDL, the new view DDL is
captured and the view is added to the Alter list.

For indexes, the index is displayed in the Alter Index Redefine panel. Entering
information on this panel causes the new index DDL to be captured and the index
is added to the Alter list. Any changes to column or table names are reflected as
part of the Alter Related panel.

For foreign keys, the definition of the foreign key is displayed on the Alter Table
panel. Any changes that are defined for column or table names are reflected as part
of the Alter Table panel. Columns added to, dropped from, or re-sequenced in the
parent table's primary key need to be updated on the Alter Table panel.

Restriction: For views, you must add or remove columns that you want inserted
or deleted to the DDL during the edit session.

After an object is added to the Alter list, if the base table name or columns in the
table are changed, the related objects that refer to that table are flagged on the
Alter Tables panel (ADB27CA) as possibly requiring you to edit them again. On
the Alter Tables panel, these tables are marked with an E in the Chg Rqd column.

When changing a view, you are prompted to decide whether the view should be
created with or without a column list. If the view was originally created without a
column list, the decision causes the view DDL to contain the column names from
the result table or to be absent of column names (depending on the decision). If the
view was originally created with column names, the DDL again contains column
names, regardless of the decision.

Only one level of views is presented on the Alter Related panel (ADB27CR). Each
view that is displayed on the panel shows the number of views that are derived
from this view. To alter a view on a view, first alter the parent view to add it to the
Alter list. On the Alter Tables panel (ADB27CA), you can then issue the REL line
command on a view to show the first level of views that are based on this view.

Chapter 12. Changing DB2 objects 277


The following figure shows a sample edit job panel for changing a related view.

****** ********************************* Top of Data **********************************


000001 CREATE VIEW DSN8810.VDEPMG1(DEPTNO, DEPTNAME, MGRNO, FIRSTNME,
000002 MIDINIT, LASTNAME, ADMRDEPT) AS
000003 SELECT ALL DEPTNO, DEPTNAME, EMPNO, FIRSTNME, MIDINIT, LASTNAME,
000004 ADMRDEPT
000005 FROM DSN8810.DEPT
000006 LEFT OUTER JOIN
000007 DSN8810.EMP
000008 ON MGRNO = EMPNO ;
000009 --
****** ******************************** Bottom of Data ********************************

Figure 184. Edit alter related view job panel

Related concepts
“Changing tables” on page 252

Changing multiple tables


You can use DB2 Admin to alter more than one table by adding tables to an Alter
list.

To alter more than one table by adding tables to an Alter list:


1. From the main menu, select option 1.T to display the Tables, Views, and Aliases
panel.
2. Invoke the Alter function by issuing the ALC line command against a table.
The Alter Table panel is displayed.
3. Issue the ADD primary command. The Alter Tables panel is displayed, as
shown in the following figure.

DB2 Admin ----------------------- DB2X Alter Tables ---------- Row 1 to 1 of 1


Command ===> Scroll ===> PAGE

Commands:
ALTER - generate jobs ADDFK - Add Foreign Key-affected tables
Line commands:
A - Alter Object D - Delete S - Select Object REL - Alter related
FK - Add Foreign Key-affected tables E - Edit DDL CD - Convert to Drop
RS - Reset RI-FK flags

To add a table, provide an owner and name below and hit Enter
Owner ===> > (Creator)
Name ===> > (Table Name. ? to look up)
RI RI FK Chg Object
Sel Creator Name T DB Name TS Name Rels Add Add Rqd Action
* * * * * * * * * *
--- -------- ------------------ - -------- -------- ------ --- --- --- -----
DSN8810 DEPT T DSN8D81A DSN8S81D 5 NO NO DROP
******************************* END OF DB2 DATA *******************************

Figure 185. Alter Tables panel (ADB27CA) - Changing multiple tables

The Alter Tables panel is displayed with only the initial table from ADB27C
listed in the Alter list.
You can use the Owner and Name fields to directly add a table or to look up
tables that you want to add.
The following primary commands are shown on the panel:
ADDFK
Use the ADDFK primary command to add tables that are involved in a

278 User's Guide and Reference


foreign-key relationship to the tables. The ADDFK command limits the
search to only those tables for which the RI-related column is being
updated (in the entire list). The ADDFK command automatically extends
any changes to the data type of column in the source table to the RI-related
tables. ADDFK is a recursive operation–that is, all tables added to the list
become the source table for a subsequent search. The operation continues
until all tables in the list (original or added) have been used as a source
table for the search.
ADDRI
Use the ADDRI primary command to add tables that are involved in a
foreign-key relationship to all tables. The ADDRI command processes the
listed tables one at a time, and searches for and adds tables that have an
RI-relationship to the table. The ADDRI command does not extend any
column alterations in the source table to the added tables. ADDRI is a
recursive operation–that is, all tables added to the list become the source
table for a subsequent search. The operation continues until all tables in the
list (original or added) have been used as a source table for the search.
ALTER
Continue to the next step in the alter process (build JCL).
The following line commands are shown on the panel:
A Alter the object.
CD
Drop and re-create the object (as opposed to altering it).
D Remove the object from the Alter list and the alter JCL.
E Edit the DDL of the altered object.
FK
Use the FK line command to add a specific table to the list. The FK
command limits the search to only those tables for which the RI-related
column is being updated (for the table chosen). The FK command
automatically extends the same column alterations as defined in the source
table to the related and newly added tables. A table that is added does not
become the source for further searches during the line command operation.
REL
List indexes and views that are related to the table.
RI Use the RI line command to add tables that are involved in a foreign-key
relationship to a given table in the list. The RI command adds tables only
related to the selected table (the one for which the RI line command was
entered). A table that is added does not become the source for further
searches during the line command operation.
RS
Use the RS line command to reset the status of the "RI Add" and "FK Add"
columns to NO for table objects. Using the RS command does not apply to
objects that have no RI relationships. In this case, NA appears in these
columns.
S Select the object and display information about that object.
You can add additional independent tables to the list using the two input fields
provided. You must specify a complete owner name in the Owner field. In the
Name field, you can specify either a complete name or use a question mark (?)
to fully or partially qualify the tables to be searched. On the subsequent
display, you can select only certain tables to add to the Alter list.

Chapter 12. Changing DB2 objects 279


The ADDFK and FK commands are the only operations that copy the column
alter operations from the source table. Adding tables using any other means
merely adds them to the Alter list without performing column alter operations.
As with a single-table alter stream, use the ALTER primary command to
generate the batch jobs that perform the actual alter operation.
The ADDFK and FK operations might execute more quickly if you create an
index on SYSIBM.SYSFOREIGNKEYS (CREATOR ASC, TBNAME ASC,
COLNAME ASC).
The Action field specifies whether an object will be dropped and re-created
(DROP or DROP-SC) or if it will be altered using the SQL ALTER or RENAME
statement (ALTER).
Related concepts
“Changing tables” on page 252

Changing indexes
To change an index, you issue either the AL line command or the AL line
command followed by the RDEF command against the index.

You can change an index in one of two ways:


v Use the AL line command to make certain changes that are supported by the
ALTER INDEX statement. The Alter Index panel shows the changes can be made
with only the AL command. DB2 Admin issues an ALTER INDEX statement to
make the changes.
v Use the AL line command followed by the RDEF command to make
more-complex changes that are not supported by the ALTER INDEX statement.
RDEF invokes the DB2 Admin Alter Redefine function which generates the batch
jobs that are required to redefine the index (unload the existing data, drop the
index, create the new definition of the index, and reload the data).
When you specify your index redefinition parameters, you can choose to save
your request to a work statement list.
When you redefine indexes, the DB2 Admin Redefine function creates and uses
one or more work data sets.
Related tasks
“Altering an index”
“Renaming an index” on page 281
“Redefining an index” on page 282
“Redefining a partitioning index” on page 284
Related reference
“Work data sets used by the DB2 Admin Alter Redefine function” on page 249

Altering an index
Use the Alter Index panel to alter an index.

To alter an index:
1. Use the AL line command on the Indexes panel (ADB21X). The Alter Index
panel is displayed, as shown in the following figure.

280 User's Guide and Reference


| ADB21XA n ------------------ DB2X Alter Index ---------------- Row 1 to 1 of 1
| Command ===> ________________________________________________ Scroll ===> PAGE
|
| Commands: ADDCOL RDEF
|
| ALTER INDEX RIVERAF.IXFGR (Nonpartitioned )
|
| Buffer Pool . . . BP0 Close Rule . . . YES Copy Allowed . . . NO
| Piece Size . . . . 4194304 Cluster . . . . NO Padded . . . . . . ___
| Compress . . . . . NO
|
| Sel Part Pqty Sqty FreePg %Free Erase ST VCAT Stogroup GBPCache
| --- ------ ----------- ------- ------ ----- ----- -- -------- -------> --------
|
| ___ 0 -1 -1 0 10 NO I DSN9 SYSDEFLT CHANGED
| ******************************* END OF DB2 DATA *******************************
||
| Figure 186. Alter Index panel (ADB21XA)
|
2. Alter index attributes and press Enter. DB2 Admin runs the SQL ALTER INDEX
statement.

For a partitioning index, a detail line is displayed for each partition. You can alter
any partition by updating the available attribute, such as %Free. To apply the same
change to all partitions of the index, provide a value in the All Parts row.

To change certain parameters, you must stop and restart the associated object. In
these cases, DB2 Admin issues a STOP table space or STOP index (or partition)
command and checks that the object is in a fully-stopped state. If stopped, it issues
an ALTER INDEX statement, followed by a START command. If the object is not in
a fully-stopped state, the STOP Check - Action panel prompts you to perform one
of the following actions:
v Re-check
v Issue the ALTER
v Cancel the operation
If an object is not stopped when the ALTER TABLESPACE statement is run (for
example, if others are holding locks on the object), a -626 SQLCODE is displayed.
Related concepts
“Changing indexes” on page 280
Related tasks
“Redefining an index” on page 282

| Renaming an index
| Use the Rename Index panel to rename an index.

| To rename an index:
| 1. Use the REN line command on the Indexes panel (ADB21X). The Rename Index
| panel is displayed, as shown in the following figure.
|

Chapter 12. Changing DB2 objects 281


| ADB21XR n ---------------------- DSN9 Rename Index ---------------------- 04:58
| Command ===>
|
| RENAME INDEX
|
| Schema . . . . . . . SMITHJR > (Optional, default is SMITHJR)
| Name . . . . . . . . TEMP2 > (? to look up)
|
| TO
|
| New name . . . . . . TEMP1 > (? to look up)
|
|
| Figure 187. Alter Index panel (ADB21XR)
|
| 2. Rename the index Name and press Enter. DB2 Admin runs the SQL RENAME
| INDEX owner.old_index TO new_index statement.

| Restriction: The index to be renamed must not be a system defined catalog


| index, an index for a declared temporary table, or an index for an
| active resource limit specification table. System defined catalog
| indexes are the indexes created by SYSIBM on tables in DSNDB06
| database
| Related concepts
| “Changing indexes” on page 280

Redefining an index
Use the Redefine Index panel to redefine an index.

To redefine an index:
1. Use the RDEF primary command on the Alter Index panel (ADB21XA). The
Redefine Index panel is displayed, as shown in the following figure.

| ADB21XAR --------------- DB2X Create Index --------------------- Row 1 from 2


| Command ===> ________________________________________________ Scroll ===> PAGE
|
| Commands: CONTINUE ORIGINAL EXPRESSION XMLPATTERN
| Line commands: nnn A|D - Sequence & order R - Remove the column
| A - Ascending D – Descending RA - Random U – Update expression/XML pattern
|
| CREATE INDEX RIVERAF . IXFGR >
| ON RIVERAF.TBFGR
| Unique . . . . ___ Where Not Null . . . ___ Cluster . . . . . ___
| Buffer Pool . . ________ Close Rule . . . . . ___ Copy Allowed . . ___
| Piece Size . . ________ Define . . . . . . . ___ Defer . . . . . . ___
| Partitioned . . ___ Padded . . . . . . . ___ Compress . . . . ___
|
| Select Column Name Col Type Length Scale N ColSeq Ord
| * * * * * * *
| ------ ------------------ -------- ----------- ------ - ------ ---
| ______ C1 INTEGER 4 0 Y
| ______ C2 INTEGER 4 0 Y
| ******************************* END OF DB2 DATA *******************************
||
| Figure 188. Alter Index – Redefine panel (ADB21XAR)
|
The following primary commands are available:
CONTINUE
Displays the next panel, on which you can specify other index parameters.
ORIGINAL
Restores all fields on the panel to their original values.

282 User's Guide and Reference


| EXPRESSION
| Create a new key-expression EXPRESSION. Creating multiple EXPRESSION
| commands is allowed. This command is available only on the Create Index
| panel, and not on the Redefine Index panel.
| XMLPATTERN
| Create a new XML pattern-expression XMLPATTERN. XMLPATTERN will
| become disabled due to the following DB2 restrictions:
| a. Only one XML pattern-expression is allowed per index.
| b. Key-expression and XML pattern-expression cannot co-exist in the same
| index. Therefore, if a key-expression has been created, XMLPATTERN
| will become disabled to avoid conflict. If an XML pattern-expression has
| been created, both EXPRESSION and XMLPATTERN commands will be
| disabled to avoid conflict.
| This command is available only on the Create Index panel, and not on the
| Redefine Index panel.
The following line commands are available:
A Updates the column as an ascending part of the index, or adds it in the
next available position.
D Updates the column as a descending part of the index, or adds it in the
next available position.
R Removes the column from the index.
nnn A|D
Adds the column as an ascending or a descending part of the index in the
nnn position.
| U Update key-expression or XML pattern-expression if one exists.
2. Enter changes for redefining the index beyond those definitions performed on
the Alter Index panel or by the ALTER INDEX statement. When you specify
your index redefinition parameters, you can choose to save your request to a
work statement list.
3. After specifying all values for the index parameters, use the CONTINUE
primary command to display the next panel. After all index parameters are
specified, use the CONTINUE primary command again to display a
confirmation panel (if the index redefinition can be performed using DDL). If
you are redefining a partitioning index, the confirmation panel is not displayed.
4. On the confirmation panel, choose whether to run the DDL or to build a batch
JCL job that runs the DDL with optional utilities.

As part of the JCL stream, dependent objects (index-dependent or table


space-dependent) are restored as part of the JCL stream. This includes unloading
and reloading of data, as well as certain optional utilities and rebinds of dependent
plans or packages.

Chapter 12. Changing DB2 objects 283


Related concepts
“Changing indexes” on page 280
Related tasks
“Altering an index” on page 280
Related reference
“Work data sets used by the DB2 Admin Alter Redefine function” on page 249

Redefining a partitioning index


Indexes defined for a table are classified as type 2, type P, or type D in the catalog
(SYSINDEXES.INDEXTYPE).

In DB2 Version 8, new index types are available.

The following classifications in the catalog (SYSINDEXES.INDEXTYPE) apply to


indexes defined for a table:
Type 2
An index on a non-partitioned table or on a partitioned table that uses
index-controlled partitioning.
Type P
Physically partitioned. Columns are a superset of table partitioning columns. A
type P index in DB2 Version 8 is a partitioning, partitioned index that contains
columns that are a superset of the partitioning columns of the table, matching
in name, order, and sequencing. Multiple partitioning indexes can exist for a
single table.
Type D
Physically partitioned. Columns are not a superset of table partitioning
columns. A type D index (referred to as a DPSI) is a partitioned index that
contains columns that are not a superset of the partitioning columns of the
table. Multiple DPSIs can exist for any given partitioned table.

Definitions: DB2 Version 8 introduces a distinction between the terms partitioned


and partitioning for describing indexes. Partitioned describes an index
that is physically partitioned into multiple data sets. Partitioning
describes an index that contains a superset of the partitioning
columns of the table. A partitioning index can be partitioned or
non-partitioned. One or many combinations of partitioned indexes
(partitioning or non-partitioning) can be defined for a table, in
addition to the traditional non-partitioned, secondary indexes.

To redefine a partitioning index:


1. Use the CONTINUE primary command on the Redefine Table Spaces panel
when the table space requires conversion to or from a partitioned table space.
The Redefine Partitioning Index panel is displayed, as shown in the following
figure.

284 User's Guide and Reference


DB2 Admin ----------------- DB2X Redefine Partitioning Index Row 1 to 4 of 4
Command ===> Scroll ===> CSR

Commands: CONTINUE ORIGINAL BALANCE VALUES

CREATE INDEX R148286 > . SPORT_NAME_IX > ON R148286 . SPORTS

Unique ===> Where Not Null ===> Cluster ===> N


Buffer pool ===> BP0 Close rule ===> NO Copy Allowed ===> NO
Piecesize ===> 2097152 Define ===> YES Defer ===>
Padded ===> YES
( Column List ) ===> Y

Primary Secondary Free Pct S


S Part Quantity Quantity Page Free Erase T VCAT Stogroup GBPCache
- ------ ---------- ---------- ---- ---- ----- - -------- -------> --------
Default 12 12 0 10 I DSN7 SYSDEFLT NONE
1 12 12 0 10 I DSN7 SYSDEFLT NONE
2 12 12 0 10 I DSN7 SYSDEFLT NONE
3
4
******************************* END OF DB2 DATA *******************************

Figure 189. Redefine Partitioning Index panel (ADB21SAX)

The following commands are available:


CONTINUE
After you update the attributes on the panel, you can continue the process
using this command. A panel for JCL parameters is displayed.
ORIGINAL
Restores all fields on the panel to their original values.
BALANCE
Distributes the total primary and secondary quantities equally among all
partitions. This command is available only for partitioning indexes.
VALUES
Displays the partitioning limit key values for an existing partitioning index.
2. Use the previous panel to create a partitioning index, to convert a clustering
index to or from a partitioning index, or to redefine the existing partitioning
index when partitions are added or removed.
Related concepts
“How the DB2 Admin Alter ALC function works” on page 272
“Changing indexes” on page 280

Work data sets used by the DB2 Admin Alter Redefine


function
When you redefine table spaces (or indexes), the DB2 Admin Redefine function
creates and uses one or more data sets.

The data sets that are created and used by the DB2 Admin Redefine function are
shown in the following table.
Table 15. Work data sets for DB2 Admin Redefine
Template
Default data set name Description keyword
prefix.worklist.CREBIND Rebind statements RDBIND

Chapter 12. Changing DB2 objects 285


Table 15. Work data sets for DB2 Admin Redefine (continued)
Template
Default data set name Description keyword
prefix.worklist.DDL DDL extracted from the catalog RDSQL
prefix.worklist.DDDL DDL to drop the original object RDDROP
prefix.worklist.DDL.MOD Modified DDL with the new table None1
space or index statements or both

prefix.worklist.CNTL.database. SYSPUNCH data set that is PUNCHDDN


tablespace.PT produced by the unload step

prefix.worklist.UNLD.database. SYSREC data set that is produced UNLDDN


tablespace.PT by the unload step

prefix.worklist.CNT.Tnnnn SYSPUNCH data set that is RDLOAD


produced by the unload step when
using High Performance Unload
(HPU), where Tnnnn is a string
assigned to the data set, with nnnn
beginning with 1
prefix.worklist.ULD.Tnnnn SYSREC data set that is produced RDUNLD
by the unload step when using
High Performance Unload (HPU),
where Tnnnn is a string assigned to
the data set, with nnnn beginning
with 1
prefix.worklist.UTRELD LOAD utility statements when RDUTRELD
building a WSL
prefix.worklist.UTCHK CHECK utility statements when RDUTCHK
building a WSL
prefix.worklist.UTRUNS RUNSTATS utility statements when RDUTRUNS
building a WSL
prefix.worklist.UTCOPY COPY utility statements when RDUTCOPY
building a WSL
prefix.worklist.UTUNLD REORG and REBUILD utility RDUTUNLD
statements when building a WSL
prefix.worklist.WDD File names to include when RDWDD
building a WSL
Note:
1. The data set name is derived from the data set pattern that is specified for RDSQL. The
data set name for RDSQL cannot be greater than 40 bytes.

286 User's Guide and Reference


Related concepts
“Utility Template panel” on page 228
“Changing indexes” on page 280
Related tasks
“Utility Template — Dataset Name panel” on page 231
“Creating naming conventions for work data sets that are created by the DB2
Admin Redefine function” on page 250
“Redefining an index” on page 282

Changing views
To make changes to a view, DB2 Admin generates a set of jobs that drop the view
and then re-create it.

Restriction: You cannot use an SQL ALTER statement to change a view.

To change a view:
1. Use the ALC line command on the Tables, Views, and Aliases panel (ADB21T).
Panel ADB27CAA might appear briefly while the definition of the view is being
retrieved. An SQL CREATE VIEW statement for the view is displayed in an
ISPF Edit Session.
2. Edit the CREATE VIEW statement to make the changes that you want and
press PF3. The Alter Tables panel (ADB27CA) is displayed. It shows an action
of DROP.
If you did not change the CREATE VIEW statement or did not save the
changes, the view either is not displayed on the Alter Tables panel or is
displayed with an action of NONE.
3. Enter the ALTER command to display the Alter Parameters panel

Complete Step 6 through Step 8 to generate and run the jobs that will change the
view.

Using authorization switching


Authorization switching is a facility within DB2 Admin to execute DDL under the
authority of another user.

This other user is termed the auth-switch ID, and the ID that submits the job is
termed the submitter.

The Alter Tablespace RDEF and Alter Table ALC functions make use of
authorization switching. These commands enable you to redefine a table space or a
table. Because this action also requires the object to be dropped, objects that are
dependent on the target object are also dropped. Authorizations to those objects
and dependent objects are lost.

DB2 Admin generates the DDL and DCL necessary to rebuild the altered objects
and to restore the dependent objects and authorities. However, the job submitter
might have authority to re-create the target objects, but not the authority to
re-create dependent objects or to grant authorities to the dependent objects. In this
case, you can enable a job submitter to use an ID that has the necessary authority
to execute the DDL to rebuild the objects.

Chapter 12. Changing DB2 objects 287


| The statements that are eligible to be run under the auth-switch ID depend on the
| authority that the job submitter has to the RACF profile that protects the resource.
| If the job submitter has READ authority, the authorization switching function
| follows these rules and protections:
| v Only certain DDL statements can be run using the auth-switch ID. DROP
| statements, for example, are always run using the submitter's authority.
| v Any DDL that has been manually added to the file or that has been edited can
| be run only under the submitter's authority.
| v COMMIT statements can be added where appropriate.
| v The DDL must be run within 8 days of being created.
| v If ineligible statements are encountered, DB2 Admin will switch out of the
| requesting auth-switch ID and back into the auth-switch ID when an eligible
| statement is encountered.

| If the job submitter has ALTER authority to the RACF profile that protects the
| resource, all DDL and DCL statements are run using the auth-switch ID. The rules
| and protection mechanisms for READ authority do not apply for ALTER authority.

| When authorization switching is enabled, the batch job panels for Alter Tablespace
| RDEF and Alter Table ALC have an additional input field called Authorization
| Switch ID . Use this field to enter the auth-switch ID to be used to run the eligible
| statements in the file that contains the DDL and DCL statements.

| The DDL that is generated by the batch jobs for these two functions is prepared for
| authorization switching; that is, it contains functional comments that other DB2
| Admin components use with authorization switching.

| If the special value <NONE> is specified in the Authorization Switch ID field, the
| DDL is not prepared to be used with authorization switching, but an authorized ID
| can run the DDL. For example, the authorized ID can run the DDL using
| ADBTEP2.

| If an authorization switch ID is specified, you must specify N in the As work


| statement list field. If an authorization switch ID is not specified, and you specify
| Y in As work statement list, the work statement list does not produce DDL that is
| capable of authorization switching.

Tip: Carefully preserve the original DDL file until the objects and dependencies
are restored. After the object is dropped, the ADB2GEN process cannot be
used to regenerate the original environment. Running the ADB2GEN step
again without proper care can overwrite the original DDL file, making
reconstruction difficult.

The batch program, ADBTEPA, runs the DDL, either under the authority of the
submitter or under the auth-switch ID authority. Two input parameters are
required for authorization switching. These parameters are specified one-per line
on the ADBOPT DD card in the ADBTEPA step.

Example
| //CREATE EXEC PGM=ADBTEPA,DYNAMNBR=100,
| // PARM='/SSID(DSN8),WORKLIST(TESTYA)'
| //STEPLIB DD DISP=SHR,DSN=ADB.V72.SADBLINK
| // DD DISP=SHR,DSN=DSN.DSN8.SDSNEXIT
| // DD DISP=SHR,DSN=DSN.DSN8.SDSNLOAD
| //SYSTSPRT DD SYSOUT=*
| //ADBPRINT DD SYSOUT=*

288 User's Guide and Reference


| //SYSPRINT DD SYSOUT=*
| //ADBOPT DD *
| PLAN=ADBTEPA
| AUTH_SWITCH_USERID=SYSADMZ1
| /*

The PLAN parameter is required by ADBTEPA, even when an auth-switch ID is


not provided on the batch job panels. The AUTH_SWITCH_USERID parameter is
generated, either as functional input when an ID is provided on the panel, or it is
a comment without a value. If DB2 Admin Authorization Switching is determined
to be necessary after the JCL is built, you can make the parameter active (remove
the comment) and specify a suitable auth-switch ID.

To use DB2 Admin Authorization Switching, the job submitter must have access to
the following two separate entities:
v The plan that is passed to program ADBTEPA using the ADBOPT parameter
PLAN
v A RACF profile that protects a special resource

Only certain DDL statements are executed using the authorization switch ID
authority. DROP statements, for example, are always executed using the
submitter's authority. Any DDL that has been manually added to the file or that
has been edited can be executed only under the submitter's authority. COMMIT
statements can be added where appropriate.

| Because the DDL contains SET CURRENT SQLID statements, the ID that runs the
| statement must have the intended SQLID as one of its secondary authorization
| IDs, or have SYSADM authority.

Tip: Provide the authorization switch ID with SYSADM authority to successfully


execute all statements within the DDL file, including the SET CURRENT
SQLID statements.
Related tasks
“Step 22. Tailor DB2 Admin Authorization Switching” on page 71
“Step 22. Tailor DB2 Admin Authorization Switching” on page 71
Related information
Chapter 15, “Using the Batch Restart programs: ADBTEP2 and ADBTEPA,” on
page 339

| Implicit LOB and XML table support


| The DB2 Admin ALC, RENDB, RDEF, and MIG functions and DB2 Object
| Comparison Tool support changes to implicit LOB and XML table spaces.

| The DB2 Admin ALC, RENDB, RDEF, and MIG functions and DB2 Object
| Comparison Tool generate multiple image copies when there are implicit LOB or
| XML table spaces defined for the tables. Generating multiple image copies requires
| that either a SYSCOPY TEMPLATE is defined and used for the operations, or that
| the default is used. If no template is provided, this default is used:
| DSN(&US..&SSID..&DB..&SN..&UQ)

| For clones, this default is used:


| DSN(&US..&SSID..&DB..&SN..CLONE.&UQ)

|
Chapter 12. Changing DB2 objects 289
290 User's Guide and Reference
Chapter 13. Migrating DB2 objects, data, and catalog statistics
DB2 Admin enables you to migrate (or copy) DB2 object definitions, the data for
the objects, and the catalog statistics for the objects from one DB2 subsystem to
other DB2 subsystems.

You can migrate any combination of this set of information (object definitions,
data, and statistics) for DB2 databases, table spaces, and tables, as well as their
dependent objects.

When you migrate information, DB2 Admin attempts to preserve as many of the
dependent definitions as possible, such as indexes, views, table checks, synonyms,
aliases, and authorizations to these objects.

Typically, the migrate function is used to perform the following tasks:


v Create a separate DB2 test system
v Move a test system into a production system
v Move statistics from a production system to a development (or test system) to
test new and modified programs with the statistics from the production system.
v Consolidate two separate database systems into one

The following five steps summarize the process of using the DB2 Admin Migrate
function:
1. Specify the information that you want to migrate. You can migrate object
definitions, the data in the objects, the catalog statistics for the objects, or any
combination there of.
When you specify to migrate catalog statistics, INSERT, UPDATE, and DELETE
statements that will modify the catalog statistics are generated. The statements
are generated with the qualifier of the target catalog that you specify, and the
statistic fields that are generated are those that are associated with the objects
that are being migrated. (The complete list of statistics fields are those fields
that are set by RUNSTATS that can be modified and the five statistics columns
for table functions in SYSROUTINES, which are not set by RUNSTATS.)
2. Generate batch jobs.
| You can choose to have the migrate batch jobs generated online or in batch.
3. Run the batch jobs.
4. Optional: Transfer the jobs and data to the target system.
You perform this step only when the node names for the source and target
systems are different.
5. Run batch define and reload jobs and other optional jobs.

Each of these steps is described in detail later in this chapter.

In the event that one or more SQL statements fails when you are running a
migrate job, you can use the Batch Restart program (ADBTEP2) to restart or
resume the job at an intermediate point. In addition, you can combine the
generated migrate batch jobs into fewer jobs.

Restrictions: The following restrictions apply to migrating DB2 object definitions,


data, and catalog statistics:

© Copyright IBM Corp. 1995, 2010 291


v When a schema exists that is associated with a database, you must
migrate the database structure and the schema separately.
v Databases without table spaces are not migrated. DB2 Admin
issues a warning message that no rows are returned.
v For table spaces (or tables within these table spaces that are
created with the DEFINE NO option or for table spaces that are
empty, you can migrate only the schema definitions (DDL). JCL or
statements to unload the data are not created during migration.
| v When migrating at the table level and migrating a table that has a
| LOB column, and the migrate option DROP on target before create is
| set to Yes, the base table will be dropped and DB2 will also drop
| any LOB auxiliary tables. Neither DB2 nor migrate will drop the
| LOB table space if they were explicitly defined and associated with
| each LOB auxiliary table. The user must drop the LOB table
| spaces.
v If you migrate the catalog statistics for the objects, the statistics for
materialized query tables are not included.

Topics:
“Step 1. Specify the objects to migrate information” on page 293
v
“Step 2. Generate batch jobs” on page 295
v
“Step 3. Run the batch jobs” on page 298
v
“Step 4. Optional: Transfer the jobs/work statement list and data to the
v
target system” on page 299
v “Step 5. Run the batch define, reload, and optional jobs” on page 299
v “Work data sets used by the DB2 Admin Migrate function” on page 300
Related reference
“Option T. Tables, Views, and Aliases” on page 594
Related information
Chapter 15, “Using the Batch Restart programs: ADBTEP2 and ADBTEPA,” on
page 339
IBM Publications Center

292 User's Guide and Reference


Step 1. Specify the objects to migrate information
To begin migrating DB2 object definitions, the data for the objects, and the catalog
statistics, first specify the objects to migrate information.

To specify the objects to migrate information:


1. Display the panel related to the type of object for which you want to migrate
the object definition, data, or catalog statistics.
v If you are migrating a database, display the Databases panel (option 1.D).
v If you are migrating a table space, display the Table Spaces panel (option
1.S).
v If you are migrating a table, view, or an alias, display the Tables, Views, and
Aliases panel (option 1.T).
2. Issue the MIG line command against the objects to be migrated. The following
figure shows an example MIG command being issued against a database.

DB2 Admin ------------------- DB2X Databases ---------------------- Row 1 of 4


Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool
* * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - -----------
DSN8D81A DSCGDB2 DSN8G810 BP0 258 ISTJE E BP2
DSN8D81E DSCGDB2 DSN8G810 BP1 260 ISTJE U BP2
DSN8D81P DSCGDB2 DSN8G810 BP0 259 ISTJE E BP2
MIG DSN8D81U DSCGDB2 DSN8G81U BP1 261 ISTJE E BP2
******************************* END OF DB2 DATA *******************************

Figure 190. Databases panel (ADB21D) - migrate example

After you press Enter, DB2 Admin displays the Migrate Table Spaces panel
(ADB28S) so that you can choose whether to migrate all table spaces within
that database. Use the D line command to omit table spaces from this list. You
can also add additional databases to the list by using the ADD primary
command. Follow the instructions on panels ADB28AD and ADB28ADD to add
databases. On panel ADB28ADD, issue the S line command to select additional
databases to be migrated.
When you issue the MIG line command on a table space, DB2 Admin displays
the Migrate Table Spaces panel, where you can view the size of the table spaces
and the number of referential constraints. The following figure shows an
example MIG line command being issued against a table space.

Chapter 13. Migrating DB2 objects, data, and catalog statistics 293
| DB2 Admin ------------------- DB8A Migrate Table Spaces ------ Row 1 to 2 of 2
| Command ===> Scroll ===> PAGE
|
| Commands: MIG - Generate jobs ADD - Add table spaces
| MIGRI - Add all RI related table spaces
| Line commands:
| D - Delete T - Show tables ADDRI - Add RI related table spaces
| RIT - Show RI related tables
|
| Data Table No of Table RI VSAM
| Select Base Space Part Tables LOB Relations Added KB Used
| * * * * * * * *
| ------ -------- -------- ------ ------ --- ----------- ----- -----------
| DSN8D81U NEWDEPT 0 1 NO 6 NO 48
| DSN8D81U NEWPHONE 0 1 NO 6 NO 48
|
|
| Figure 191. Table Spaces panel (ADB28S) - migrate table spaces example
|
For table spaces, you can use the ADD primary command to add more table
spaces to be migrated. Follow the instructions on panels ADB28AS and
ADB28ASD. On panel ADB28ASD, issue the S line command to select
additional table spaces to be migrated.

| Tip: The DB2 Admin migrate setting, which you can set on the Change
| Migrate Settings panel (ADB28MS), controls whether the space
| information is gathered and displayed. By default, the value of the setting
| is YES. If the value is NO, the space information is not gathered and is not
| displayed, and the VSAM KB Used column is hidden. A SPACE line
| command is displayed on the panel instead, and you can issue the
| command to display the space information if needed. Collecting and
| displaying the space information only when needed can reduce the time
| that is needed to process the MIG command.
When you issue the MIG line command on a table, DB2 Admin displays the
Migrate Tables panel. The following figure shows an example of migrating a
table.

DB2 Admin ------------------- DB2X Migrate Tables ----------------- Row 1 of 2


Command ===> Scroll ===> PAGE

Commands: MIG - Generate jobs ADD - Add tables


MIGRI - Add all RI related tables
Line commands:
D - Delete ADDRI - Add RI related tables RIT - Show RI related tables

Table RI
Select Name Owner DB Name TS Name LOB Relations Added
* * * * * * *
------ ------------------ -------- -------- -------- --- ----------- -----
EMP DSN8610 DSN8D61A DSN8S61E NO 4 NO
******************************* END OF DB2 DATA *******************************

Figure 192. Migrate Tables panel (ADB28T) - migrate table example

For tables, you can use the ADD primary command to add more tables to be
migrated. Follow the instructions on panels ADB28AT and ADB28ATD. On
panel ADB28ATD, issue the S line command to select additional tables to be
migrated.
The DB2 Admin migrate panels provide the following primary commands that
you can issue:
MIG Migrates the objects in the list.

294 User's Guide and Reference


MIGRI
Adds all RI-related objects to the list of objects to be migrated. For any
tables related to other tables in any table space in the list, the MIGRI
command adds the table spaces that contain these related tables. When
adding a table space to the list, DB2 Admin adds to the list any other
table space that contains a table related to the table space that was
added.
If you issue the MIGRI command for databases, only the related table
spaces for those databases are migrated. The databases that contain
these additional related table spaces are not migrated.
ADD Adds additional objects to the list of objects to be migrated. If
migrating a database, the objects are databases and all table spaces of
the databases that are added. DDL is generated for the databases that
are added. If migrating a table space, the objects are table spaces, and
only table spaces are added to the list.
When you issue the MIG line command on a table, DB2 Admin displays the
Migrate Tables panel. The DB2 Admin Migrate panels provide the following
line commands:
D Deletes objects from the list to be migrated
T If migrating a table space, this command shows the tables contained
within the table space
ADDRI
If migrating a table space, this command adds table spaces that contain
either a parent table or a child table to the list of objects to be migrated.
If migrating a table, this command adds related table (parent tables and
child tables) to the list of objects to be migrated.
RIT Displays RI-related tables.
3. Select the objects that you want to migrate.
Related tasks
“Changing migrate settings” on page 129
Related information
Chapter 21, “Using masks,” on page 503

Step 2. Generate batch jobs


After you have specified the objects to migrate information, generate batch jobs.

Add the objects that you want migrated to the list.

To generate batch jobs:


1. Issue the MIG primary command to start generating jobs for the migration. The
Migrate Parameters panel is displayed, as shown in the following figure.

Chapter 13. Migrating DB2 objects, data, and catalog statistics 295
| DB2 Admin ------------------- DSN7 Migrate Parameters ------------------- 12:03
| Option ===>
|
| Please specify the following for DB2 Admin Migrate: DB2 System: DB2X
| DB2 SQL ID: ISTJE
| More: +
| Worklist name . . . . . . . : (also used as middle qualifier in DSNs)
|
| Data set information:
| PDS for jobs . . . . . . : MYMIGR.JCL
| Prefix for datasets . . . : ISTJE
|
| Target system parameters:
| DB2 subsystem id (SSID) . : DB2X DB2 release . . . . .: 810
| Target system node name . : Submit job at local .: NO (Yes/No)
| DB2 load library . . . . : SYS1.DSNDB2X.SDSNLOAD
| DB2 sample pgm load lib . : DB2.DSN810.RUNLIB.LOAD
| New TS storage group . . : > New IX storage group : >
| New database . . . . . . : New owner of objects : >
| New grantor . . . . . . . : >
| Catalog qualifier . . . . : > (default SYSIBM , only applicable
| when scope contains catalog stats.)
| Migrate options:
| Generate MIG jobs in batch . . . : N (Yes/No)
| Generate work stmt list . . . . . : N (Yes/No)
| Use masking for batch migrate . . : N (Yes/No, N if stmt list is Y)
| Combine job steps . . . . . . . . : Y (Yes/No, Yes if HPU is Yes)
| Member prefix for combined jobs : ADBMG (default ADBMG)
| Scope of migrate:
| DDL . . . . . . . . . . . . . . : Y (Yes/No)
| Data . . . . . . . . . . . . . : Y (Yes/No)
| Catalog statistics . . . . . . : N (Yes/No)
| DROP on target before CREATE . . : N (Yes/No,No if scp. is data only)
| Generate GRANT statements . . . . : N (Yes/No)
| Create storage group . . . . . . : N (Yes/No)
| Run SQLID . . . . . . . . . . . . : (Blank, a SQLID, or <NONE>)
| Unload method . . . . . . . . . . : U (U - Unload, H - HPU)
| Parallel utilities. . . . . . . . : Y (Yes/No)
|
| Optional steps after reload:
| Run CHECK DATA . . . . . . . . . : N (Yes/No)
| Run RUNSTATS . . . . . . . . . . : N (Yes/No)
| Run IMAGE COPY . . . . . . . . . : N (Yes/No)
| Run REBIND . . . . . . . . . . . : N (Yes/No)
|
| Utility control options:
| Generate template statements . . : NO (Yes/No)
| Use customized utility options . : (Yes/No)
|
| BP - Change batch job parameters
| TU - Specify template usage
| UO - Customized utility options
||
| Figure 193. Migrate Parameters panel (ADB28M)
|
2. Specify the following information on the Migrate Parameters panel:
v The PDS where the generated jobs are to be stored
v Data set information
v Target system parameters
v Migrate options
v Optional jobs to be run after the reload
v Utility control options
Refer to the online help for detailed information about the fields in the panel.
| If you specify to have the migrate jobs generated in batch, DB2 Admin creates a
| work data set (MIGVARS) that stores the parameter information specified on
| the panel and the necessary ISPF tables to use as input for the generation of the
| migrate source and target JCL. Similar to the other migrate work data sets that

296 User's Guide and Reference


| are used, you can use the Prefix for datasets field and the Worklist name field
| to change the default qualifier values that are used for the MIGVAR data set.
If you choose Unload as the unload method and parallel utility processing and
do not provide your own UNLDDN template, the default template ASYREC6
with variable &PART or &PA in the ADB2UCUS skeleton is used as the
template for the unload data set. When &PART or &PA is specified, DB2
Admin replaces the variable with 00001 up to the maximum partition number
of the associated object. The total length of the values for &PREFIX and
&LEVEL must not exceed 12 bytes.

Note: The CHECK, RUNSTATS, and COPY requests are not generated for
implicitly created table spaces.

| The REBIND option generates rebinds of the source packages for the
| target system.

Restriction: If you specify Yes for the DROP on target before CREATE field,
any RESTRICT ON DROP conditions for tables are not considered.
If a table has RESTRICT ON DROP, you will need to remove it for
the DROP statement to complete successfully.
3. Press Enter. DB2 Admin starts to generate the jobs required for migration.
The panels that are displayed and the action to take next depends on whether
you chose to generate the migrate jobs online or in batch.
4. Specify whether to generate the migrate jobs online or in batch.
v If you choose to generate the migrate jobs online, review the messages that
are displayed in the Migrate Progress pop-up panel. These messages provide
information about the status of building the jobs.
When DB2 Admin finishes generating the jobs, it invokes an ISPF Edit
session. An example of this edit screen is shown in the following figure.
Press F3 to exit the edit session.

Menu Functions Utilities Help


------------------------------------------------------------------------------
EDIT ISTJE.MIGDSN85.JCL Row 00001 of 00011
Command ===> Scroll ===> PAGE
Name Prompt Size Created Changed ID
. SST1RE 60 2007/11/25 2007/11/25 00:55:00 ISTJE
. SST2UL1 64 2007/11/25 2007/11/25 00:55:00 ISTJE
. SST3CH 34 2007/11/25 2007/11/25 00:55:00 ISTJE
. SST4XF 19 2007/11/25 2007/11/25 00:55:00 ISTJE
. SST5DE 29 2007/11/25 2007/11/25 00:55:00 ISTJE
. TST1CR 23 2007/11/25 2007/11/25 00:55:00 ISTJE
. TST2RL 96 2007/11/25 2007/11/25 00:55:00 ISTJE
. TST3CK 35 2007/11/25 2007/11/25 00:55:00 ISTJE
. TST4RS1 23 2007/11/25 2007/11/25 00:55:00 ISTJE
. TST5IC 58 2007/11/25 2001/11/25 00:55:00 ISTJE
. TST7DE 29 2007/11/25 2007/11/25 00:55:00 ISTJE
**End**

Figure 194. Sample migrate edit panel

v If you choose to generate the migrate jobs in batch, submit the job that is
displayed in the ISPF Edit session that is invoked. This batch job generates
the jobs that are required for migration.
The member name for the batch job is either
– <Member prefix for combined jobs>.S0, if you chose to combine the job
steps
– SST0BAT, if you chose not to combine the job steps

Chapter 13. Migrating DB2 objects, data, and catalog statistics 297
An example of the edit screen is shown in the following figure.

| Menu Functions Utilities Help


| ------------------------------------------------------------------------------
| EDIT ISTJE.MIGDSN85.JCL Row 00001 of 00011
| Command ===> Scroll ===> PAGE
| Name Prompt Size Created Changed ID
| . ADBGS0 83 2007/11/25 2007/11/25 00:55:00 ISTJE
| **End**
|
|
| Figure 195. Sample of job edit panel for generating the migrate jobs in batch
|
You are ready to review, edit, and run the generated migrate jobs.

Step 3. Run the batch jobs


After you have generated the batch jobs, you can run them.

To run the batch jobs:


1. Review the following source system jobs and submit them in the sequence
shown.
a. SST1RE - Performs reverse engineering
b. SST2ULn - Unloads data; n is an integer. If you are migrating many table
spaces, multiple unload jobs might be created.
c. SST3CH - Changes unload control data sets
2. Run the batch jobs.
v If you combined the job steps, these jobs are located in the group xxxxS1.
Run the first group having the name of xxxxS1 on the source system.
v If you specified the current system node name as the name of the target
system node name, the source and target systems are the same. You will run
all the generated jobs on the same system. You will skip Step 4 to transfer
the batch jobs that begin with T (or group xxxxT1 if you combined the job
steps) to the target system.
v If you request that a work statement list be generated and are running in
local mode (that is, not connected to a remote subsystem), run the xxxSn job
in sequence to extract the DDL, unload the data, change the load control
statements, and write the work statement list.
v If you are running in DRDA® mode (that is, connected to a remote system),
run the xxxSn job first to unload the data on the remote (source) system.
After the xxxSn jobs are complete and the data sets contain the unloaded
data and the load control statements are transferred from the remote system
to the local system, run the xxxLn job to extract the DDL, change the load
control statements, and write the work statement list.
Usually, only one xxxSn job exists to unload the data. However, if many table
spaces require unloading, multiple xxxSn jobs are generated. The final xxxSn
job on the remote system specifies the data set names that need to be
transferred to the local system for creating the work statement list. The n in
the xxxLn job is one greater than the n in the last xxxSn job.

298 User's Guide and Reference


Related concepts
Chapter 24, “Running DB2 Admin across distributed systems,” on page 539
Related reference
“Work data sets used by the DB2 Admin Migrate function” on page 300

Step 4. Optional: Transfer the jobs/work statement list and data to the
target system
After you have run the batch jobs, perform this step only if the source and target
systems are different; that is, the node names for the source and target systems are
not the same.

If the source and target database systems are on separate machines, it might be
necessary to transfer the information electronically or by using a portable medium,
such as a tape.

To transfer the jobs/work statement list and data to the target system:

Run the following jobs in the sequence shown:


v SST4XF - Information about the data sets that needs to be transferred
v SST5DE - Delete data sets on source system

If you combined job steps, these jobs are located in the group xxxxSE. Run the
second group having the name of xxxxSE on the source system after all jobs in the
first group are complete.

If your source and target DB2 subsystems are on the same machine, do not run the
delete data sets on the source system job (SST5DE or xxxxSE) until you run all of
the jobs for the target system.

If you request that a work statement list be generated, the job name xxxSE is used
(when not connected to a remote system). Otherwise, the name xxxLE is used. This
job specifies the data set names with the work statement list that is required to be
transferred to the target system, along with a job step to delete the data sets. Do
not run the step to delete the data sets if you are using the work statement list.

Step 5. Run the batch define, reload, and optional jobs


After you have run the batch jobs or transferred the jobs/work statement list and
data to the target system, run the batch define, reload, and optional jobs.

To run the batch define, reload, and optional jobs:

Review the following target system jobs and submit them in the following
sequence:
1. TST1CR - Creates objects and changes the catalog statistics (updates, inserts,
and deletes) on target system.
2. TST2RLn - Reloads data; n is an integer. If many table spaces are being
reloaded, multiple reload jobs can be created.
3. TST3CK - Performs CHECK DATA (optional).
4. TST4RS - Runs RUNSTATSs (optional).
5. TST5IC - Performs an image copy (optional).
6. TST6RB - Rebinds (optional).

Chapter 13. Migrating DB2 objects, data, and catalog statistics 299
7. TST7DE - Deletes data sets on target system.

If you combined job steps, these jobs are located in the group xxxxT1. Run group
xxxxT1 on the target system. If you performed “Step 4. Optional: Transfer the
jobs/work statement list and data to the target system” on page 299 to transfer the
jobs and data to the target system, ensure that all the jobs from group xxxxSE are
complete before running group xxxxT1.

If you specified the current system node name as the name of the target system
node name, the source and target systems are the same. Therefore, you will run
these jobs for Step 5 on the same system as the jobs that you ran for the source
system in “Step 3. Run the batch jobs” on page 298.

Work data sets used by the DB2 Admin Migrate function


The DB2 Admin Migrate function creates and uses data sets.

The following figure shows the data sets that the DB2 Admin Migrate function
creates and uses.
Table 16. Work data sets for DB2 Admin Migrate
Template
Default data set name Description keyword
prefix.worklist.DDL DDL and DML that is constructed from MISQL
the catalog
prefix.worklist.DDDL DROP statements for drop objects MISDROP
prefix.worklist.COL Identity column information MICOL
prefix.worklist.CMD Rebind output MIGCMD
| prefix.worklist.MIGVARS Partitioned data set for ISPF tables that are MIGSHVR
| required for generating the MIG jobs in
| batch
prefix.worklist.ADB28W1U Work statement list data set MIUCONV
prefix.worklist.ADB28W3U Work statement list data set MIUOTHR
prefix.worklist.ADB28WDD Work statement list elements MI2WDD
prefix.worklist.ADB28W2T Input data set for the merge program MIMLSIN
prefix.worklist.ADB28W2U Intermediate data set used by the merge MIMLSOT
program

The DB2 Admin Migrate function also uses data sets for the unloaded data, load
control statements, and converted load control statements. The naming convention
for the data sets differ depending on whether the DB2 UNLOAD utility or DB2
High Performance Unload (HPU) is used to unload the data.

The following figure shows the data sets for migrations with DB2 UNLOAD.
Table 17. Work data sets for DB2 Admin Migrate with DB2 UNLOAD
Template
Default data set name Description keyword
prefix.worklist.CNT.Sn Load utility control statements, where Sn PUNCHDDN1
is a string assigned to the object by DB2
Admin, with n beginning with 1

300 User's Guide and Reference


Table 17. Work data sets for DB2 Admin Migrate with DB2 UNLOAD (continued)
Template
Default data set name Description keyword
prefix.worklist.ULD Data sets for unloaded data UNLDDN2
prefix.worklist.CNC.Sn Converted load utility control statements, MICTLOV (for
where Sn is a string assigned to the object table spaces
by DB2 Admin, with n beginning with 1
MICTLOU (for
tables)
Note:
1. A utility template. A template statement is not generated in the JCL. DB2 Admin uses
the utility template to generate regular JCL to perform the unload.
2. A utility template. A template statement is generated in the JCL. When you use your
own copy of utility template UNLDDN, DB2 Admin does not delete any of the data sets
that are created by the template after they are used. You must delete them. Also, the
transfer data set list in jobs SST4XF and xxxxSE do not include the data set names, and
you must transfer them.

Image copy uses the regular utility template.

The following figure shows the data sets for migration with HPU.
Table 18. Work data sets for DB2 Admin Migrate with HPU
Template
Default data set name Description keyword
prefix.worklist.CNT.Tn Load utility control statements, where Tn MICTLIU
is a string assigned to the object by DB2
Admin, with n beginning with 1
prefix.worklist.ULD.Tn Unload data sets for a non-partitioned MIDTVNP
object, where Tn is a string assigned to the
object by DB2 Admin, with n beginning
with 1
prefix.worklist.ULD.Tn.Pm Unload data sets for a partitioned object, MIDATVP
where Tn is a string assigned to the object
by DB2 Admin, with n beginning with 1,
and Pm is a string that identifies the
object's partition number, with m
beginning with 0001
prefix.worklist.CNC.Tn Converted load utility control statements, MICTLOU
where Tn is a string assigned to the object
by DB2 Admin, with n beginning with 1

The relationship between the table name and Tn and the relationship between the
table space name and the Sn are listed as comments in the front part of the
generated job or work statement list.

DB2 Admin Migrate deletes these data sets when they are no longer needed.

Chapter 13. Migrating DB2 objects, data, and catalog statistics 301
Related concepts
“Utility Template panel” on page 228
Related tasks
“Utility Template — Dataset Name panel” on page 231
“Step 3. Run the batch jobs” on page 298

Creating naming conventions for work data sets that are


created by the DB2 Migrate function
You can use templates to create your own naming conventions for the work data
sets that are created by the DB2 Admin Migrate function.

To use templates to create naming conventions for the work data sets that are
created by the DB2 Admin Migrate function:
1. Specify YES in the Generate template statements field on the Migrate
Parameters panel.
2. Use the TU primary command on the Migrate Parameters panel (or Option 5
on the Administration Menu panel) to manage the templates for the work data
sets. You can use the TU primary command on the Alter Tablespace Redefine -
JCL panel (or Option 5 on the Administration Menu panel) to manage the
templates for the work data sets.
The valid variables that can be specified when constructing the data set name
pattern for a template for a migrate work data set include:
v The following functional variables:

| &ADB28PRE.
| Prefix for data sets specified on the Migrate Parameters panel
| (ADB28M)
&DB2SYS.
The DB2 subsystem id
&WORKLIST.
Worklist name specified on the Migrate Parameters panel (ADB28M)
v The following variables that are supported for normal DB2 utility template
processing:

&DB. Database name


&TS. Table space name
&PART.
The value is ALL with these exceptions:
– For template UNLDDN, DB2 z/OS resolves the variable to a
5-byte string (nnnnn) that represents the partition number. For a
non-partitioned object, the value of the string is '00000'. For a
partitioned object, the value of the string is '00001', '00002', and so
on.
– For template MIDATVP with parallel processing specified, DB2
Admin resolves the variable to a 4-byte string (nnnn) that
represents the partition number. The value of the string is '0001',
'0002', and so on.
&USERID.
Batch user ID
&DATE.
YYYYDD
&TIME.
HHMMSS

302 User's Guide and Reference


&JDATE.
YYYYDDD
&YEAR.
YYYY
&MONTH.
MM
&DAY.
DD
&JDAY.
DDD
&HOUR.
HH
&MINUTE.
MM
&SECOND.
SS
This list of variables is a subset of the variables that are supported for
normal DB2 utility template processing. The other variables tht are supported
for normal DB2 utility processing are not valid.
This list of variables is a subset of the variables that are supported for normal
DB2 utility template processing. The other variables that are supported for
normal DB2 utility processing are not valid.

Restriction: The following restrictions apply when specifying variables:


v For the data set names to which DB2 Admin appends Sn, Tn or
Tn.Pmmmm , the number n starts with 1 and ends with the
number of objects that you want to migrate. The total length of
a data set name should not exceed 44 bytes
v The only variables that can be specified for UNLDDN (used
when using DB2 UNLOAD) are &DB., &TS., &USERID., and
&PART..
A work list name can be a very important part of the data set
name when migrating objects. To specify a work list name as
part of UNLDDN template data set name to maintain a
consistent naming convention with other data set names,
explicitly specify a value in the template instead of using the
variable &WORKLIST, which cannot be specified.
v The only variables that can be specified for MIDTVNP and
MIDATVP (used when using HPU) are &DB., &TS., &USERID.,
&WORKLIST., and &PART.. If you specify &PART. for
MIDATVP, you must specify it as the last part of the name (for
example, &USERID..&TS..ULDULD.P&PART.); otherwise,
parallelism will not be performed.
Related information
IBM Publications Center

Chapter 13. Migrating DB2 objects, data, and catalog statistics 303
304 User's Guide and Reference
Chapter 14. Using work statement lists
DB2 Admin work statement lists (WSLs) allow you to create and maintain a set of
operations that you can run online or in batch mode.

You can run the entire set of operations, rerun sets of operations or capture a set of
operations that are created on one subsystem and use those operations on another
subsystem.

Topics:
v “Work statement lists” on page 306
v “Managing work statement lists” on page 310
v “Sample scenario for creating and using a work statement list” on page
323
v “Running WSL with the utility template for LOBs” on page 329
v “Running WSL with the utility template for unloading XML data” on
page 330
v “Using DB2 High Performance Unload within a work statement list” on
page 332
v “Creating work statement lists manually” on page 334
Related concepts
“DB2 Administration Menu panel” on page 97
Related tasks
“Renaming a database” on page 241

© Copyright IBM Corp. 1995, 2010 305


Work statement lists
A work statement list, or WSL, is a collection of one or more tasks that perform
basic operations.

In general, the statements in a WSL are standard statements or commands that you
would normally code to perform a task. Entries in a WSL can include items in any
of the following categories:
v SQL statements:
– Data definitions, such as CREATE, DROP, ALTER, and RENAME
– Authorization changes, such as GRANT and REVOKE
– Data manipulation changes, such as INSERT, UPDATE, and DELETE
v DSN commands: such as BIND, REBIND, FREE, and RUN
v DB2 commands: such as START, STOP, ALTER, and SET
v Utilities statements
v REXX and CLIST statements
v DB2 Admin instructions, which follow a product-specific syntax for performing
certain complex operations.

Creating work statement lists


You can create WSLs in several different ways.

You can create WSLs in one of the following ways:


v By using DB2 Admin basic functions: definition SQL, authorization SQL, update
SQL, DSN commands, and DB2 commands
v By using output from the DB2 Admin Reverse Engineering function
v By using the DB2 Admin Alter Table Columns function
v By using DB2 Object Comparison Tool Version 7 Apply tasks
v By using one of the DB2 Admin utilities panels
v By coding a WSL manually
v By cloning an existing WSL member

Using DB2 Admin basic functions to create WSLs


You can use DB2 Admin basic functions to create WSLs

To create WSLs using the following DB2 Admin basic functions, activate prompting
using the PROMPT primary command. REXX and CLIST statements are not
activated via PROMPT. There is no comparable method.
v Definition SQL (CREATE, DROP, ALTER, and RENAME)
v Authorization SQL (GRANT and REVOKE)
v Update SQL (INSERT, UPDATE, and DELETE)
v DSN commands (BIND, REBIND, FREE, and RUN)
v DB2 commands (START, STOP, ALTER, and SET)
v REXX and CLIST statements

Recommendation: Use the PROMPT Options panel to activate the Prompt facility.
The Prompt facility allows you, on a statement type level, to
specify whether prompting is active for the statement type.

306 User's Guide and Reference


Once activated, you are prompted before DB2 attempts to
execute the statement type. When prompted, you can choose to
do one of the following:
v Execute the statement.
v Edit the statement.
v Create a batch job with the statement.
v Add the statement to a WSL. Specify the WSL library and
member name.
Related concepts
“Changing DB2 Admin prompt options” on page 127

Using Reverse Engineering to create WSLs


You can create a WSL with Reverse Engineering using either the GEN line
command (or primary command) or the DDL line command.

Directing the output of the GEN command to a WSL:

To direct the output of the GEN command to a WSL:


1. On the ADB2GEN panel, specify a Y in the Add to work stmt list field.
2. Specify the WSL library and member name when you are prompted.

If the WSL name already exists, you can choose to add the GEN output to the end
of the current contents of that WSL or to replace the current contents of the WSL
with the GEN output.

Directing the output of DDL to a WSL:

To direct the output of DDL to a WSL:


1. Set PROMPT ON.
2. Specify Y in theExecute the generated SQL field.
3. Press PF3 or the End key.
4. Select option 4 to add the statement to the work statement list.

Using DB2 Admin Alter table columns to create WSLs


The DB2 Admin Alter (ALC) panel is used to specify the names and options for
DB2 Admin Alter.

On this panel, you can elect to use a WSL.

After entering information in the fields, you are prompted to specify the WSL
library and member name. If the WSL name already exists, you can choose to add
the ALC output to the end of the current contents of that WSL or to replace the
current contents of the WSL with the ALC output. The next panel displays the JCL
that you must run to populate the WSL.

Using DB2 Object Comparison Tool Apply tasks to create WSLs


If you use DB2 Object Comparison Tool, you can use the Generate Compare Jobs
panel (option 5 on the DB2 Object Comparison Tool menu) to add Apply tasks to a
WSL.

After entering information in the fields, you are prompted to specify the WSL
library and member name. If the WSL name already exists, you can choose to add

Chapter 14. Using work statement lists 307


the Apply tasks to the end of the current contents of that WSL or to replace the
current contents of the WSL with the Apply tasks. The next panel displays the JCL
that you must run to populate the WSL.

Using the DB2 Admin Utilities panels to create WSLs


You can use the DB2 Admin Utilities panels to create WSLs by specifying that
utility statements be placed into a WSL and specifying the WSL library and
member name.

On the following panels, you can specify that utility statements be placed into a
WSL:
v Table Utilities panel (ADB2UT)
v Table Space Utilities panel (ADB2US)
v Index Utilities panel (ADB2UX)
v Storage Group Utilities panel (ADB2UG)
v Create Index Utilities panel (ADB26CXU)
v LISTDEF panel (ADB25LU)

After entering information in the fields, you are prompted to specify the WSL
library and member name. If the WSL name already exists, you can choose to add
the utility statements to the end of the current contents of that WSL or to replace
the current contents of the WSL with the utility statements.

Coding a WSL manually


You can edit a WSL to enter work statements directly.

The following statement types can be added to a WSL:


v Comment statements
v Definition SQL statements
v Authorization SQL statements
v Update SQL statements
v DB2 commands
v DSN commands
v DB2 utility statements
v DB2 Admin statements
v REXX and CLIST statements
Related information
“Creating work statement lists manually” on page 334

Using delimited identifiers when creating work statement lists


When creating WSLs, you can use quotation marks with delimited identifiers in a
statement.

If you clone a WSL that includes a statement containing delimited identifiers, DB2
Admin removes the quotation marks from the identifier if it does not require
delimiters.

A WSL contains the following DDL:


DDL CREATE SYNONYM "PROJSYN" FOR "DBA282"."PROJ"

The cloned result does not contain the quotation marks:

308 User's Guide and Reference


COM -- Created by DBA282 on 2002/07/23 at 15:23 by cloning of
COM -- source work stmt list RESULT from library WSL.DATA
DDL CREATE SYNONYM PROJSYN FOR DBA282.PROJ

Where work statement lists are stored


Work statement lists are stored in ISPF tables in a data set that you specify.

They can be accessed by other users and are protected by RACF. By storing WSLs
in ISPF tables, they can easily be moved to other systems or installations. A WSL
can be created on one system and changed or executed on another system. The
following scenarios are possible:
v Local use only: Generate the WSL on subsystem DB2-1. Clone the WSL many
times with different owners and names for the objects. Execute the WSL on
DB2-1.
v Local customization and remote execution: Generate the WSL on subsystem
DB2-1. Clone the WSL many times with different owners and names for the
objects. Send the WSL to subsystem DB2-2. Execute the WSL on DB2-2.
v Remote customization and execution: Generate the WSL on subsystem DB2-1.
Send the WSL to DB2-2. Clone the WSL many times with different owners and
names for the objects. Execute the WSL on DB2-2.

Restriction: Do not use the DDL line command to generate the SQL for a specific
WSL. You can manually edit an existing WSL using the specified
option provided on the WSL panel.

How running a work statement list works


You run a WSL by entering a line command on the Work Statement Library List
panel (ADB2W1).

| You can run a WSL either in batch (the R line command) or online (the O line
| command).

When you use the R line command to run a WSL in batch, one or more jobs are
created. Each job includes a step to run the Batch Restart Program ADBTEP2 and
the job's set of input instructions (batch statement list) for ADBTEP2.

| When you use the O line command to run a WSL online, ADBTEP2 is run online
| and all input instructions are processed sequentially.

When you run a WSL in batch, DB2 Admin generates multiple jobs when it
encounters the PARALLEL command in the WSL. DB2 Admin generates the
following job names:
<prefix><m><seqnumber>
<prefix>
A specified prefix. The prefix can be from 4 to 6 characters, depending on
the number of parallel jobs.
<m> The first character in the word following the PARALLEL command. For
example, U for UNLOAD; R for RELOAD.
<seqnumber>
The generated sequence number. The sequence number can be from 1 to 3
characters (n to nnn), depending on the number of parallel jobs:

n For 1 to 9 parallel jobs

Chapter 14. Using work statement lists 309


nn For 10 to 99 parallel jobs
nnn For more than 99 parallel jobs

The maximum length of a job name is 8 characters.

| You can restart failed work statement list jobs by re-issuing the R or O line
| command on the Work Statement Library List panel (ADB2W1). If the WSL
| contains PARALLEL processing capability, the WSL must be restarted in the same
| mode that it was originally run (either online or batch). A failed parallel process
| that was originally submitted as a batch job cannot be restarted in online mode,
| and vice versa.

Managing work statement lists


You can use DB2 Admin to manage WSLs.

DB2 Admin enables you to perform the following tasks:


v Show the content of a WSL
v Analyze the content of a WSL and assess the impact of running it
v Edit a WSL statement
v Generate a job to run the WSL in batch
| v Run a work statement list and view the automatically generated Load Summary
| Report
| v Resubmit a work statement list that was run by another user that did not
| complete successfully
v Delete a WSL from the library
v Copy a WSL and append it to another WSL
v Clone an existing WSL to run on a different DB2 subsystem or against DB2
objects of different naming schemes
v Add output from storage group, table space, table, and index utilities to a WSL
v Add ALTER TABLE (ALC) requests to a WSL (you can alter multiple tables by
appending several requests on one WSL)

To manage WSLs, select option W on the Administration Menu panel to display


the Manage Work Statement Lists panel, as shown in the following figure. This
panel allows you to either view the entire WSL library or just a single WSL. You
can also issue the WSL primary command from any DB2 Admin panel to display
the Manage Work Statement Lists panel.

DB2 Admin --------------- DB2X Manage Work Statement Lists -------------


Option ===>

1 - Show work statement list library DB2 System: DB2X


2 - Show work statement list DB2 SQL ID: ISTJE

Work stmt list dsn ===> TEST.WL


Work stmt list name ===> SI

Figure 196. Manage Work Statement Lists panel (ADB2W)

Use this panel to manage an entire WSL library or to manage a single WSL.

| Recommendation: When working with a WSL that has been generated to


| implement changes that are being made through Change
| Management, do not run the WSL from the Work Statement
| List Library panel (ADB2W1). Instead, use the RN command on
| the CM - Changes panel (ADB2C11) to run the change, which

310 User's Guide and Reference


| causes the WSL to be run. Use the RN command because any
| change that you want to track through Change Management
| must be made through Change Management. It is also
| recommended that you do not use the line commands on the
| Work Statement List Library panel to edit, delete, copy, append,
| or clone the WSL.
Related information
Chapter 20, “Managing changes to DB2 objects,” on page 445

Viewing a WSL library


You can view and manage an entire WSL library.

To view and manage an entire WSL library:


1. In the WSL dsn field, specify the data set name of the ISPF library that contains
the WSLs.
2. Select option 1 on the Manage WSL panel.
3. Press Enter.
The Work Statement List Library panel is displayed, as shown in the following
figure.

| DB2 Admin ----------- Work Statement List Library: IWORKSTMT.LIST Row 1 from 17
| Command ===> Scroll ===> PAGE
|
| Line commands:
| S - Show R - Run in batch D - Delete C - Copy A - Append Q - Clone
| I - Interpret V - Validate E - Edit 0 - Run online
|
| Sel Name Size Created Changed ID
| * * * * *
| --- -------- ----- ---------- ---------------- --------
| BASE 153 2005/04/12 2005/04/12 17:12 J148286
| REBIND 5 2005/04/08 2005/04/08 11:28 J148286
| ST4 5 2005/02/25 2005/02/25 08:34 J148286
| ST5 7 2005/02/25 2005/02/25 08:32 J148286
| ST8 8 2005/02/24 2005/02/24 18:32 J148286
| TEST 8 2005/04/28 2005/04/28 10:25 J148286
| TEST1 6 2005/04/26 2005/04/26 11:00 J148286
| TEST2 5 2005/04/28 2005/04/28 12:26 J148286
| T1
| ******************************* END OF DB2 DATA *******************************
||
| Figure 197. Work Statement List Library panel (ADB2W1)
|
This panel shows the contents of the WSL library, with each list on a separate
line.Use the following line commands to manage WSLs within a WSL library:
S Show the WSL.
R Run in one or more batch jobs.
D Delete the WSL from the library.
C Copy this WSL and append it to the WSL where the A line command has
been or will be specified.
A Append the WSL to this member from where the C line command has been
or will be specified.
Q Clone the existing WSL member for use on other DB2 subsystems.
I Interpret the WSL.

Chapter 14. Using work statement lists 311


V Validate the syntax of the SQL statements in the WSL and provide an
impact analysis of the objects that would be affected by running the WSL.
E Invokes ISPF EDIT so you can edit the WSL. Upon exiting from EDIT
mode, the original WSL is updated.
When editing the WSL, you must end each statement with the current
delimiter character. The delimiter character is a semicolon unless a -#SET
TERMINATOR functional comment precedes the statement.

Tip: To perform a search for a string in the WSL, invoke the EDIT
command to display all of the statements, then use FIND to search for
a specific text string.
| O Run the WSL online.
| When you run a WSL online, certain program or utilities that are intended
| to be run in batch might issue messages to the terminal. Make note of these
| messages, and press Enter to clear the messages.
Related tasks
“Cloning work statement lists”
“Interpreting a WSL” on page 316
“Validating a WSL” on page 317

Cloning work statement lists


You can clone work statement lists.

To clone a WSL:
1. Select option 1 on the Manage Work Statement Lists panel.
2. On the Work Statement List Library panel (ADB2W1), issue the Q line
command on a WSL that you want to clone. The Clone Work Statement List
panel is displayed, as shown in the following figure.

| DB2 Admin ------- Clone Work Statement List ----------------------------------


| Command ===> Scroll ===> PAGE
|
| Input work stmt list information: DB2 System: DB2X
| Work stmt list . . . : SRCEWSL DB2 SQL ID: ISTJE
| from library . . . . : WORKLIST.LIB
| More: +
| Output work stmt list information:
| Library (PDS name) . : WORKLIST.LIB2
| Work stmt list . . . : UNION2 (will be new PDS member)
|
| Execution mode . . . . : BATCH (BATCH or TSO)
| PDS for jobs . . .. : ISTJE10
| PDS member . . . . . : WORKLISTS
| Unit type . . . . . : SYSDA
|
| Use Masking. . . . . . : NO (Yes/No)
| Apply masking to data set names. . : (Yes/No=default)
|
| Use local DB2 catalog information to replace: (Yes/No)
| Authorizations . . . . . . . . . . :
| Partitioning attributes . . . . . :
| Table space and index attributes . :
|
| Additional parameters:
| Message output file : 'ISTJE.CLONE.SYSPRINT.SRCEWSL'
||
| Figure 198. Clone Work Statement List panel (ADB2W1Q)
|

312 User's Guide and Reference


3. In the Input work statement list information fields, the WSL that you
selected and library in which it is stored is displayed. If necessary, change
these names.
4. In the Output work stmt list information fields, specify a name for the new
WSL and a name of a library in which to place it.
Library (PDS name)
The name of a library in which to place the new WSL as a new PDS
member. Use standard TSO format for this name. If this PDS does not
exist, DB2 Admin creates and catalogs this PDS with a default size of 1
cylinder, record length 80, and fixed-block with a block size of 6160.
Work stmt list
The name of the new (cloned) WSL. DB2 Admin creates a new PDS
member using this name in the PDS/library that you specify. If a PDS
member by this name already exists in that library, the PDS member is not
replaced, and the cloning attempt fails.
WSLs are stored as ISPF tables, which are subject to the ISPF restriction
that requires currently active tables to have different names, even when
the tables are from different PDS/libraries. Therefore, the cloned WSL that
you create and its source WSL must have different names.
| 5. Select a mode for running the cloning job, either batch or TSO. If you select
| batch mode, specify values for the "PDS for jobs" and "PDS member" fields. If
| necessary, change the default unit type.
6. Specify Yes or No in the Use Masking field. If you specify Yes, the Specify
Mask panel is displayed, and you can specify the mask to use and edit the
mask definition before you begin the cloning process.
| Masking enables you to change the names of the DB2 objects, owners, and
| schemas that are referenced in the original WSL for use in the new (cloned)
| WSL. Masking also enables you to specify overwrite values for several table
| space and index space attributes. Masking if often useful when the new
| (cloned) WSL is to be used on a different DB2 subsystem or in a different
| database.

| Remember: Cloning always leaves the original WSL unchanged.


If the target DB2 subsystem exists on a remote site, you can use the standard
TSO services to send the newly cloned WSL to that remote site. Or, you can
send the original WSL to that remote site first, and complete the cloning on
that remote site.

| Tip: The fields to specify overwrite values for table space or index space
| attributes are no longer available on this panel because masking is
| changed to include the support to specify overwrite values for PRIQTY
| and SECQTY. When you edit the mask while under the control of the
| DB2 Admin masking macro, you can import your old overwrite values
| by using the command, COPY 'overwrites_data_set_name' after .ZL, where
| 'overwrites_data_set_name is the name of your old overwrites data set. The
| COPY command appends the contents of the specified overwrites data
| set to the mask contents.
The following field is also available for specifying values:
Apply masking to data set names
Specifying Yes in this field causes name masking to be applied to data set
names. Name masking is useful when DB2 Admin generates data set
names with qualifiers that are based on database object names. This field

Chapter 14. Using work statement lists 313


only affects the following statements: TSO ALLOCATE, ADM
TSODELETE, UTL TEMPLATE, and UTL UTLFROM(admin).

7. Decide whether to override the existing authorizations, partitioning, and table


space and index attributes.
Authorizations
Overrides authorization to objects that are created by the WSL with
authorization records (grants) from the local DB2 catalog. Grants to objects
that are not created by the WSL are not overridden.
Partitioning attributes
Overrides characteristics of partitioned tables spaces and indexes in the
local DB2 catalog. Objects that are not partitioned in the local DB2 catalog
are not affected. The list of columns that comprise the index key is not
overridden. This index property is always taken from the WSL statement.

Restriction: Certain conditions make it impossible to override


partitioning. For example, it is unsafe to change partitioning
attributes if the list of index columns in the WSL statement is
not a strict extension of the list of index columns found in the
local DB2 catalog. In this case (for an index on a table), no
partitioning attributes are overridden.
Table space and index attributes
| For the CREATE TABLESPACE/INDEX statements, in the newly cloned
| WSL, you can replace the primary and secondary quantity values
| specified in these statements with the values from the local DB2 catalog
| tables (SYSTABLEPART and SYSINDEXPART) where cloning is requested.
| If the masking feature is used, the masking to change DB2 object names
| and owners is performed first, then any overwrite values that are
| specified for PRIQTY and SECQTY, if any, are performed using the new
| table space or index names.
8. Optional: Overwrite the attributes for table spaces and index spaces. Specify
whether to edit the data set.
9. Specify an output message data set in the Message output file field.
10. Press Enter to complete the cloning process.

While using the Clone Work Statement List panel, you can browse the message
data set for a cloned WSL by specifying the appropriate message output file (if it
was changed from the default) and issuing the M primary command.

Cloning can be performed on a WSL containing any valid commands and valid
SQL statements.
Related concepts
“Mask definitions” on page 505
Related tasks
“Viewing a WSL library” on page 311

Viewing a WSL
You can view and manage a single WSL.

To view and manage a single WSL:

314 User's Guide and Reference


1. In the Manage WSL panel, specify the data set name of the ISPF library that
contains the WSL and the name of the WSL. If the WSL does not exist, DB2
Admin creates it for you.
2. Select option 2 and press Enter. The Show Work Statement List: CREATE panel
is displayed, as shown in the following figure.

DB2 Admin ----------- Show Work Statement List: CREATE ------------ Row 1 of 4
Command ===> Scroll ===> Page

Line commands:
D - Delete I - Insert E - Edit C - Copy M - Move A - After B - Before
R - Repeat

Select Type Statement


* *
------ ---- -------------------------------------------------------------------
DDL CREATE DATABASE "YYYY2" STOGROUP "ISTJEG"
DDL CREATE TABLESPACE "YYYY2S" IN "YYYY2" USING STOGROUP "ISTJE
DDL CREATE TABLE "YYYY2T" ("KEY" CHAR(10) NOT NULL ,"D2" CHAR(8
DDL CREATE INDEX "YYYY2X" ON "YYYY2T"(KEY) USING STOGROUP "ISTJ
******************************* END OF DB2 DATA *******************************

Figure 199. Show Work Statement List panel (ADB2W1S)

Use the following line commands to manage the WSL:


D Delete the statement from the list.
I Insert a statement into the list.
E Edit the statement.
C Copy this statement to the line identified by an A (after) or a B (before) line
command.
M Move this statement to the line identified by an A (after) or a B (before) line
command.
A Identifies that the destination of a move or copy operation is after this line.
B Identifies that the destination of a move or copy operation is before this
line.
R Repeat the statement
You can issue the C and M line commands in a separate operation from the A
and B line commands. If entered separately, the first line command encountered
remains pending until its counterpart is encountered. While a line command is
pending, any intervening line commands (such as E for edit) can be processed.
However, if a line is deleted while in pending state, the operation is removed.
The following values for Type are allowed:
COM
Comment statements
DDL
SQL statements for data definitions, such as CREATE, ALTER, and DROP
DCL
SQL statements for authorization changes, such as GRANT and REVOKE
DML
SQL statements for data manipulation, such as INSERT, UPDATE and
DELETE

Chapter 14. Using work statement lists 315


DB2
DB2 START, STOP, and SET commands
DSN
DSN BIND, REBIND, and FREE commands
UTL
DB2 utility statements
ADM
DB2 Admin statements

Interpreting a WSL
Before running a WSL, you might want to check the contents of the WSL to see
what types of statements that it contains.

Interpreting a WSL allows you to generate a report that selectively lists the
different SQL statements, DB2 commands, and utility statements that the WSL
contains.

To interpret a WSL:
1. Issue the I command on the Work Statement List Library panel. The Interpret
Work Statement List Options panel is displayed, as shown in the following
figure.

DB2 Admin ------------ Interpret Work Statement List Options ------------------

Specify S to select Work Statement List statement types:


More: +
SQL: DB2 Utilities: DB2 Commands:
S DDL S Load/Unload Plan/packages
S ALTER LOAD BIND
CREATE UNLOAD/REORG UNLOAD REBIND
S DROP S Backup/Recovery FREE
S COMMENT ON COPY Other
S LABEL ON COPYTOCOPY RUN
SET MERGECOPY START/STOP
S DCL MODIFY Other
GRANT QUIESCE Admin:
REVOKE REBUILD Data set
S DML RECOVER ALLOC
DELETE REPORT TSODELETE
INSERT S Other LISTDEF
UPDATE CHECK TEMPLATE
Other DIAGNOSE ADBSYSIN
COMMIT REORG Other
Comments REPAIR ADBPAUSE
S Other RUNSTATS UTILFROM
STOSPACE REXX Execs
Other Other

Figure 200. Interpret Work Statement List Options panel

2. Choose those statement types that you want interpreted (see the previous
figure for statement types) and press Enter. The Interpret Work Statement List
report is generated, as shown in the following figure. The S line command to
show an object is valid only for objects that are in the catalog, such as
databases, table spaces, and indexes.

316 User's Guide and Reference


DB2 Admin --------- Interpret Work Statement List: WSL011 - Row 1 to 16 of 103
Command ===> Scroll ===> PAGE

Line commands: S - Show object V - View statement

Sel Seq Action Object Type Qual Name Note


* * * * * *
--- ----- ---------- ------------- -------> -----------------> -------------
27 SET SQLID ISTJEB1
29 CREATE DATABASE ISTJEB1D
31 GRANT DATABASE ISTJEB1D
33 GRANT DATABASE ISTJEB1D
35 GRANT DATABASE ISTJEB1D
37 GRANT DATABASE ISTJEB1D
46 CREATE STOGROUP ISTJEB1GLONG
55 CREATE TABLESPACE ISTJEB1D ISTJEB1Z
64 SET SQLID ISTJEB2X
66 CREATE TABLE ISTJEB2X PLAN_TABLEXXXXXXXX
68 SET SQLID ISTJEB1
70 GRANT TABLE ISTJEB2X PLAN_TABLEXXXXXXXX
72 GRANT TABLE ISTJEB2X PLAN_TABLEXXXXXXXX
74 GRANT TABLE ISTJEB2X PLAN_TABLEXXXXXXXX
76 GRANT TABLE ISTJEB2X PLAN_TABLEXXXXXXXX
85 CREATE STOGROUP ISTJEB1G

Figure 201. Interpret Work Statement List report

Related tasks
“Viewing a WSL library” on page 311

Validating a WSL
Validating a WSL allows you to generate a report about the syntax and the impact
to other objects.

Before running a WSL, you might want to have the syntax of the SQL statements
checked and assess the impact that running the WSL would have on objects.

When you validate a WSL, DB2 Admin checks the syntax of each SQL statement in
isolation from any other SQL statements in the WSL; it ignores any SQL statements
that precede the statement currently being checked. Thus, DB2 Admin can
generally report all syntactic errors but might miss semantic errors that can result
from not being able to see previous statements. For example, if the name of a data
type is required in a certain position in the syntax, DB2 Admin does not verify that
the name of the data type is either a built-in data type or a user-defined data type
that has been previously defined.

| Note: For native SQL procedures, even if validation is successful, the object's
| existence in the body of the native SQL procedure cannot be known at
| procedure run time (or during procedure call).

The impact analysis portion of the validate report lists the impact to the objects by
these categories:
Implicitly dropped objects
Existing objects that are implicitly dropped but not re-created by the WSL.
Explicitly dropped objects
Existing objects that are explicitly dropped but not re-created by the WSL.
Recreated objects
Existing objects that are implicitly or explicitly dropped and re-created by
the WSL.

Chapter 14. Using work statement lists 317


Altered objects
Existing objects that are altered by the WSL.
Created objects
Objects that did not exist and are created by the WSL.
Temporary objects
Objects that did not exist and are created and then dropped by the WSL.

Each affected object is included in only one of these categories.

To validate a WSL:
1. Issue the V command on the Work Statement List Library panel. The JCL to
generate the batch job to produce the Validate Work Statement List report is
displayed.
2. Submit the JCL. The Validate Work Statement List report is generated and
displayed, as shown in the following figure.

318 User's Guide and Reference


. . . . . . . . . . . . . . . . . . . . . . . . . . .
Display Filter View Print Options Help
-------------------------------------------------------------------------------
SDSF OUTPUT DISPLAY NBRONV J0086325 DSID 105 LINE 1 COLUMNS 02- 81
COMMAND INPUT ===> SCROLL ===> PAGE
--------------------------------------------------------------------------------
ADB2WVL - Validate Work Statement List
--------------------------------------------------------------------------------

DB2 Administration Tool


5697-L90 (C) Copyright IBM Corporation 2001, 2005.
All rights reserved. Licensed materials - property of IBM.
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP schedule contract with IBM Corp.

--------------------------------------------------------------------------------
REFERENCE FOR CATALOG OBJECT STATUS
--------------------------------------------------------------------------------
IMPLICITLY DROPPED OBJECTS - Existing catalog objects that are implicitly
dropped and not recreated by the WSL.
TEMPORARY OBJECTS - Objects that are created and dropped during
execution of the WSL. Temporary objects do not
exist in the catalog before or after WSL execution.
CREATED OBJECTS - Objects that are created by the WSL that did not
exist in the catalog.
EXPLICITLY DROPPED OBJECTS - Existing catalog objects that are explicitly
dropped and not recreated by the WSL.
ALTERED OBJECTS - Existing catalog objects that are modified by
ALTER statements in the WSL.
RECREATED OBJECTS - Existing catalog objects that are implicitly or
explicilty dropped and later recreated by the WSL.
--------------------------------------------------------------------------------

VALIDATE WORK STATEMENT LIST REPORT


===================================

Prepared on DSN7 (DB2 Release 720) by NBRON at 2006-07-08 10:48


for NBRON.WLIST.VALIDATE(SAMPLE)

SQL error in PREPARE for statement:


CREATE SEQUENCE ORDER_SEQ START WITH 1 INCREMEN
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "START". SOME SYMBOLS THAT
MIGHT BE LEGAL ARE: FOR
DSNT418I SQLSTATE = 42601 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHPARS SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 0 0 0 -1 40 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'00000000' X'00000000' X'00000000' X'FFFFFFFF'
X'00000028' X'00000000' SQL DIAGNOSTIC INFORMATION

Error processing Database ABCDE in a ALTER statement:Object does not exist


Error processing Table DSN8720.ABCDTB in a ALTER statement:Object does not exist
Error processing Table DSN8720.DEPT in a ALTER statement:Object does not exist
Error processing Table DSN8720.ABCDTB in a ALTER statement:Object does not exist
Error processing Index DSN8720.ABCDIX in a ALTER statement:Object does not exist
Error processing Index DSN8720.XDEPT1 in a ALTER statement:Object does not exist
Error processing Sequence NBRON.org_seq in a ALTER statement:Object does not exist
Error processing Sequence VNDSHL2.SEQ14 in a CREATE statement:Object already exists
Error processing Sequence VNDSHL2.SEQ13 in a DROP statement:Object does not exist
.
.
.

Figure 202. Validate Work Statement List report (1 of 2)

Chapter 14. Using work statement lists 319


.
.
.
IMPLICITLY DROPPED OBJECTS
--------------------------
Referential constraint AHXTOOLS.PROJACT
Referential constraint AHXTOOLS.PROJ
Referential constraint AHXTOOLS.PROJ
Referential constraint AHXTOOLS.DEPT
Referential constraint AHXTOOLS.PROJ
Referential constraint AHXTOOLS.PROJACT
Referential constraint AHXTOOLS.DEPT

ALTERED OBJECTS
---------------
Function NBRON.SPECIFICFFFF1

TEMPORARY OBJECTS
-----------------
Sequence NBRON.org_seq
Table Space DSN8D72A.DSN8S72D
Table DSN8720.DEPT
Table DSN8720.ABCDTB

CREATED OBJECTS
----------------
Table NBRON.TBDSN80

RECREATED OBJECTS
------------------
Table QUADPB02.TBADPB02
Table Space DBADPB02.TPADPB01
View QUADPB02.VWADPB02
View QUADPB02.VWADPB04
View QUADPB02.VWADPB05
View QUADPB02.VWADPB06
View QUADPB02.VWADPB09
View QUADPB02.VWADPB12
View QUADPB02.VWADPB14
View QUADPB02.VWADPB15
View QUADPB02.VWADPB16
View QUADPB02.VWADPB17
View QUADPB02.VWADPB18
View QUADPB02.VWADPB19
Index QUADPB02.IPADPB01
Index QUADPB02.IPADPB02
Referential constraint QUADPB02.TBADPB02 QUADPB02.TBADPB01 FKADPB03
Referential constraint QUADPB02.TBADPB01 QUADPB02.TBADPB02 FKADPB02
Referential constraint QUADPB02.TBADPB04 QUADPB02.TBADPB02 FKADPB04
Referential constraint QUADPB02.TBADPB05 QUADPB02.TBADPB02 FKADPB07

Figure 203. Validate Work Statement List report (2 of 2)

Related tasks
“Viewing a WSL library” on page 311

| Running a WSL
| You can run a WSL.

| To run a WSL:
| 1. Issue the R (Run in batch) command or the O (Run online) command on the
| Work Statement List Library panel for the WSL that you want to run. If you
| choose to run in batch, the JCL to generate the batch job is displayed.
| 2. Submit the JCL.

320 User's Guide and Reference


| 3. If the WSL included a LOAD operation, review the Load Summary Report in
| LOADRPT, which indicates whether records were discarded when data was
| loaded. When a Load Summary Report step exists, SYSPRINT output from the
| preceding ADBTEP2 step is recorded in ADBPRINT of the Load Summary
| Report step. If the WSL does not include a LOAD, ADBTEP2 messages are
| recorded in SYSPRINT of the ADBTEP2 step.
| Related concepts
| “Load summary report”

| Load summary report


| Checking the load summary report (located in LOADPRT) at the end of a WSL run
| is easier than scanning the WSL execution log and checking for instances of
| load-generated discard records.

| The load summary report helps you ensure that no data was unexpectedly lost.

| The load summary report contains the following information:


| v The name of the object
| v The number of input records
| v The number of records that were loaded
| v The number of records that were discarded

| The example in the following figure shows a load summary report in which the
| number of input and loaded records for three tables were the same, but records
| were discarded for another table.
|
| 15697-L90 IBM DB2 Administration Tool for Z/OS Load Summary Report for Worklist(ST8)
|
|
| Table owner Table name Input Loaded Discarded Status
| ------------------ ------------------ ----------- ----------- ----------- --------
| "SYSADM" "TBADAS01" 1255 1255 0 ********
| "SYSADM" "TBADAS02" 855 799 56 discards
| "SYSADM" "TBADAS03" 2033 2033 0 ********
| "SYSADM" "TBADAS04" 1444 1444 0 ********
||
| Figure 204. Example of load summary report
|
| When the report contains a large number of rows, you will need to scroll through
| the report to see all of the information in the report. When the table name exceeds
| the number of characters that can be displayed in the Table Name field, a footnote
| suffix is added to the table name, and the full table name is displayed at the
| bottom of the report. The following example shows the format that is used to
| display long table names:
|

Chapter 14. Using work statement lists 321


| 15697-L90 IBM DB2 Administration Tool for Z/OS Load Summary Report for Worklist(ST9)
|
|
| Table owner Table name Input Loaded Discarded Status
| ------------------ ------------------ ----------- ----------- ----------- --------
| "SYSADM" "TBADAS0190123(*1) 1006 1006 0 ********
| "SYSADM" "TBADAS0290123(*2) 75 75 0 ********
| "SYSADM" "TBADAS0390123(*3) 4031 4031 0 ********
| "SYSADM" "TBADAS0490123(*4) 2444 2444 0 ********
|
| Footnotes:
|
| (*1)
|
| "TBADAS019012345678901234567890"
|
| (*2)
|
| "TBADAS029012345678901234567890"
|
| (*3)
|
| "TBADAS039012345678901234567890"
|
| (*4)
|
| "TBADAS049012345678901234567890"
||
| Figure 205. Example of load summary report with long table names
|
| Related tasks
| “Running a WSL” on page 320

| Restarting a WSL that was run by another user


| You can restart a WSL that was run by another user but did not complete
| successfully.

| To restart a WSL that was run by another user:


| 1. Determine the user ID of the user who ran the WSL. You can find the user ID
| in the checkpoint table.
| 2. Issue the R (Run in batch) command on Work Statement List Library panel for
| the WSL that you want to restart. The JCL to generate the batch job is
| displayed.
| 3. Edit the batch job at the ADBTEP2 restart job step and specify the USER
| parameter with the user ID of the user who originally ran the WSL. For
| example, if a user with user ID SYSADM ran the WSL, the following portion of
| code shows how the edited JCL would look with the USER parameter added:
| 000036 RUN PROGRAM(ADBTEP2) PLAN(ADBTEP2) -
| 000037 LIB('ADB.QA260.ISPLLIB') -
| 000038 PARMS('/WORKLIST(JTKZ) SSID(V81A) -
| '''''' USER(SYSADM) -
| 000039 RESTART(YES),BINDERROR(MAXE)')

| Important: The USER and CHANGEID parameters are mutually exclusive.


| Ensure that the JCL does not include a CHANGEID parameter.
| 4. Submit the JCL.

322 User's Guide and Reference


| Related tasks
| “Displaying or managing batch checkpoint tables” on page 392

Sample scenario for creating and using a work statement list


This scenario shows how to use DB2 Object Comparison Tool to create a WSL.

In this scenario, two databases are used, each with two tables. DB2 Object
Comparison Tool produces the tasks that upgrade the older, outdated database to
the new database. This sample directs these tasks to a WSL. The following figure
shows the DB2 Object Comparison Tool after defining the inputs and the masking
that is required, and proceeding to the Step 5. Generate Compare Jobs panel.

Compare --------------------- Generate Compare Jobs ---------------------------


Option ===>

Specify the following for DB2 Object Comparison Tool:


More: +
Worklist information:
Worklist name . . . . . . : ROYCDOC1 (also used as middle qualifier in DSNs)

Compare options:
Suppress DROP of objects : N (Yes/No)
Suppress DROP of columns : N (Yes/No)
Suppress adding columns . : N (Yes/No)

Change reporting options . : N (Yes/No)

Data set information:


PDS for batch jobs . . . : DOCM.CNTL
Prefix for data sets . . : ROYC
Unit type permanent ds . : SYSDA
Unit type unload ds . . . : SYSDA Serial (tape) device : N (Y/N)

Options:
Single compare job . . . : Y (Yes/No)
Member name of single job : COMPARE (default COMPARE )
Generate apply jobs . . . : N (Yes/No)
As work statement list . : Y (Yes/No to append to work stmt list)

Optional jobs after reload:


Run CHECK DATA . . . . . : Y (Yes/No)
Run RUNSTATS . . . . . . : Y (Yes/No)
Take an image copy . . . : Y (Yes/No)

BP - Change batch job parameters

Figure 206. DB2 Object Comparison Tool — Generate Compare Jobs panel

The new WSL name is ROYCDOC1 and the As work statement list field indicates
that the job should be saved as a WSL. Next, a panel prompts for the data set in
which to store the new WSL. If the data set does not exist, it is created. A DB2
Object Comparison Tool JCL job is now generated for this new WSL. Running this
job produces the WSL that can be used to upgrade the old tables to the new tables.

The following figure shows the result of selecting option 1 on panel ADB2W
(option W from the Main Menu) to show the list of WSLs, including the new WSL
just created.

Chapter 14. Using work statement lists 323


DB2 Admin ---- Work Statement List Library: ROYC.WORKLIST -- Row 1 of 1
Command ===> Scroll ===> PAGE

Line commands:
Line commands:
S - Show R - Run in batch D - Delete C - Copy A - Append Q - Clone
I - Interpret V - Validate E - Edit

Name Prompt Size Created Changed ID


- -----------------------------------------------------------------------------
ROYCDOC1
**End**

Figure 207. Work Statement List Library panel (ADB2W1)

Figure 208 on page 325 and Figure 209 on page 326 show the contents of the new
WSL, using the SHOW line command.

The TYPE column specifies the statement type (DDL statement, DB2 command,
DB2 utility, etc.) for statements that are placed in the batch statement list when
running the WSL. The ADM type statements are control statements that can control
the number of jobs created when the WSL is run.

324 User's Guide and Reference


DB2 Admin ----------- Show Work Statement List: ROYCDOC1 --- Row 1 to 14 of 83
Command ===> Scroll ===> PAGE

Line commands:
D - Delete I - Insert E - Edit C - Copy M - Move A - After B - Before
R - Repeat

Select Type Statement


* *
------ ---- -------------------------------------------------------------------
COM -- Created by ROYC on 2002/07/16 at 16:49
COM Generated by Compare Apply by ROYC on 2002/07/16 at 16:49
ADM PARALLEL UNLOAD
ADM JOB
DB2 -STA DB(POST) SPACE(POSTTS1) ACCESS(RO)
UTL TEMPLATE UTLPUNCH DSN 'ROYC.ROYCDOC1.CNTL.PPP1'.. UNIT SYSD
UTL TEMPLATE SYSREC DSN 'ROYC.ROYCDOC1.UNLD.PPP1'.. UNIT SYSDA
UTL UNLOAD DATA FROM TABLE "POSTO"."PPP1" PUNCHDDN(UTLPUNCH)
DML TSODELETE 'ROYC.ROYCDOC1.CNTLC.PPP1';..TSODELETE 'ROYC.ROYCDOC1.UNL
TSO ALLOC DD(DDLIN) DUMMY
TSO ALLOC DD(DDLOUT) DUMMY
TSO ALLOC DD(CNTLI001).. DS('ROYC.ROYCDOC1.CNTL.PPP1') SHR
TSO ALLOC DD(CNTLO001).. DS('ROYC.ROYCDOC1.CNTLC.PPP1').. LIK
TSO ALLOC DD(DATAI001).. DS('ROYC.ROYCDOC1.UNLD.PPP1') SHR
TSO ALLOC DD(DATAO001).. DS('ROYC.ROYCDOC1.UNLDC.PPP1') USING(DATA
ADM ADMIN ALTER CONVERT POSTO.PPP1
ADM ENDJOB
ADM JOB
DB2 -STA DB(POST) SPACE(POSTTS2) ACCESS(RO)
UTL TEMPLATE UTLPUNCH DSN 'ROYC.ROYCDOC1.CNTL.PPP2'.. UNIT SYSD
UTL TEMPLATE SYSREC DSN 'ROYC.ROYCDOC1.UNLD.PPP2'.. UNIT SYSDA
UTL UNLOAD DATA FROM TABLE "POSTO"."PPP2" PUNCHDDN(UTLPUNCH)
DML TSODELETE 'ROYC.ROYCDOC1.CNTLC.PPP2';..TSODELETE 'ROYC.ROYCDOC1.UNL
TSO ALLOC DD(DDLIN) DUMMY
TSO ALLOC DD(DDLOUT) DUMMY
TSO ALLOC DD(CNTLI001).. DS('ROYC.ROYCDOC1.CNTL.PPP2') SHR
TSO ALLOC DD(CNTLO001).. DS('ROYC.ROYCDOC1.CNTLC.PPP2').. LIK
TSO ALLOC DD(DATAI001).. DS('ROYC.ROYCDOC1.UNLD.PPP2') SHR
TSO ALLOC DD(DATAO001).. DS('ROYC.ROYCDOC1.UNLDC.PPP2') USING(DATA
ADM ADMIN ALTER CONVERT POSTO.PPP2
ADM ENDJOB
ADM ENDPARALLEL
DDL DROP TABLE POSTO.PPP1
DML COMMIT
DDL DROP TABLE POSTO.PPP2
DML COMMIT
DB2 -STA DB(POST) SPACE(POSTTS1)
DB2 -STA DB(POST) SPACE(POSTTS2)
DDL CREATE TABLE POSTO.PPP1.. (EMP CHAR(6) FOR S
DML COMMIT
DDL CREATE TABLE POSTO.PPP2.. (EMP CHAR(6) FOR S
DML COMMIT
DDL CREATE INDEX POSTO.PPP1X.. ON POSTO.PPP1.. (EMP
DML COMMIT
DDL CREATE INDEX POSTO.PPP2X.. ON POSTO.PPP2.. (EMP
DML COMMIT
ADM PARALLEL RELOAD
ADM JOB
...

Figure 208. The contents of the new WSL (part 1)

Chapter 14. Using work statement lists 325


...
UTL TEMPLATE SYSREC DSN 'ROYC.ROYCDOC1.UNLDC.PPP1' DISP(SHR)
UTL TEMPLATE UTLDISC DSN 'ROYC.ROYCDOC1.SDISC.PPP1'.. UNIT SYSD
UTL TEMPLATE UTLERR DSN 'ROYC.ROYCDOC1.SERR.PPP1'.. UNIT SYSDA.
UTL TEMPLATE UTLMAP DSN 'ROYC.ROYCDOC1.SMAP.PPP1'.. UNIT SYSDA
UTL TEMPLATE UTLUT1 DSN 'ROYC.ROYCDOC1.SUT1.PPP1'.. UNIT SYSDA
UTL TEMPLATE UTLOUT DSN 'ROYC.ROYCDOC1.SOUT.PPP1'.. UNIT SYSDA
UTL UTILFROM ROYC.ROYCDOC1.CNTLC.PPP1.. ADD(SORTNUM 8 SORTDEVT
UTL TEMPLATE UTLUT1 DSN 'ROYC.ROYCDOC1.SUT1.PPP1'.. UNIT SYSDA
UTL TEMPLATE UTLOUT DSN 'ROYC.ROYCDOC1.SOUT.PPP1'.. UNIT SYSDA
UTL TEMPLATE UTLERR DSN 'ROYC.ROYCDOC1.SERR.PPP1'.. UNIT SYSDA
UTL CHECK DATA TABLESPACE POST.POSTTS1.. ERRDDN(UTLERR) WORKDDN(UTLUT1
UTL RUNSTATS TABLESPACE POST.POSTTS1.. TABLE("POSTO"."PPP1").. INDEX(
UTL TEMPLATE SYSCOPY DSN 'ROYC.DSN7.IC.POST.POSTTS1(+1)'.. UNIT
UTL COPY TABLESPACE POST.POSTTS1 COPYDDN(SYSCOPY)
UTL MODIFY RECOVERY TABLESPACE POST.POSTTS1 DSNUM ALL.. DELETE AGE(35)
ADM ENDJOB
ADM JOB
UTL TEMPLATE SYSREC DSN 'ROYC.ROYCDOC1.UNLDC.PPP2' DISP(SHR)
UTL TEMPLATE UTLDISC DSN 'ROYC.ROYCDOC1.SDISC.PPP2'.. UNIT SYSD
UTL TEMPLATE UTLERR DSN 'ROYC.ROYCDOC1.SERR.PPP2'.. UNIT SYSDA.
UTL TEMPLATE UTLMAP DSN 'ROYC.ROYCDOC1.SMAP.PPP2'.. UNIT SYSDA
UTL TEMPLATE UTLUT1 DSN 'ROYC.ROYCDOC1.SUT1.PPP2'.. UNIT SYSDA
UTL TEMPLATE UTLOUT DSN 'ROYC.ROYCDOC1.SOUT.PPP2'.. UNIT SYSDA
UTL UTILFROM ROYC.ROYCDOC1.CNTLC.PPP2.. ADD(SORTNUM 8 SORTDEVT
UTL TEMPLATE UTLUT1 DSN 'ROYC.ROYCDOC1.SUT1.PPP2'.. UNIT SYSDA
UTL TEMPLATE UTLOUT DSN 'ROYC.ROYCDOC1.SOUT.PPP2'.. UNIT SYSDA
UTL TEMPLATE UTLERR DSN 'ROYC.ROYCDOC1.SERR.PPP2'.. UNIT SYSDA
UTL CHECK DATA TABLESPACE POST.POSTTS2.. ERRDDN(UTLERR) WORKDDN(UTLUT1
UTL RUNSTATS TABLESPACE POST.POSTTS2.. TABLE("POSTO"."PPP2").. INDEX(
UTL TEMPLATE SYSCOPY DSN 'ROYC.DSN7.IC.POST.POSTTS2(+1)'.. UNIT
UTL COPY TABLESPACE POST.POSTTS2 COPYDDN(SYSCOPY)
UTL MODIFY RECOVERY TABLESPACE POST.POSTTS2 DSNUM ALL.. DELETE AGE(35)
ADM ENDJOB
ADM ENDPARALLEL
COM End of Compare Apply statements
******************************* END OF DB2 DATA *******************************

Figure 209. The contents of the new WSL (part 2)

When you run the WSL (by issuing the R line command on the option 1 panel),
you are prompted for a library name, a prefix to use for the job name, and whether
the job name should equal the member name. The following figure shows the jobs
that are created when you select Run Work Statement List.

Menu Functions Utilities Help


ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
EDIT ROYC.DOCM.CNTL Row 00001 of 00006
Command ===> Scroll ===> CSR
Name Prompt Size Created Changed ID
. COMPARE 188 2002/07/16 2002/07/16 17:55:30 ROYC
. ROYCR001 68 2002/07/16 2002/07/16 18:33:06 ROYC
. ROYCR002 68 2002/07/16 2002/07/16 18:33:07 ROYC
. ROYCU001 64 2002/07/16 2002/07/16 18:33:04 ROYC
. ROYCU002 62 2002/07/16 2002/07/16 18:33:04 ROYC
. ROYC2 82 2002/07/16 2002/07/16 18:33:05 ROYC
**End**

Figure 210. The jobs that are generated from running the WSL.

The Run command produced five jobs. This example is changing two tables;
therefore, two unload jobs (ROYCU001 and ROYCU002) are created. These two
jobs can be run in parallel. The ROYC2 job performs all the DDL tasks and can be
run after the unload jobs have successfully completed. The final two jobs,
ROYCR001 and ROYCR002, reload the data and can be run in parallel. The
COMPARE job is shown in the previous figure but does not need to be in the same
library as the other WSL jobs.

326 User's Guide and Reference


Figure 211 on page 328 and Figure 212 on page 329 show the ROYC2 job in detail.
The following statements in this job are important to understand:
v RUN PROGRAM(ADBTEP2) PLAN(ADBTEP2) specifies that the DB2 Admin
Batch Restart Program (ADBTEP2) is to be run.
v The library that contains ADBTEP2 is specified in the line:
LIB('DMTOOL.ADB4BASE.ISPLLIB'). This library cannot be in the STEPLIB
because the STEPLIB must be APF authorized to run DB2 utilities.
v The WSL name appears as the first part of the WORKLIST parameter in the line
PARM('/WORKLIST(ROYCDOC1.2),SSID(DSN7)'). Also, the SSID parameter is
mandatory if DB2 commands or utilities are being executed.
v The input to ADBTEP2 is provided by the SYSIN DD name, which is referred to
as a batch statement list. This contains the executable statements derived from the
WSL.

Chapter 14. Using work statement lists 327


****** ***************************** Top of Data ******************************

DB2 Admin: Edit generated JCL

//ROYCDOC1 JOB (ROYC,B240,090,D783),&SYSUID,


//* RESTART=STEPNAME, <== FOR RESTART REMOVE * AND ENTER STEP NAME
// MSGCLASS=H,TIME=(2),MSGLEVEL=(1,1),NOTIFY=&SYSUID,
// USER=&SYSUID,REGION=8M
//*
// CLASS=U
//*
/*JOBPARM S=SY4A
//*
//*
//**********************************************************************
//*
//* DB2 BATCH MONITOR
//*
//* DB2 ADMIN GENERATED BATCH JOB.
//*
//*************************************************************ADB2WL4**
//DB2B EXEC PGM=IKJEFT01,DYNAMNBR=100
//STEPLIB DD DISP=SHR,DSN=DSN.DSN7.SDSNEXIT
// DD DISP=SHR,DSN=DSN.DSN7.SDSNLOAD
//SYSEXEC DD DISP=SHR,DSN=DMTOOL.ADB4DEVT.EXEC
// DD DISP=SHR,DSN=DMTOOL.GOC2BASE.EXEC
// DD DISP=SHR,DSN=DMTOOL.ADB4BASE.EXEC
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DSN7)
RUN PROGRAM(ADBTEP2) PLAN(ADBTEP2) -
LIB('DMTOOL.ADB4BASE.ISPLLIB') -
PARM('/WORKLIST(ROYCDOC1.2),SSID(DSN7)')
END
//SYSIN DD *
DROP TABLE POSTO.PPP1;
COMMIT;
DROP TABLE POSTO.PPP2;
COMMIT;
-STA DB(POST) SPACE(POSTTS1);
-STA DB(POST) SPACE(POSTTS2);
CREATE TABLE POSTO.PPP1
(EMP CHAR(6) FOR SBCS DATA WITH DEFAULT NULL ,
PROJ CHAR(3) FOR SBCS DATA WITH DEFAULT NULL )
IN POST.POSTTS1
AUDIT NONE
DATA CAPTURE NONE
CCSID EBCDIC;
COMMIT;
CREATE TABLE POSTO.PPP2
(EMP CHAR(6) FOR SBCS DATA WITH DEFAULT NULL ,
DEPT CHAR(3) FOR SBCS DATA WITH DEFAULT NULL )
IN POST.POSTTS2
AUDIT NONE
DATA CAPTURE NONE
CCSID EBCDIC;
COMMIT;

...

Figure 211. The resulting job: ROYC2 (part 1)

328 User's Guide and Reference


...

CREATE INDEX POSTO.PPP1X


ON POSTO.PPP1
(EMP ASC)
USING STOGROUP SYSDEFLT
PRIQTY 12 SECQTY 12
ERASE NO
FREEPAGE 0 PCTFREE 10
GBPCACHE CHANGED
BUFFERPOOL BP1
CLOSE YES
COPY NO
PIECESIZE 2 G;
COMMIT;
CREATE INDEX POSTO.PPP2X
ON POSTO.PPP2
(EMP ASC)
USING STOGROUP SYSDEFLT
PRIQTY 12 SECQTY 12
ERASE NO
FREEPAGE 0 PCTFREE 10
GBPCACHE CHANGED
BUFFERPOOL BP1
CLOSE YES
COPY NO
PIECESIZE 2 G;
COMMIT;
/*

Figure 212. The resulting job: ROYC2 (part 2)

| Running WSL with the utility template for LOBs


| You can run work statement lists (WSLs) with LOBs by using the utility template
| for LOBs, or by using a customization skeleton, or you can run WSLs by default.

| If you use the utility template for LOBs, the Run WSL function (like other
| functions such as ALC, RDEF, and MIG) will add an ADM statement (ADMIN
| LOBTEMPLAT) to indicate the existence of a LOB column or columns in the table
| or tablespace that is involved in the next UNLOAD statement.

| The LOBTEMPLATE statement format is


| ADMIN LOBTEMPLATE <n> DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>

| where
| <n> Indicates the existence of n number of LOB columns in the next unload.
| <DSNPrefix>
| The dataset prefix, which can have a maximum length of 35 bytes.

| When the Run WSL function reads each ADMIN LOBTEMPLATE statement, the
| Run WSL function performs the following steps:
| 1. Generates a unique name for the template.

| For example, the following name: ADBL<nnnn>

| where
| ADB Indicates that it is an admin template.

Chapter 14. Using work statement lists 329


| L Indicates that it is a LOB template.
| nnnn Is a running sequence number for each LOB template.
| 2. Multiplies the given template statement into n templates by adding a name for
| the template and adding a suffix for the data set, as shown in the following
| example:
| ADMIN LOBTEMPLATE <n> DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>
| The Run WSL function then replaces the preceding statement with the
| following set of statements:
| ADMIN LOBTEMPLATE ADBL1 DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>
| ADMIN LOBTEMPLATE ADBL2 DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>
| .
| .
| .
|
| TSODELETE ''SMITHS..&SSID..&DB..&SN..ADBLn'
| ADMIN LOBTEMPLATE ADBLn DSN <and other attributes like UNIT, SPACE...>
| The Run WSL function places the templates before the corresponding
| UNLOAD statement by replacing the ADMIN LOBTEMPLATE statement that
| was generated by the DB2 Admin functions.
| The ADMIN LOBTEMPLATE statement triggers ADBTEP2 to make the
| necessary modifications to the UNLOAD statement.
|
| ADB2W1S n ----------- Show Work Statement List: LOBDB ------ Row 3 to 35 of 81
| Command ===> Scroll ===> CSR
|
| Line commands:
| D - Delete I - Insert E - Edit C - Copy M - Move A - After B - Before
| R - Repeat
|
| Select Type Statement
| * *
| ------ ---- ------------------------------------------------------------------>
| ADM PARALLEL UNLOAD
| ADM JOB
| DB2 -STA DB(LOBDB) SPACE(KAVTS) ACCESS(RO)
| TSO TSODELETE 'SMITHS.DB8A.LOBDB.CNT.T0001'
| TSO TSODELETE 'SMITHS.DB8A.LOBDB.ULD.T0001'
| ADM ADMIN LOBTEMPLATE 2 DSN 'SMITHS.&SSID..&DB..&SN' UNIT(SYSDA)
| UTL TEMPLATE UTLPUNCH DSN 'SMITHS.DB8A.LOBDB.CNT.T0001'.. UNIT
| UTL TEMPLATE UTLREC DSN 'SMITHS.DB8A.LOBDB.ULD.T0001'.. UNIT S
| UTL UNLOAD DATA FROM TABLE.."SMITHS"."LOB2TB"..UNLDDN UTLREC..PUNCHDDN(
| <...more statements...>
| COM -- End of Compare Apply statements
| ******************************* END OF DB2 DATA *******************************
||
| Figure 213. Show Work Statement List: LOBDB (ADB2W1S)
|
| Related concepts
| “Using the utility template to unload data from LOBs” on page 236
| “Using ADBTEP2 with LOBs” on page 348
| “Step 10. Customize the ADB2UCUS” on page 64

| Running WSL with the utility template for unloading XML data
| You can run work statement lists (WSLs) with XML by using the utility template
| for XML, or by using a customization skeleton, or you can run WSLs by default.

| If you use the utility template for XML, the Run WSL function will repeat the
| ADMIN XMLTEMPLATE n statement n times.

330 User's Guide and Reference


| The XMLTEMPLATE statement format is
| ADMIN XMLTEMPLATE <n> DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>

| where
| <n> Indicates the existence of n number of XML columns in the next unload.
| <DSNPrefix>
| The dataset prefix, which can have a maximum length of 35 bytes.

| When the Run WSL function reads each ADMIN XMLTEMPLATE statement, the
| Run WSL function performs the following steps:
| 1. Appends a qualifier as needed for the template. Ensure that your data set is
| unique after the qualifier is appended.

| For example, the following name: ADBX<nnnn>

| where
| ADB Indicates that it is an admin template.
| X Indicates that it is an XML template.
| nnnn Is a running sequence number for each XML template.
| 2. Repeats the given template statement into n templates by adding a name for
| the template and adding a suffix for the data set, as shown in the following
| example:
| ADMIN XMLTEMPLATE <n> DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>
| The Run WSL function then replaces the preceding statement with the
| following set of statements:
| ADMIN XMLTEMPLATE ADBX1 DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>
| ADMIN XMLTEMPLATE ADBX2 DSN <DSNPrefix>...<and other attributes like UNIT, SPACE...>
| .
| .
| .
|
| ADMIN XMLTEMPLATE ADBXn DSN <and other attributes like UNIT, SPACE...>
| The Run WSL function places the templates before the corresponding
| UNLOAD statement by replacing the ADMIN XMLTEMPLATE statement that
| was generated by the DB2 Admin functions.
| The ADMIN XMLTEMPLATE statement triggers ADBTEP2 to make the
| necessary modifications to the UNLOAD statement.
| Attention: The data set name pattern will be modified to include an
| additional qualifier when multiple XML or LOB columns exist in the object
| being unloaded and &TS or &SN are not included and the unload method
| chosen is DB2. If the unload method chosen is HPU, this check or modification
| is not performed as HPU will detect a data set collision and fail the unload.

| Restriction: If ADBTEP2 encounters too few XML templates for the object
| being unloaded, it wll issue message ADB5224E and end
| processing.
|

Chapter 14. Using work statement lists 331


| ADB2W1S n ----------- Show Work Statement List: LOBDB ------ Row 3 to 35 of 81
| Command ===> Scroll ===> CSR
|
| Line commands:
| D - Delete I - Insert E - Edit C - Copy M - Move A - After B - Before
| R - Repeat
|
| Select Type Statement
| * *
| ------ ---- ------------------------------------------------------------------>
| ADM PARALLEL UNLOAD
| ADM JOB
| DB2 -STA DB(LOBDB) SPACE(KAVTS) ACCESS(RO)
| TSO TSODELETE 'SMITHS.DB8A.LOBDB.CNT.T0001'
| TSO TSODELETE 'SMITHS.DB8A.LOBDB.ULD.T0001'
| ADM ADMIN XMLTEMPLATE 2 DSN 'SMITHS.&SSID..&DB..&SN' UNIT(SYSDA)
| UTL TEMPLATE UTLPUNCH DSN 'SMITHS.DB8A.LOBDB.CNT.T0001'.. UNIT
| UTL TEMPLATE UTLREC DSN 'SMITHS.DB8A.LOBDB.ULD.T0001'.. UNIT S
| UTL UNLOAD DATA FROM TABLE.."SMITHS"."LOB2TB"..UNLDDN UTLREC..PUNCHDDN(
| <...more statements...>
| COM -- End of Compare Apply statements
| ******************************* END OF DB2 DATA *******************************
||
| Figure 214. Show Work Statement List: XMLDB (ADB2W1S)
|
| Related concepts
| “Using the utility template to unload data from an XML column” on page 237

Using DB2 High Performance Unload within a work statement list


When using the DB2 Admin Alter ALC and Migrate functions, you can use DB2
High Performance Unload (HPU) within a work statement list.

In addition, when using ALTER table space redefine against a single table space,
you can use HPU as the unload method.

Invoking HPU within a work statement list


Before using HPU within a work statement list, be sure to enable HPU. The main
HPU program (INZUTILB) needs to be authorized in the IKJTSOnn member of
PARMLIB.

The Migrate function has a slightly different implementation than other functions,
as the unload is performed before the work statement list is created, using regular
JCL and not under the control of the ADBTEP2 program.

For functions other than MIGRATE, you decide to use HPU when you run the
work statement list. On the Work Statement List Library panel (ADB2W1), enter
the R line command to display the HPU Unload Prompt pop-up panel
(ADB2WHPU) that indicates that an unload is being performed. At that time, you
can decide whether to use HPU.

Restriction: The following restrictions apply to using HPU:


v Do not specify HPU if an object to be unloaded in the work
statement has a security label column because the unload will fail.
| v If the WSL includes an UNLOAD statement and a template
| substitution variable is part of the unload SYSREC template, HPU
| cannot be used. DB2 UNLOAD will be used instead, and the HPU
| Unload Prompt pop-up panel (ADB2WHPU) will not be displayed.

332 User's Guide and Reference


Because using HPU is determined at run time, all work statement lists are created
using either UNLOAD or REORG UNLOAD EXTERNAL. You can select options R
or U as the unload method when creating the work statement list. Selecting the H
option does not specify that HPU will be used, but you can specify that you want
to use HPU on the HPU Unload Prompt pop-up panel (ADB2WHPU) from
ADB2W1.

You can port a work statement list from subsystem to subsystem. For example, if a
work statement list is created on a subsystem that does not have HPU enabled,
you can copy that work statement list to another subsystem that has HPU enabled.

If you do not select HPU at run time, the work statement list runs using the DB2
utility. Prior to submitting the work statement list jobs, you can choose between
the DB2 utility and HPU.

Restriction: After the run is started, the unload method cannot be changed. For
example, a job that fails using the DB2 UNLOAD utility cannot be
restarted using HPU.

When an HPU job is being run using a work statement list, partitioned table
spaces are unloaded by partition. The subsequent loading of the data is performed
in parallel when possible; otherwise, the data sets are concatenated to form a single
input stream.

Loads are performed serially in the following cases:


v When a table is loaded into a nonpartitioned table space
v When DB2 Version 7 is used
v When the number of partitions has changed
v When the partition key ranges have changed
v When an identity column appears in the partitioning index
Related concepts
“Step 12. Update the APF Authorization table” on page 67
“Step 11. Tailor the DB2 Admin Launchpad” on page 66

Using HPU with MIGRATE and work statement lists


When migrating DB2 data, the Migrate Parameters panel (ADB28M) offers the
option to specify an HPU unload.

You can specify that you want to unload the partitions in parallel. This option is
ignored if you do not choose the HPU option. The JCL that is generated directly
invokes DB2 HPU to complete the unload, as well as to create the work statement
list. Because the work statement list does not contain an unload statement, no
prompt is offered that asks whether HPU is required at run time. When the work
statement list is run, the ADBTEP2 program automatically determines if the data
was unloaded by partition and completes the appropriate steps to reload the data
accordingly.

Using HPU in a work statement list that is not created by DB2


Object Comparison Tool, ALTER, or ALC
All work statement lists that contain an UNLOAD or REORG UNLOAD
EXTERNAL statement displays the HPU Unload Prompt pop-up panel
(ADB2WHPU) at run time, provided that HPU is enabled.

Chapter 14. Using work statement lists 333


The HPU support in DB2 Admin is primarily intended to be used for a work
statement list that is created by one of the DB2 Admin or DB2 Object Comparison
Tool functions. However, if HPU is selected at run time, any eligible unload is
converted to run as an HPU unload. To be considered as an eligible unload, all of
the following statements must be true:
v The UNLOAD statement, whether it be UNLOAD or REORG UNLOAD
EXTERNAL, must have exactly one FROM TABLE clause, with no other
keywords from the utilities FROM-TABLE-spec.
v The UNLOAD data set name must not exceed 38 characters. This restriction
enables a suffix to be appended to the data set name that indicates the partition
number.
v The DDNAME that is associated with the UNLOAD data set must be SYSREC.

Restriction: Do not code HPU syntax directly in a work statement list. Use only
the DB2 utility format. When the ADBTEP2 program runs HPU on a
partitioned table space, it always unloads each partition into a
separate data set. For a work statement list that is not created using
ALTER or DB2 Object Comparison Tool, you must ensure that
subsequent handling of the output from the unload operation is
managed appropriately.

How HPU reads the DB2 catalog


DB2 High Performance Unload can directly access the DB2 catalog.

DB2 Admin does not specify the options that apply to non-externalized updates to
the catalog data in the DB2 buffer pools. You can provide this access by defining a
default in the HPU PARMLIB member using one of the following options:
v Quiesce the catalog using option QUIESCECAT=YES
v Provide direct access without flushing the DB2 buffers using QUIESCECAT=NO.
This can lead to failures.
v Specify that HPU uses DB2 to perform the catalog access using option
SQLACCES=YES.

Recommendation: Whenever possible, use the last option listed above. (This
option was provided in APAR PQ68392.)

Creating work statement lists manually


You can manually create or edit WSLs.

A benefit to manually creating a WSL is that you can use the WSL infrastructure to
control related tasks. For example, if you want to run a heavy updating batch
program, schedule an image copy, and RUNSTATS immediately after it, you could
create a WSL containing these three tasks. The benefit is that the WSL is cloned
and during execution the restart capability of ADBTEP2 is available.
Related concepts
“Coding a WSL manually” on page 308

Running work statement list entries in parallel


Within any WSL, you can edit the order (sequence) of the statements.

In addition, you can elect to run certain parts in parallel (where appropriate).
Running jobs in parallel refers to creating multiple jobs that you or a scheduling

334 User's Guide and Reference


system can run at the same time, instead of one after another. For example, you
can run the unload jobs in parallel. Some of the input processes to the WSL (for
example, from DB2 Object Comparison Tool) does this for you.

To run statement pairs in parallel, use a statement type of ADM and use the
statements PARALLEL and ENDPARALLEL, and JOB and ENDJOB.

The PARALLEL and ENDPARALLEL statements signify the start and end points
for jobs to be run in parallel. The JOB and ENDJOB card statements signify the
start and end points of WSL statements for a particular job. You should have
multiple JOB/ENDJOB pairs within a PARALLEL/ENDPARALLEL pair. WSL
statements not included in a PARALLEL/ENDPARALLEL pair are placed in a
separate job.

If you specify PARALLEL name, the members generated by RUN are suffixed by
xxxxn, where xxxx is the user ID and n is the first character of name.
ADM PARALLEL UNLOAD
ADM JOB
tasks for job1

ADM ENDJOB
ADM JOB
tasks for job2

ADM ENDJOB
ADM ENDPARALLEL
serial tasks

This example results in three jobs. The first two jobs run concurrently and the third
one runs when the first two are complete.

For multiple tables unload all the tables in parallel. When finished, run DDL to
drop and redefine then run the loads in parallel.

The loads and unloads are run in parallel to increase performance. The DDL is
done in one job to avoid DB2 locking or serialization problems.

Supplying input to the batch restart program (ADBTEP2)


The Batch Restart program (ADBTEP2) enables you to restart or resume the
execution of an input stream at an intermediate point, in the event that any one of
the statements in that stream should fail.

The process involves creating or updating a record in a checkpoint table each time
that a COMMIT statement is encountered in the input stream. By using this table,
execution can be resumed with the first statement following the last successful
commit point before the failure, bypassing all prior successfully executed
statements. Of course, before restarting after a failure, you must correct the
condition that caused the failure.

In addition to SQL statements, you can supply DB2 commands, DB2 utilities, DB2
Admin support commands, and DSN commands as input to ADBTEP2.

The following types of input to ADBTEP2 are valid:

Remember: As with all ADBTEP2 commands, the semicolon delimiter (;) is


required.

Chapter 14. Using work statement lists 335


DB2 commands
The format is -command.
Example: -DIS GROUP
DSN Commands
The following DSN commands are supported:
v BIND
v DCLGEN
v FREE
v REBIND
v RUN
DB2 Utilities
The following DB2 utilities are supported:
v CHECK
v COPY
v COPYTOCOPY
v DIAGNOSE
v LOAD
v MERGECOPY
v MODIFY
v QUIESCE
v REBUILD
v RECOVER
v REORG
v REPAIR
v REPORT
v RUNSTATS
v STOSPACE
v UNLOAD
UTILFROM Utility
The DB2 UTILFROM utility is a pseudo utility that directs ADBTEP2 to
execute the utility control statements that are contained in a data set. Only
one utility can be contained within the data set so it is not possible to
include RUNSTATS and LOAD in one UTILFROM. The purpose of the
utility is to allow the LOAD control statements generated by UNLOAD,
REORG UNLOAD, and HPU to be executed. Because UNLOAD does not
produce all the control statements required (for example, SORTNUM), you
must add them by using the ADD keyword.
The format of UTILFROM is UTILFROM dsname ADD(additional control
statements).
Example:
UTILFROM ROYC.ROYCDOC1.CNTLC.PPP2
ADD(SORTNUM 8 SORTDEVT SYSDA
WORKDDN(UTLUT1,UTLOUT) ERRDDN(UTLERR)
DISCARDDN(UTLDISC) MAPDDN(UTLMAP));
Functional comments
You can include the following functional comments:
--#SET ROWS_FETCH n
where n is a non-negative integer that indicates the maximum number
of rows to be FETCHed for each subsequent SELECT statement. Use -1
to indicate that all rows should be fetched.
--#SET ROWS_OUT n
where n is a non-negative integer that indicates the maximum number

336 User's Guide and Reference


of rows to be output for each subsequent SELECT statement. Use -1 to
indicate that all rows should be output.
--#SET TERMINATOR n
where n is a one-byte character to be used to terminate the next SQL
statement. Any character is valid, except blank, comma, single
quotation, double quotation, underscore, and parentheses.

| IBM reserves the right to use additional parameters in these functional


| comment statements. These parameters might be present in the statements
| that DB2 Admin generates for ADBTEP2. Do not modify these statements
| unless you are requested to do so by your IBM service representative.
REXX EXECS
The format is REXX execname parameters
execname can be the name of a CLIST. Programs are not supported. DB2
programs can be executed by using the DSN command RUN.
DB2 Admin support commands
The following commands are considered DB2 Admin support commands.
These commands are associated with (or support) primary commands that
are located further down in the batch statement list. For example, the
ALLOC command is used to allocate files for a program (the primary
command). Support command processing is deferred until the primary
command is encountered. Support commands must immediately precede
their primary command.
ADBSYSIN
Many programs, including ADBTEP2, use the filename (or DDNAME)
SYSIN. ADBTEP2 uses SYSIN for the batch statement list; therefore,
ADBSYSIN is used to identify the location of the input. The format is
ADBSYSIN COPYDD(ddname)
where ddname contains the SYSIN for the program following the
ADBSYSIN.
ADBPAUSE
You can use the ADBPAUSE statement to pause the current run of
ADBTEP2 or ADBTEPA at a certain point. You can then restart
ADBTEP2 and ADBTEPA at that point.
ALLOC
A TSO ALLOCATE command is issued with the parameters provided.
ALLOC is intended to support programs only. It is not a valid support
command for a DB2 utility (see TEMPLATE).
Example: ALLOC DD(DATAI001) DS('ROYC.ROYCDOC1.UNLD.PPP1') SHR
CHECKBEGIN and CHECKEND
The CHECKBEGIN and CHECKEND statements delimit a block of
CHECK DATA commands. When CHECKEND is reached, DB2 Admin
identifies the parent and children tables in RI relationships with the
table spaces that are identified in the CHECK DATA commands within
the block and generates CHECK DATA commands to clear these tables
of any CHECK-pending status. Any TSODELETE commands before the
CHECKEND are executed for all the generated CHECK DATA
commands. Any TEMPLATE commands before the CHECKEND are
supplied to the utility for all the generated CHECK DATA commands.

Chapter 14. Using work statement lists 337


Example: In the following example, the second set of TSODELETE and
TEMPLATE commands apply to the CHECK DATA commands that
might be generated for the parent and descedent tables:
CHECKBEGIN;
TSODELETE 'JIMWC.EB12.CSUT1.T0001';
TSODELETE 'JIMWC.EB12.CSOUT.T0001';
TSODELETE 'JIMWC.EB12.CSERR.T0001';
TEMPLATE UTLUT1 DSN 'JIMWC.EB12.CSUT1.T0001'
UNIT SYSDA;
TEMPLATE UTLOUT DSN 'JIMWC.EB12.CSOUT.T0001'
UNIT SYSDA;
TEMPLATE UTLERR DSN 'JIMWC.EB12.CSERR.T0001'
UNIT SYSDA;
CHECK DATA TABLESPACE DB2144.TS2144
ERRDDN(UTLERR) WORKDDN(UTLUT1,UTLOUT)
SORTDEVT SYSDA SORTNUM 4;
TSODELETE 'JIMWC.EB12.CSUT1.T0001';
TSODELETE 'JIMWC.EB12.CSOUT.T0001';
TSODELETE 'JIMWC.EB12.CSERR.T0001';
TEMPLATE UTLUT1 DSN 'JIMWC.EB12.CSUT1.T0001'
UNIT SYSDA;
TEMPLATE UTLOUT DSN 'JIMWC.EB12.CSOUT.T0001'
UNIT SYSDA;
TEMPLATE UTLERR DSN 'JIMWC.EB12.CSERR.T0001'
UNIT SYSDA;
CHECKEND;
TEMPLATE
TEMPLATE is a utility support command. ADBTEP2 passes this
command to the DB2 Utility processor. ADBTEP2 performs a partial
simulation of the DB2 TEMPLATE function for TEMPLATE names that
are not supported by DB2 (for example, SYSREC). The main difference
between DB2 allocation of templates and the simulation is at failure, as
the failure disposition is not honored. ADBTEP2 does not support
utility wild cards.
TSODELETE
A TSO DELETE command is issued for the data set provided. If the
DELETE fails, a DELETE NOSCRATCH is attempted. Processing
continues even if TSODELETE is unsuccessful.
Related concepts
“Introduction to ADBTEP2” on page 340
Related information
Chapter 15, “Using the Batch Restart programs: ADBTEP2 and ADBTEPA,” on
page 339
IBM Publications Center

338 User's Guide and Reference


Chapter 15. Using the Batch Restart programs: ADBTEP2 and
ADBTEPA
The Batch Restart program, ADBTEP2, and the Authorization Switching Program,
ADBTEPA, are used with work statement lists and the Alter and Migrate DB2 data
functions.

The Batch Restart program (ADBTEP2) enables you to restart or resume the
execution of an input stream at an intermediate point, in the event that any one of
the statements in that stream should fail. ADBTEPA allows user IDs that are not
authorized to certain objects to re-create those objects if they are implicitly
dropped.

Topics:
v “Introduction to ADBTEP2” on page 340
v “Parameters passed to ADBTEP2” on page 340
v “Using ADBTEP2” on page 343
v “Dialog support for batch job checkpoint table” on page 344
v “Restarting an ADBTEP2 job” on page 345
v “Using ADBTEP2 with LOBs” on page 348
v “Overview of ADBTEPA” on page 350
v “Using ADBTEPA” on page 351
v “Restarting ADBTEPA after a failure” on page 352
v “ADBOPT parameters” on page 352
Related concepts
“Overview of changing objects in DB2 Admin” on page 240
“Using authorization switching” on page 287
“Supplying input to the batch restart program (ADBTEP2)” on page 335
“Changing batch job utility parameters” on page 358
Related information
Chapter 13, “Migrating DB2 objects, data, and catalog statistics,” on page 291

© Copyright IBM Corp. 1995, 2010 339


Introduction to ADBTEP2
The Batch Restart program (ADBTEP2) enables you to restart or resume the
execution of an input stream at an intermediate point, in the event that any one of
the statements in that stream should fail.

The process involves creating or updating a record in a checkpoint table each time
that a COMMIT statement is encountered in the input stream. By using this table,
execution can be resumed with the first statement following the last successful
commit point before the failure, bypassing all prior successfully executed
statements. Of course, before restarting after a failure, you must correct the
condition that caused the failure.

Input types

ADBTEP2 can run the following elements from an input stream (SYSIN):
v SQL statements
v DB2 utilities
v DB2 commands
v DSN commands (including RUN)
v REXX EXECS or CLISTS

This input stream is referred to as a batch statement list.

Checkpoint table

ADBTEP2 is generally used in jobs that are generated by DB2 Admin, but it can
also be used independently. The checkpoint table is a shared resource, and is
named ADBCHKPT. You can determine the qualifier of this table by using the
ADBTEP2 package associated with the plan that you are running (ADBTEP2 by
default). ADBTEP2 adds and maintains a row in the checkpoint table. This row in
the checkpoint table is referenced by a worklist name parameter that is supplied to
ADBTEP2. The worklist name parameter is used in conjunction with the user ID of
the submitter (to ensure uniqueness). The worklist name parameter is created
when the JCL is generated by DB2 Admin functions and uses the work statement
list name concatenated with an optional suffix.

The checkpoint table is updated at commit points to enable restarting. ADBTEP2


always performs implicit commits before and after performing functions other than
SQL (for example, a DB2 utility). To issue a commit between SQL statements, add
an SQL COMMIT statement. You can also instruct ADBTEP2 to commit after every
statement by using the commit_all ADBOPT parameter.
Related concepts
“Supplying input to the batch restart program (ADBTEP2)” on page 335
“Step 4. Binding application packages and plans” on page 34

Parameters passed to ADBTEP2


When DB2 Admin generates the JCL to run ADBTEP2, parameters are generated
automatically and are passed to ADBTEP2.

The following parameters are generated automatically and are passed to ADBTEP2:

340 User's Guide and Reference


| BINDERROR(MAXE, SAVE, IGNORE)
| Specifies how BIND or REBIND errors that are processed by ADBTEP2 are to
| be handled.
| MAXE
| The failing BIND or REBIND command is written to the ADBHOLD table.
| The value that is specified for the MAXE parameter determines whether
| ADBTEP2 continues to process the input stream:
| If MAXE(0) is specified or if MAXE() is omitted, processing stops.
| If MAXE(-1) is specified, processing continues.
| If a value greater than 0 is specified for MAXE, the MAXE counter is
| incremented by 1, and processing stops if the number of errors has
| exceeded the maximum number of allowed failures.
| SAVE
| The failing BIND or REBIND command is written to the ADBHOLD table.
| ADBTEP2 continues to process the input stream.
| IGNORE
| The failing BIND or REBIND command is ignored and is not written to the
| ADBHOLD table. ADBTEP2 continues to process the input stream.
MAXE(-1, 0, 1-99)
Specifies the number of DSN commands that can fail before the batch job is
terminated:
-1 All errors are ignored. The batch job is not stopped for any error.
0 No errors are allowed. The batch job is stopped on the first error.
1-99
The specified number of errors are ignored. The batch job is stopped on
the next DSN command that fails. For example, if you specify 5, the batch
job is stopped when the 6th DSN command fails.

Any failing DSN command statements that are ignored are skipped and are
written to the ADBHOLD table. When the job ends, if any DSN commands
have failed, the restart action field in the checkpoint table contains an 'H' to
indicate that there are held records. When RESTART(YES) is specified, the held
records are reprocessed if the batch job ended with a return code of 0;
otherwise, the job is restarted from the last recorded commit point. When
RESTART(NO) is specified, the held records are purged and the job is restarted
from the beginning.
RESTART
RESTART(NO)
Indicates that ADBTEP2 does not perform a restart, and execution starts
with the first command. The WORKLIST() parameter must be used with
this option and ADBTEP2 updates the checkpoint table. A subsequent
restart can be performed by using RESTART(YES).
RESTART(YES)
Indicates that the job is to be restarted from the last recorded commit point
prior to a failure (this is the default). If RESTART(YES) is specified or used
as a default, you must also provide the WORKLIST() parameter. When
execution begins, ADBTEP2 searches for a checkpoint row in the
checkpoint table and repositions within the input, skipping over committed
commands.

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA 341
RESTART(YES) causes a very basic check to be done. RESTART(YES)
checks that the last command type held in the checkpoint record matches
the command type to be attempted at restart. This is to prevent an
accidental reuse of a checkpoint against a completely different WSL.

Recommendation: Exercise caution when editing the input stream between


ADBTEP2 failures. If the checkpoint record is not
found, ADBTEP2 starts with the first command in the
input stream.
| RESTART(FORCE)
| As with RESTART(YES), RESTART(FORCE) restarts at the last commit
| point prior to a failure. You must also provide the WORKLIST() parameter.
| However, the basic check done in RESTART(YES) is not done in
| RESTART(FORCE). Because the basic check is not done, the restart point
| might be unintended and the results might be unpredictable.
| If the COMMAND_RESTART column in the ADBCHKPT table has a value
| of 'S' upon the restart processing, the check for the checkpoint record is not
| performed. And, if the checkpoint dialog Skip-Next line command is used,
| the check is not performed
| AC
| Certain SQL or utility operations can place an object into check-pending state.
| If you set the Autocheck (AC) parameter value to YES, ADBTEP2 will track the
| statements and processes listed below that can place an object in
| check-pending. If one is encountered, ADBTEP2 will perform an automatic
| CHECK DATA to remove the check-pending state. The default value for AC is
| NO.
| ADBTEP2 tracks the following statements:
| ALTER TABLE ... ADD FOREIGN KEY
| ALTER TABLE .... ADD CONSTRAINT
| LOAD REPLACE
| LOAD ENFORCE(NO)
| RECOVER PIT

| ADBTEP2 tracks the following processes:


| COPY utility - perform auto-check prior to COPY
| CHECK DATA utility – perform auto-check after CHECKEND
| A final auto-check at the end of the SYSIN input stream

| Restriction: DB2 Admin builds the CHECK DATA statement and all CHECK
| parameters used during auto-check processing. You cannot specify
| any other parameters.
WORKLIST(extended-name)
extended-name is a unique identifier that is used in conjunction with the user ID
of the submitter to provide the key for the checkpoint record. The full format
of extended-name is: name.suffix
where name includes between 1 and 8 alphanumeric characters, and suffix
includes between 1 and 8 alphanumeric characters. The separator must be a
period (.). The suffix is optional, but if omitted, the separator must also be
omitted.
For jobs that DB2 Admin generates, name is the same as the work statement
list.
Examples:

342 User's Guide and Reference


WORKLIST(TEST1)
Simple worklist name
WORKLIST(TEST2.N00005)
Worklist including suffix

The following parameters are passed to ADBTEP2 and are used to control
non-restart functions:
ALIGN
ALIGN(MID)
Aligns output from the program to the center of the page. This is the
default.
ALIGN(LHS)
Aligns output from the program to the left-hand side of the page.
MIXED
MIXED
Indicates that the input stream can contain data in a combination of SBCS
and DBCS formats.
NOMIXED
Indicates that the input stream will contain data in SBCS format only. This
is the default.
| PCACT
| Specifies the action to take when the job is to recover a change made through
| Change Management and there are pending changes that affect the same
| objects or related objects as the change.
| PCACT(CANCEL)
| Indicates that the recover job will not be run.
| PCACT(SUPERSEDE)
| Indicates that the recover job will be run. The recover change supersedes
| the pending changes, and the pending changes are set to DEFINED status.
SQLTERM(c)
c defines the character that terminates an SQL statement. The default
termination character is the semicolon (;).
SSID(name)
A subsystem or group attachment name to be used for running non-SQL
commands or functions. This name should be the same as that used in the
DSN SYSTEM(xxxx), which is used ahead of the RUN command that invokes
ADBTEP2. This parameter is mandatory if any non-SQL DB2 function is
included in the input stream (for example, a DSN command).
Related concepts
“Changing batch job utility parameters” on page 358

Using ADBTEP2
SADBSAMP(ADBTEP2R) contains a sample job that you can use to run ADBTEP2,
the Batch Restart program.

Prerequisite: ADBTEP2 is used only if the auth-switching function is enabled.

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA 343
You must modify this job to conform to the conventions established in your
installation and to provide the input data stream for execution (also referred to as
the batch statement list).

The batch statement list can be specified inline, as a sequential data set, or as a
member of a partitioned data set. It should contain all of the SQL statements, DB2
commands, utility control statements, and other valid statements that you want to
process in a single execution. Within this series of statements, be sure to separate
logical tasks or units of work with a COMMIT statement. These denote the points
at which a failed execution can be restarted. Non-SQL functions have implicit
commits, both before and after them.

Because all ADBTEP2 jobs are restartable, it is recommended that the worklist
parameter is specified and provides a unique name. The RESTART parameter can be
set to either YES or NO or used as default (YES), depending on whether the
submission of the job is required to restart. ADBTEP2 is restartable regardless of
the RESTART option. A job that is run with RESTART(NO), can be resubmitted with
RESTART(YES) in the event of a failure. When you have specified the parameters,
submit the JCL for execution.

If the execution completes successfully, nothing more needs to be done. Upon


successful completion, both ADBTEP2 and ADBTEPA delete the checkpoint record.

If the execution is unsuccessful, examine the output to determine the reason for the
failure. Correct the error and resubmit the job.
Related concepts
“Step 1. Create the checkpoint table” on page 31

Dialog support for batch job checkpoint table


To display and manage the checkpoint table (ADBCHKPT) associated with batch
jobs running ADBTEP2, use the 2B–Display/Manage Batch Checkpoint Table
option on the DB2 System Administration panel (ADB2Z).

For each active batch job running ADBTEP2 and for jobs running ADBTEP2 that
have terminated because of an error in the input stream, a record of that execution
is present in the checkpoint table. Select option 1, Display Checkpoint Records,
from the Manage Batch Job Checkpoint Table panel to see those records, terminate
an active ADBTEP2 job, update or delete the record of an abnormally terminated
job, or insert a new checkpoint record.

Important: A new checkpoint record is only inserted to replace one that was
deleted accidentally.
In addition, you can instruct ADBTEP2 to skip to the next commit using the N line
command (skip-next).

Select option 2, Display Checkpoint Table Status, to obtain information about the
checkpoint table itself, and issue any requests against the table, such as GRANT or
REVOKE, that are supported by DB2 Admin.

344 User's Guide and Reference


Related concepts
“System Administration panel” on page 380
“Restarting an ADBTEP2 job”

Restarting an ADBTEP2 job


When ADBTEP2 runs, it checks to see if a record exists within the checkpoint table
that matches the worklist parameter for the user ID that submitted the job.

If a record does not exist, ADBTEP2 creates it and starts with the first statement in
the batch statement list. If a record exists, ADBTEP2 proceeds based on the RESTART
parameter. When RESTART(NO) is specified, ADBTEP2 starts with the first statement
in the batch statement list. When either no RESTART parameter is provided or
RESTART(YES) is specified, ADBTEP2 repositions itself within the batch statement
list and resumes processing.

ADBTEP2 has a simple restart capability. When the failing statement is SQL, a
restart occurs at the last commit point prior to the failing SQL statement, which
can be either an SQL COMMIT statement or an implicit commit that is performed
while successfully completing a non-SQL function, such as a DB2 command.

Tip: It is important to avoid causing ADBTEP2 to reposition incorrectly when


editing the batch statement list between runs. If the only change you require
is to skip to the next commit instruction, use the N (skip-next) line command
instead of editing the input to ADBTEP2. For an example of using the N
(skip-next) line command, see the following figure.

If the failing statement is not an SQL statement, ADBTEP2 repositions to this


statement. It is possible, although not likely, for the job to fail after executing
non-SQL statements and before ADBTEP2 can update and commit the checkpoint
record. In this case, ADBTEP2 positions on this non-SQL statement. Non-SQL
statements cannot be rolled back if a failure occurs during ADBTEP2
checkpoint/commit. If you determine that the non-SQL statement completed, you
can instruct ADBTEP2 to skip this statement on restart by using the N (skip-next)
line command. ADBTEP2 reports the successful implicit commits that it performs
before and after non-SQL statements. You can also determine whether ADBTEP2
failed on non-SQL statements by viewing the checkpoint record: the Restart
Command field is blank if an SQL COMMIT was the last commit or if the last
commit was an implicit commit as a result of completing a non-SQL statement. If
the last commit was an implicit commit ahead of non-SQL statements, the Restart
Command field is set to the type of non-SQL statement (for example, -STA).

If ADBTEP2 determines that a utility was running at the time of failure, ADBTEP2
obtains information from DB2 (if the utility is known to DB2) and restarts
accordingly.

The following figure illustrates the checkpoint for the job with worklist DOC1.
Because the Restart Command field is blank, we can determine that the last
instruction performed was either an SQL COMMIT or a non-SQL statement that
completed with an implicit commit. If we issue an N (skip-next) line command,
Figure 216 on page 346 is displayed. The checkpoint number has been increased by
one.

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA 345
DB2 Admin ---------- DB2X Display Batch Job Checkpoint Table - Row 1 to 4 of 4
Command ===>

DB2 System: DB2X


DB2 SQL ID: ISTJE
Checkpoint Table: ADB4BASE.ADBCHKPT

Line commands:
D - Delete/Terminate I - Insert U - UpdateN - Skip-Next
Commit Restart Restart
S Userid Worklist Suffix Time Number Command Action
* * * * * *
- -------- -------- -------- ---------------> ----------- ----------- ------
n ROYC DOC1 2002-07-18-16.06 4
VNDBRON RI03 2002-07-10-16.19 2
VNDOJFK OBJCMP 2002-06-26-16.54 1
VNDROTH AAA 2002-06-26-07.36 1 COPY C
******************************* END OF DB2 DATA *******************************

Figure 215. Display Batch Job Checkpoint Table panel (ADB2Z2B1) – using the Skip-Next
line command

DB2 Admin ---------- DB2X Display Batch Job Checkpoint Table - Row 1 to 4 of 4
Command ===>

DB2 System: DB2X


DB2 SQL ID: ISTJE
Checkpoint Table: ADB4BASE.ADBCHKPT

Line commands:
D - Delete/Terminate I - Insert U - UpdateN - Skip-Next
Commit Restart Restart
S Userid Worklist Suffix Time Number Command Action
* * * * * *
- -------- -------- -------- ---------------- ----------- ----------- ------
ROYC DOC1 2002-07-18-16.06 5 UNKNOWN N
VNDBRON RI03 2002-07-10-16.19 2
VNDOJFK OBJCMP 2002-06-26-16.54 1
VNDROTH AAA 2002-06-26-07.36 1 COPY C
******************************* END OF DB2 DATA *******************************

Figure 216. Display Batch Job Checkpoint Table panel (ADB2Z2B1) – result of the Skip-Next
line command

In Figure 217 on page 347, DOC2 has a Restart Command value that indicates that a
COPY statement failed. The value in the Restart Action field determines the
action to occur when ADBTEP2 repositions. For utilities, the value can be:
C Restart current (ADBTEP2 default)
P Restart phase
R Restart from the beginning of the utility
S Skip running the utility

The value in the Restart Action field can also be 'H', which indicates that the
ADBHOLD table contains failed DSN commands. These failed DSN commands can
be reprocessed when the job is restarted with RESTART(YES).

The U line command (Update) on this panel can be used to change the restart
option for utilities. For example, you can change the C to an R. For non-SQL
statements, only the options S (skip) and R (rerun or reissue) are valid.

346 User's Guide and Reference


Figure 218 shows the result of using the N (skip-next) line command against DOC2.
The restart command is now S and the commit number has not been increased.
The Restart Command still displays the original type of the failing command, in this
case COPY, as opposed to Figure 216 on page 346, which shows the command as
UNKNOWN.

DB2 Admin ---------- DB2X Display Batch Job Checkpoint Table - Row 1 to 4 of 4
Command ===>

DB2 System: DB2X


DB2 SQL ID: ISTJE
Checkpoint Table: ADB4BASE.ADBCHKPT

Line commands:
D - Delete/Terminate I - Insert U - UpdateN - Skip-Next
Commit Restart Restart
S Userid Worklist Suffix Time Number Command Action
* * * * * *
- -------- -------- -------- ---------------- ----------- ----------- ------
n ROYC DOC2 2002-07-18-16.16 5 COPY C
VNDBRON RI03 2002-07-10-16.19 2
VNDOJFK OBJCMP 2002-06-26-16.54 1
VNDROTH AAA 2002-06-26-07.36 1 COPY C
******************************* END OF DB2 DATA *******************************

Figure 217. Display Batch Job Checkpoint Table panel (ADB2Z2B1) – reissuing the Skip-Next
line command

DB2 Admin ---------- DB2X Display Batch Job Checkpoint Table - Row 1 to 4 of 4
Command ===>

DB2 System: DB2X


DB2 SQL ID: ISTJE
Checkpoint Table: ADB4BASE.ADBCHKPT

Line commands:
D - Delete/Terminate I - Insert U - UpdateN - Skip-Next
Commit Restart Restart
S Userid Worklist Suffix Time Number Command Action
* * * * * *
- -------- -------- -------- ---------------- ----------- ----------- ------
ROYC DOC2 2002-07-18-16.16 5 COPY S
VNDBRON RI03 2002-07-10-16.19 2
VNDOJFK OBJCMP 2002-06-26-16.54 1
VNDROTH AAA 2002-06-26-07.36 1 COPY C
******************************* END OF DB2 DATA *******************************

Figure 218. Display Batch Job Checkpoint Table panel (ADB2Z2B1) – result of reissuing the
Skip-Next line command

Related concepts
“Using ADBTEPA” on page 351
“Dialog support for batch job checkpoint table” on page 344

| The ADBTEP2 summary report


| You might want a summary report of all activity at the end of or during large or
| complex work statement list (WLS) runs. This report will enable you to quickly
| spot any object or data availability issues. The ADBTEP2 summary report appears
| (and grows) while any ADBTEP2 job is running, not just WSLs.

| The report can be examined in SDSF, under the ADBRPTSM DD. A sample report
| is shown below.
|

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA 347
| 13:13.31 DB2 Administration Tool - 2009-09-17 Summary Report for L655527D
| 13:13.31
| 13:13.31 Ret Code Action Object
| 13:13.31 ======== ======== ====================================================
| 13:13.32 0 UNLOAD TABLESPACE DBADKK01.TSADKK01 FROM TABLE "VNDDHG"."TB
| 89740"
| 13:13.34 0 DROP TABLESPACE "DBADKK01"."TSADKK01"
| 13:13.37 562 GRANT USE OF STOGROUP SYSDEFLT TO USRT001
| 13:13.37 562 GRANT USE OF STOGROUP SYSDEFLT TO "PUBLIC"
| 13:13.39 0 CREATE TABLESPACE TSADKK01
| 13:13.39 0 CREATE TABLE VNDDHG.RN89740
| 13:13.39 562 GRANT USE OF STOGROUP SYSDEFLT TO "PUBLIC"
| 13:13.39 0 CREATE TABLESPACE TSADKK01
| 13:13.39 0 CREATE TABLE VNDDHG.RN89740
| 13:13.42 0 CREATE UNIQUE INDEX "VNDDHG"."D7762_INDEX" ON "VNDDHG"."RN8
| 9740"
| 13:13.42 0 CREATE UNIQUE INDEX VNDDHG.D7762_INDEX1 ON VNDDHG.RN89740
| 13:13.42 0 CREATE VIEW VNDDHG.VW_TEACHER
| 13:13.42 -204 DROP TRIGGER VNDDHG.INSOF_VIEW_TRIG01
| 13:13.42 0 CREATE TRIGGER VNDDHG.INSOF_VIEW_TRIG01
| 13:13.44 4 UTILFROM VNDDHG.L655527D.CNC.T001
| 13:13.45 0 ALTER TABLE "VNDDHG". "RN89740" ALTER COLUMN "TEACHER_ID"
| SET GENERATED ALWAYS
| 13:13.45
| 13:13.45 End of Summary Report
|
|
| Figure 219. ADBTEP2 summary report
|

| Using ADBTEP2 with LOBs


| If the UNLOAD statement is preceded with a LOB template, the UNLOAD
| statement input is modified by ADBTEP2 before it is passed to DB2 or High
| Performance Unload (HPU) so ADBTEP2 can unload LOB columns.

| These modifications might be obvious only by examining the job log (SDSF
| output). The following example is a sample job log that shows JCL that is modified
| by ADPTEP2.
|

348 User's Guide and Reference


| ***************************** Top of Data ******************************
| //SMITHSD JOB (SMITHS,X,090,IE1A),'DB2 UTILITY',
| //* RESTART=STEPNAME, <== FOR RESTART REMOVE * AND ENTER STEP NAME
| // REGION=0M,NOTIFY=SMITHS,
| // MSGCLASS=H,
| // CLASS=A
| //*
| /*JOBPARM S=SY4A
| //*
| //*
| //**********************************************************************
| //*
| //* DB2 BATCH MONITOR
| //*
| //* DB2 ADMIN GENERATED BATCH JOB.
| //*
|
|
|
| //************************************************************ADB2WL4**
| //DB2B EXEC PGM=IKJEFT01,DYNAMNBR=100
| //STEPLIB DD DISP=SHR,DSN=DSN810.SDSNEXIT
| // DD DISP=SHR,DSN=DSN810.SDSNLOAD
| //MSGLIB DD DISP=SHR,DSN=ADB720.SADBLLIB
| // DD DISP=SHR,DSN=GOC720.SGOCLLIB
| // DD DISP=SHR,DSN=DMTOOL.ADB720.SADBLLIB
| // DD DISP=SHR,DSN=DMTOOL.GOC720.SGOCLLIB
| //SYSTSPRT DD SYSOUT=*
| //SYSPRINT DD SYSOUT=*
| //UTPRINT DD SYSOUT=*
| //RNPRIN01 DD SYSOUT=*
| //ADBDIAG DD SYSOUT=*
| //SYSTSIN DD *
| DSN SYSTEM(DB8A)
| RUN PROGRAM(ADBTEP2) PLAN(CMDBKAT) -
| LIB('ADB720.SADBLLIB') -
| PARMS('/WORKLIST(TB2LOBS) SSID(DB8A) -
| RESTART(YES)')
| END
| //SYSIN DD *
| -- EDITED BY SMITHS ON 2007/09/30 AT 02:28
| -- EDITED BY SMITHS ON 2007/09/30 AT 02:10
| -- Created by SMITHS on 2007/09/30 at 02:06:58.45
| TSODELETE 'SMITHS.DB8A.CNTL.LOB2DB.KAV2TS';
| TEMPLATE UTLPUNCH DSN 'SMITHS.DB8A.CNTL.LOB2DB.KAV2TS'
| UNIT SYSDA;
| TSODELETE 'SMITHS.DB8A.UNLD.LOB2DB.KAV2TS';
| TEMPLATE UTLREC DSN 'SMITHS.DB8A.UNLD.LOB2DB.KAV2TS'
| UNIT SYSDA;
| ADMIN LOBTEMPLATE ADBL1 DSN 'SMITHS.&SSID..&DB..&SN..''
| UNIT SYSDA;
| ADMIN LOBTEMPLATE ADBL2 DSN 'SMITHS.&SSID..&DB..&SN..'
| UNIT SYSDA;
| UNLOAD TABLESPACE LOB2DB.KAV2TS
| FROM TABLE
| "SMITHS"."LOB2TB"
| PUNCHDDN(UTLPUNCH)
| UNLDDN(UTLREC);
| /*
||
| Figure 220. Sample JCL job Log
|
| ADBTEP2 makes the following changes (shown in bold) before passing the JCL to
| DB2 for processing.
| 1. The ADMIN LOBTEMPLATE is replaced by TEMPLATE.
| 2. The UNLOAD syntax is modified.
|

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA 349
| TSODELETE 'SMITHS.DB8A.CNTL.LOB2DB.KAV2TS';
| TEMPLATE UTLPUNCH DSN 'SMITHS.DB8A.CNTL.LOB2DB.KAV2TS'
| UNIT SYSDA;
| TSODELETE 'SMITHS.DB8A.UNLD.LOB2DB.KAV2TS';
| TEMPLATE UTLREC DSN 'SMITHS.DB8A.UNLD.LOB2DB.KAV2TS'
| UNIT SYSDA;
| TEMPLATE ADBL1 DSN 'SMITHS.&SSID..&DB..&SN..'
| UNIT SYSDA;
| TEMPLATE ADBL2 DSN 'SMITHS.&SSID..&DB..&SN..'
| UNIT SYSDA;
|
| UNLOAD TABLESPACE LOB2DB.KAV2TS
| FROM TABLE
| "SMITHS"."LOB2TB"
| (C2REGULAR,
| C3LOBCOL VARCHAR(255) CLOBF ADBL1,
| C4LOBCOL VARCHAR(255) CLOBF ADBL2)
| PUNCHDDN(UTLPUNCH)
| UNLDDN(UTLREC);
||
| Figure 221. ADBTEP changes to job
|
| Related concepts
| “Using the utility template to unload data from LOBs” on page 236
| “Running WSL with the utility template for LOBs” on page 329

Overview of ADBTEPA
ADBTEPA is used by DB2 Admin functions such as ALC (alter table columns).

ADBTEPA allows user IDs that are not authorized to certain objects to re-create
those objects if they are implicitly dropped.

For example, the owner of a table performs an alter to the table that requires
dropping and re-creating the table, any views on this table are also dropped. The
table owner might not have the authority to re-create some or all of the views.
ADBTEPA allows the owner to re-create these views.

The ADBTEPA program receives SQL as input from SYSIN (a batch statement list)
and executes it. In many respects, it is similar to ADBTEP2. For example, they both
use a checkpoint table to record progress through the batch statement list.
ADBTEPA and ADBTEP2 can share the same checkpoint table because the table
definition is identical.

The ADBTEPA program is intended for use with the DB2 Admin authorization
switching function.

Once enabled, ADBTEPA is used by some functions, even if you do not request the
function. ADBTEPA always allows you to perform the same tasks using SQL that
you can perform under your own authorization.

Using ADBTEPA is optional; however, ADBTEPA is required when you use DB2
Admin authorization switching.

Prerequisite: You must enable authorization switching on your DB2 subsystem


before you can use ADBTEPA.

350 User's Guide and Reference


Related tasks
“Step 22. Tailor DB2 Admin Authorization Switching” on page 71

Using ADBTEPA
DB2 Admin generates JCL for ADBTEPA when DB2 Admin authorization switching
is enabled.

Prerequisite: ADBTEP2 is used only if the auth-switching function is enabled.

The JCL can vary slightly. A user can request an authorization switch by specifying
a user ID in the authorization switch ID field on the Alter Parameters panel.
Specifying <NONE> indicates that no DB2 Admin authorization switching is
requested.

The following figure illustrates an example in which DB2 Admin authorization


switching has not been requested, but has been enabled on the subsystem.

//CREAT80 EXEC PGM=ADBTEPA,DYNAMNBR=100,


// PARM='/SSID(DSN7),WORKLIST(GO)'
//STEPLIB DD DISP=SHR,
// DSN=DMTOOL.SADBLINK
// DD DISP=SHR,DSN=DSN.DSN7.SDSNEXIT
// DD DISP=SHR,DSN=DSN.DSN7.SDSNLOAD
//SYSTSPRT DD SYSOUT=*
//ADBPRINT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//ADBOPT DD *
PLAN=ADBTEPA
//*AUTH_SWITCH_USERID=
//SYSIN DD DISP=SHR,DSN=ROYC.GO.DDL.CONVMERG
//*

Figure 222. DB2 Admin authorization switching example – enabled on subsystem

ADBTEPA, unlike ADBTEP2, is executed directly and not from within DSN under
IKJEFT01. Consequently, the SSID PARM is required to identify the DB2 subsystem
on which to run. Similarly, the plan that ADBTEPA uses must also be supplied
using the ADBOPT DDNAME. ADBTEPA uses the RRSAF attachment to access
DB2.

The following figure illustrates the case where an authorization switch ID has been
requested to ADBAUTHS.

//CREAT80 EXEC PGM=ADBTEPA,DYNAMNBR=100,


// PARM='/SSID(DSN7),WORKLIST(GO)'
//STEPLIB DD DISP=SHR,
// DSN=DMTOOL.SADBLINK
// DD DISP=SHR,DSN=DSN.DSN7.SDSNEXIT
// DD DISP=SHR,DSN=DSN.DSN7.SDSNLOAD
//SYSTSPRT DD SYSOUT=*
//ADBPRINT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//ADBOPT DD *
PLAN=ADBTEPA
AUTH_SWITCH_USERID=ADBAUTHS
//SYSIN DD DISP=SHR,DSN=ROYC.GO.DDL.CONVMERG

Figure 223. DB2 Admin authorization switching example – authorization switch requested

In this example, the ID requested was specified using the ADBOPT DDNAME.

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA 351
ADBTEPA requires that only APF-authorized libraries appear in the STEPLIB,
unless ADBTEPA is placed in the link list.

When DB2 Admin authorization switching is enabled, the batch statement list
includes system-generated comments near the start of input and after some SQL
statements. Do not remove or alter these comments.
Related concepts
“Restarting an ADBTEP2 job” on page 345
Related tasks
“Step 22. Tailor DB2 Admin Authorization Switching” on page 71

Restarting ADBTEPA after a failure


ADBTEPA is restartable in the same way as ADBTEP2.

If it fails, you can change, add, or remove the ADBOPT parameter,


AUTH_SWITCH_USERID=. Using AUTH_SWITCH_USERID= implicitly causes checkpoints to
be taken after every statement, even across restarts.

Recommendation: Exercise caution in modifying the batch statement list after a


failure. To skip the SQL statement that fails, use the Skip-Next
line command within option Z.2B, as opposed to updating the
checkpoint record or the batch statement list.
Related reference
“ADBOPT parameters”

ADBOPT parameters
ADBOPT parameters are specified using the DDNAME ADBOPT.

Place the options one-per line, and always use uppercase.

ADBOPT parameters for ADBTEP2 and ADBTEPA are listed in the following table:
Table 19. ADBOPT parameters for ADBTEP2 and ADBTEPA
Parameter Default Usage ADBTEP2 ADBTEPA
AUTH_SWITCH_USERID= None User ID to N/A (Return Optional
provide authority Code 12 is
to perform SQL issued)
operations.
PLAN= None Plan that N/A Mandatory
ADBTEPA is to (Ignored)
use.

352 User's Guide and Reference


Table 19. ADBOPT parameters for ADBTEP2 and ADBTEPA (continued)
Parameter Default Usage ADBTEP2 ADBTEPA
COMMIT_ALL= N Commit/ Optional Optional (Ignored if
checkpoint mode: AUTH_SWITCH_USERID= is
Y commits after specified)
every statement.
N commits before
and after
non-SQL, or
COMMIT
statements. After
setting this option
to Y, it persists
across restarts.
ADB2UTIL= ADB2UTIL Allows alternative Optional N/A (Ignored)
name for program
ADB2UTIL

Related concepts
“Restarting ADBTEPA after a failure” on page 352

Pausing ADBTEP2 and ADBTEPA


You can use the ADBPAUSE statement to pause the ADBTEP2 and ADBTEPA
programs at a certain point.

To restart ADBTEP2 or ADBTEPA after an ADBPAUSE statement, submit the


program again with the RESTART(YES) parameter (either explicitly or by default).
The program restarts at the statement that immediately follows the ADBPAUSE
statement. If you submit the program using the RESTART(NO) parameter,
processing starts at the first statement in the batch statement list.

Chapter 15. Using the Batch Restart programs: ADBTEP2 and ADBTEPA 353
354 User's Guide and Reference
Chapter 16. Running DB2 utilities
You can use the U.x line command to run DB2 Administration Tool utilities.

You can use the U.x line command on several panels to quickly generate utility job
streams.

Topics:
v “Using table space utilities” on page 356
v “Using table utilities” on page 362
v “Using index utilities” on page 365
v “Running utilities on LISTDEFs” on page 368
v “Using offline utilities” on page 369
v “Running utilities on LISTDEFs” on page 368
Related reference
“DB2 Admin line commands” on page 617

© Copyright IBM Corp. 1995, 2010 355


Using table space utilities
Use table space utilities to generate JCL for the utilities that can be run against
table spaces.

To display the Table Space Utilities panel, use one of the following commands:
v UTL line command on the Tables Spaces panel (ADB21S). This command allows
you to generate utilities for a particular table space.
v UTIL primary command on the Tables Spaces panel (ADB21S). This command
allows you to generate utilities for all of the table spaces that are displayed.
v UTIL primary command on the Databases panel (ADB21D). This command
allows you to generate utilities for all of the table spaces in the databases that
are displayed.
If you want to have the utilities performed against a LISTDEF control statement
of all the tables spaces in the database, specify UTIL LISTDEF.

Use the Table Space Utilities panel to generate JCL for the utilities that can be run
against table spaces. When the JCL is generated, DB2 Admin invokes ISPF edit,
which lets you change the JCL, submit it, and copy it to another data set. The
following figure shows the Table Space Utilities pane after the UTL line command
has been issued.

| ADB2US in ------------------ DB2X Table Space Utilities ----------------- 11:15


| Option ===>
|
| Execute utility on DB2 System: DSN9
| table space DSN08639.T DB2 SQL ID: VNDMPM2
|
| C - Copy full CI - Copy incremental C2 - Copytocopy
| CC - Copy concurrent
| E - Mergecopy EN - Mergecopy newcopy
| K - Check index KD - Check data KL - Check LOB
| M - Modify NW - Repair Auxwarn NX - Repair Auxcheckpend
| N - Repair nocopypend NA - Repair nocheckpend NB - Repair norcvrpend
| NL - Repair Levelid NR - Repair noreorgpend
| O - Reorg OU - Reorg unload only OO - Online reorg
| OC - Reorg w/Inline Copy
| P - Report recovery Q - Quiesce
| R - Runstats RT - Runstats table all RR - Runstats report
| RX - Runstats (to invalidate dynamic cache)
| V - Recover VC - Recover tocopy VG - Recover to last GDG
| VI - Rebuild index VR - Recover torba VL - Recover logonly
| DG - Define GDG for copy data sets VP - Recover tologpoint
| U - Unload
|
|
| BP - Change batch job parameters
| TU - Specify Template Usage
|
| Utility control options:
| Review/change options : YES (Yes/No)
| Generate work statement list : NO (Yes/No)
| Generate template statements : NO (Yes/No)
| Generate modify after copy : NO (Yes/No)
||
| Figure 224. Table Space Utilities panel (ADB2US) after issuing the UTL line command
|
When you display the Table Space Utilities panel using the UT line command (as
opposed to the UT primary command), it contains an additional option, NL, to set
the level identifier. The Specify Utilities Options - REPAIR LEVELID panel
(ADB2USN) is displayed with option 4 filled in for you. Press Enter to view the

356 User's Guide and Reference


generated JCL in an ISPF edit session. If you scroll down, you can see that the
generated REPAIR LEVELID utility control statement exists.

The following options help you to control and vary the output JCL from the utility:
BP
Enables you to change the default JOB card statements and other system
parameters.
TU
Enables you to select templates to use for utility JCL and work statement list
output.
Generate template statements
Use this field to enable or disable the use of templates.
When you specify the CHECK utility, templates are used regardless of the
value of this field because the CHECK utility function requires the use of
templates. Either the default templates or the templates that you specify are
used.
| When you specify Yes to enable the use of templates, DB2 Admin does not
| generate any TSODELETE statements, which would ensure that any existing
| data sets for the template are deleted first. To ensure that any existing data sets
| are deleted, consider using one of the following techniques when you define
| the template:
| v Specify the data set name pattern as a GDG (generation data group) where
| the next data set in the sequence is generated (+1), and change the other
| common options so that the GDGLIMIT is 1. This setup will cause the data
| sets in the group to roll off so that only one data set exists at any one time.
| For example, a data set pattern name might be specified as
| &db..&ts..&name..ic(+1).
| v Change the other common options to specify a DISP option of NEW,
| DELETE, DELETE for the data set, if appropriate.
Generate work statement list
Specify Y to request that the utility control statements be added to a work
statement list. Specify N to request an executable utility jobstream.
When you specify the CHECK utility, a batch statement list, which is similar to
a work statement list, is generated regardless of the value of this field. The
batch statement list is required as an input file to the Batch Restart (ADBTEP2)
program, which manages the CHECK utility function.
Generate modify after copy
Specify Y to request that utility JCL be generated to run the MODIFY utility
after a full image copy is generated. Specify N to suppress the generation of a
job step to run the MODIFY utility after a full image copy.
When you specify the CHECK utility, a batch statement list, which is similar to
a work statement list, is generated regardless of the value of this field. The
batch statement list is required as an input file to the Batch Restart (ADBTEP2)
program, which manages the CHECK utility function.

Refer to the online help for detailed information about other options available in
this panel.

Tip: When you run the COPY utility, the default is that one copy is written to the
data set that is described by the SYSCOPY DD statement. If you want more

Chapter 16. Running DB2 utilities 357


than one copy of the output, you can create and use templates for the utility
data sets COPYDDN 1, COPYDDN2, RECOVERYDDN1, and
RECOVERYDDN2.

DB2 Admin supports unloading table (spaces) that produce a record length of less
than 32K. When a table (space) with LOB objects is unloaded, it is possible that the
required record length exceeds 32K. In this case, you must modify the unload job
or WSL to specify the utility statements and parameters that allow unloading the
table (space).
Related tasks
“TEMPLATE usage” on page 234
Related information
“Managing TEMPLATEs” on page 226

Editing generated JCL


Use the Edit Generated JCL panel to edit the JCL you have generated.

The following figure shows the type of output DB2 Admin returns when you
generate JCL from the Table Space Utilities panel. In the following figure, option C
on the Table Space Utilities panel was chosen (the COPY utility with the FULL
parameter specified).

-------------------------------------------------------------------------------
EDIT ISTJE.SPFTEMP2.CNTL Columns 00001 00072
Command ===> Scroll ===> PAGE
000007 //*
000008 //**********************************************************************
000009 //*
000010 //* DB2 ADMIN GENERATED JOB TO RUN COPY ON SELECTED TABLESPACES
000011 //*
000012 //************************************************************ADB2USC***
000013 //*
000014 //**********************************************************************
000015 //* STEP COPY: COPY TABLESPACE DSN8D81A.DSN8S81D
000016 //************************************************************ADB2USC1**
000017 //COPY EXEC DSNUPROC,SYSTEM=DB2X,
000018 // LIB='SYS1.DSNDB2X.SDSNLOAD',
000019 // UID='ISTJE'
000020 //DSNUPROC.SYSCOPY DD DSN=ISTJE.DB2X.IC.DSN8D81A.DSN8S81D(+1),
000021 // DISP=(NEW,CATLG),
000022 // SPACE=(8192,(7,5),RLSE),
000023 // UNIT=SYSDA
000024 //DSNUPROC.SYSIN DD *
000025 COPY TABLESPACE DSN8D81A.DSN8S81D DSNUM ALL FULL YES
000026 /*
000027 //**********************************************************************
000028 //* STEP MOD: MODIFY RECOVERY TABLESPACE DSN8D81A.DSN8S81D
000029 //**********************************************************************
000030 //MOD EXEC DSNUPROC,SYSTEM=DB2X,
000031 // LIB='SYS1.DSNDB2X.SDSNLOAD',
000032 // UID='ISTJE'
000033 //DSNUPROC.SYSIN DD *
000034 MODIFY RECOVERY TABLESPACE DSN8D81A.DSN8S81D DSNUM ALL
000035 DELETE AGE(35)
000036 /*
****** **************************** Bottom of Data ****************************

Figure 225. Edit generated JCL panel (COPY utility)

Changing batch job utility parameters


Use the Batch Job Utility Parameters panel to change batch job utility parameters.

358 User's Guide and Reference


When you choose option BP on the Table Space Utilities panel, the Batch Job
Utility Parameters panel is displayed, as shown in the following figure.

| DB2 Admin -------------- DB2X Batch Job Utility Parameters -------------- 11:48
| Command ===>
|
|
| Generate Job Card . ===> (Yes/No) DB2 System: DB2X
| Job cards: DB2 SQL ID: ISTJE
| ===> //J148286D JOB ,
| ===> // REGION=4096K,NOTIFY=J148286,USER=J148286,
| ===> // MSGCLASS=H,TIME=(,30)
| ===>
| ===>
| Generate Job CLASS ===> N (Yes/No) JOB CLASS . . . . . ===>
|
| JOBPARM:
| ===>
| ===>
| ===>
| ===>
|
| ADBTEP2: Restart . .===> (Yes/No)
| Maxerrors .===> 0 (-1 to 99)
| BindError .===> MAXE (MAXE, Save or Ignore)
|
| Space parameters:
| Unit name ===> SYSDA
| Space unit . . . ===> TRK (BLK, TRK, CYL, or 4096-32760)
| Max Primary . . . ===> 65535 (In above units, 99999999, or blank)
| In KB: 3145680
| Max DASD . . . . ===> 65535 (In above units. Allocations beyond this
| size are sent to tape) In KB: 3145680
| Tape Unit . . . . ===> TAPE (Unit for tape if size is greater
| than Max DASD)
|
| Default space allocation if unable to calculate:
| Primary alloc . . ===> 30 (In bove units)
| Secondary alloc . ===> 30 (In above units)
|
| Function-specific parameters:
| Unload pct . . . ===> 0 (0-99 - % increase for converted data set)
||
| Figure 226. Batch Job Utility Parameters panel (ADB2UPA)
|
On the DB2 Batch Job Utility Parameters panel, you can change the job cards, the
JES2 JCL control statement JOBPARM, the ADBTEP2 restart and maximum error
specification, and the space parameter values.

The following options are available:


Generate Job Card
Enter the job cards. If you choose to generate a job card, you can also generate
the CLASS parameter. If you select a Job CLASS, the last line of the job cards
must end with a comma because DB2 Admin adds an additional line to the job
card for the job CLASS.
Generate Job CLASS
If you generate the CLASS parameter, you can specify a job CLASS to override
the job CLASS that is specified by the installation.
JOBPARM
If JOBPARM is not specified on this panel, DB2 Admin adds a line for the
installation-specified JOBPARM.
ADBTEP2: Restart
If you select this option you can specify Yes or No to indicate whether the job is

Chapter 16. Running DB2 utilities 359


restartable. ADBTEP2 is the Batch Restart program, which provides the ability
to restart or resume the execution of an input stream of SQL statements at an
intermediate point, in the event that any one of the statements should fail. If
you specify No for ADBTEP2 restart, a RESTART(NO) parameter is generated
for each ADBTEP2 job step.
ADBTEP2: Maxerrors
The number of DSN commands that can fail before the batch restart job
ADBTEP2 is stopped:
-1 All errors are ignored. The batch job is not stopped for any error.
0 No errors are allowed. The batch job is stopped on the first error.
1-99
The specified number of errors are ignored. The batch job is stopped on
the next DSN command that fails. For example, if you specify 5, the batch
job is stopped when the sixth DSN command fails.

Any failing DSN commands that are ignored are skipped and are written to
the ADBHOLD table. When the job ends, if any DSN commands have failed,
the restart action field in the checkpoint table indicates that there are held
records. Depending on the restart option, the held records are reprocessed
when the job is restarted.
| ADBTEP2: AutoCheck
| Certain SQL or utility operations can place an object into check-pending state.
| If you set the Autocheck (AC) parameter value to YES, ADBTEP2 will track the
| statements and processes listed below that can place an object in
| check-pending. If one is encountered, ADBTEP2 will perform an automatic
| CHECK DATA to remove the check-pending state. The default value for AC is
| NO.
| The statements that ADBTEP2 tracks are:
| ALTER TABLE ... ADD FOREIGN KEY
| ALTER TABLE .... ADD CONSTRAINT
| LOAD REPLACE
| LOAD ENFORCE(NO)
| RECOVER PIT

| The processes that ADBTEP2 tracks are:


| COPY utility - perform auto-check prior to COPY
| CHECK DATA utility – perform auto-check after CHECKEND
| A final auto-check at the end of the SYSIN input stream

| Restriction: DB2 Admin builds the CHECK DATA statement and all CHECK
| parameters used during auto-check processing. You cannot specify
| any other parameters.
Unit name
The default unit name for new data sets that are allocated.
Space unit
The unit in which space is to be allocated. You can specify that space be
allocated in blocks, tracks, cylinders, or a given number of kilobytes.
Max Primary
The maximum amount of primary space that can be allocated for a data set on
DASD, as measured in the specified space unit.
Max DASD
The maximum amount of space that can be allocated for a data set on DASD,

360 User's Guide and Reference


as measured in the specified space unit. When DB2 Admin determines that the
amount of estimated space that is required for a data set exceeds this value,
the data set is allocated to tape.
Tape unit
A valid tape unit that has been defined at your site.
Primary alloc
The default size for primary space allocation when DB2 Admin cannot estimate
the space requirements for an allocated data set, such as when the RUNSTATS
and STOSPACE utilities have not been run.
Secondary alloc
The default size for secondary space allocation when DB2 Admin cannot
estimate the space requirements for an allocated data set, such as when the
RUNSTATS and STOSPACE utilities have not been run.
Unload pct
Shows the percentage increase for the converted unload data set that the
ALC/Object Compare function creates above the UNLOAD data set size. DB2
Admin converts data from the UNLOAD step. The newly converted data
might require more space than the unload data set. This parameter allows you
to increase the size of the converted data set by a percentage above the
unloaded data set, helping to avoid out-of-space conditions.
Related concepts
“Using table utilities” on page 362
“Parameters passed to ADBTEP2” on page 340
“Using index utilities” on page 365
Related information
Chapter 15, “Using the Batch Restart programs: ADBTEP2 and ADBTEPA,” on
page 339

Specifying utility options


When you use any of the utilities panels, you can choose to display and modify
the utility options for the task that you are completing.

For example, you can display the Specify Utility Options panels by following any
of these steps:
v Use the UTL line command on a table space to display the Table Space Utilities
panel (ADB2US). Choose an option from the menu and specify a Y in the
Review/modify options field. Press Enter to display the Specify Utility Options
panel for that task. For example, if you select the P option (Report Recover), the
Specify Utility Options - REPORT RECOVERY panel (ADB2USP) is displayed.
You can modify any of the options listed.
v Use the UTL line command on a table to display the Table Utilities panel
(ADB2UT). Choose an option from the menu and specify a Y in the
Review/modify options field. Press Enter to display the Specify Utility Options
panel for that task. For example, if you select the UL option (Unload using
UNLOAD utility), the Specify Utility Options - UNLOAD panel (ADB2USU) is
displayed. You can modify any of the options listed.
v Use the UTL line command on an index to display the Index Utilities panel
(ADB2UX). Choose an option from the menu and specify a Y in the
Review/modify options field. Press Enter to display the Specify Utility Options

Chapter 16. Running DB2 utilities 361


panel for that task. For example, if you select the K option (Check), the Specify
Utility Options - CHECK INDEX panel (ADB2UXK) is displayed. You can
modify any of the options listed.

| Using utility options for XML and LOBs


| Some utility options support XML and LOBs.

| The following utility options support XML and LOBs:


| CHECK DATA
| v Option XMLERROR can provide the values REPORT and INVALIDATE
| on XML column checks.
| v Option PUNCH DD is applicable only when SHRLEVEL is specified as
| CHANGE. For XML table spaces, before running CHECK DATA,
| PUNCHDD runs CHECK INDEX on the node ID index of each XML
| column.
| v Option LOBERROR provides the values REPORT and INVALIDATE on
| LOB column checks.
| v Option CLONE indicates that CHECK DATA is to check the clone table
| in the specified table space. Because clone tables cannot have referential
| constraints, the utility checks only constraints for inconsistencies
| between the clone table data and the corresponding LOB data. If you do
| not specify CLONE, CHECK DATA operates only against the base table.
| CHECK INDEX
| OPTION CLONE
| COPY OPTION CLONE
| COPYTOCOPY
| OPTION CLONE
| LISTDEF
| The XML type is supported.
| REBUILD INDEX
| REBUILD INDEX with SHRLEVEL CHANGE is not allowed for XML
| Indexes.
| REORG
| For XML table spaces, and base tables with XML columns, you cannot
| specify the following options in a REORG statement: DISCARD,
| REBALANCE, and UNLOAD EXTERNAL.
| Related concepts
| “Using the utility template to unload data from LOBs” on page 236
| “Using the utility template to unload data from an XML column” on page 237

Using table utilities


Use the Tables Utilities panel to use table utilities.

Use the UTL (utilities) line command or UTL primary command on the Tables,
Views, and Aliases panel to display the Table Utilities panel, as shown in the
following figure.

Use this panel to generate a batch job stream or work statement list to run one of
the displayed utilities against the selected table, view or alias. If you choose to
362 User's Guide and Reference
generate a job stream, DB2 Admin invokes an ISPF edit session from which you
may further change the contents of the generated job, copy the contents to another
data set, or submit it for processing.

DB2 Admin --------------------- DB2X Table Utilities -------------------- 10:07


Option ===>

Execute utility on DB2 System: DB2X


table DSN8810.DEPT DB2 SQL ID: ISTJE

UL - Unload using UNLOAD utility


U - Unload using DSNTIAUL
UX - Unload using REORG UNLOAD EXTERNAL
L - Load (with input created from U)
LX - Load (with input created from UX or UL)
LO - Load (stand-alone, force review/modify options)

BP - Change batch job parameters


TU - Specify Template Usage

Utility control options:


Review/modify options : Y (Yes or No)
Generate work statement list : N (Yes or No)
Generate template statements : N (Yes or No)

Figure 227. Table Utilities panel (ADB2UT)

The following options help you to control and vary the output JCL from the utility:
BP
Enables you to change the default JOB card statements and other system
parameters.
TU
Enables you to select templates to use for utility JCL and work statement list
output.
Generate template statements
Use this field to enable or disable the use of templates.
| When you specify Yes to enable the use of templates, DB2 Admin does not
| generate any TSODELETE statements, which would ensure that any existing
| data sets for the template are deleted first. To ensure that any existing data sets
| are deleted, consider using one of the following techniques when you define
| the template:
| v Specify the data set name pattern as a GDG (generation data group) where
| the next data set in the sequence is generated (+1), and change the other
| common options so that the GDGLIMIT is 1. This setup will cause the data
| sets in the group to roll off so that only one data set exists at any one time.
| For example, a data set pattern name might be specified as
| &db..&ts..&name..ic(+1).
| v Change the other common options to specify a DISP option of NEW,
| DELETE, DELETE for the data set, if appropriate.
Generate work statement list
Specify Y to request that the utility control statements be added to a work
statement list. Specify N to request an executable utility jobstream.

Using the LO option allows you to create your own LOAD utility job stream.
When you select the LO option and press Enter, the Specify Utility Options -
LOAD panel (ADB2UTC) is displayed, as shown in the following figure.

Chapter 16. Running DB2 utilities 363


DB2 Admin ------------- DB2X Specify Utility Options - LOAD ------------- 10:18
Option ===>

Execute utility on table DSN8810.DEPT


using the following options:
More: +
Utility ID ===>
(Name identifying this utility to DB2)
Unloaded Data ===>
(Name of data set containing unloaded data)
Unloaded How? ===> (U=Unload Utility, R=Reorg Utility)
Table/Col Info ===>
(Name of data set containing table/column info)
RESUME ===> (Yes/No, load recs into non-empty tablespace)
SHRLEVEL ===> (None/Change, concurrent table space access)
REPLACE ===> (Yes/No, empty table space/indexe before load)
COPYDDN1 ===> (DDname identifying primary copy data set)
COPYDDN2 ===> (DDname identifying backup copy data set)
RECOVERYDDN1 ===> (DDname identifying primary ds @ recovery site)
RECOVERYDDN2 ===> (DDname identifying backup ds @ recovery site)

TABLE ALL ===> (Yes/No, info for all columns in table space)
SAMPLE ===> (Sample percentage, non-indexed column stats)
INDEX ALL ===> (Yes/No, info for all indexes in table space)
REPORT ===> (Yes/No, generate statistics report)
UPDATE ===> (Level of statistics to insert in catalog,
A-All, P-Accesspath, S-Space, N-None)

KEEPDICTIONARY ===> (Yes/No, retain current compression dictionary)


REUSE ===> (Yes/No, reuse DB2 managed data sets)
LOG ===> (Yes, No, NOCopypend, log data during RELOAD)
WORKDDN1 ===> (DDname identifying temp data set, sort input)
WORKDDN2 ===> (DDname identifying temp data set, sort output)
SORTKEYS ===> 0 (Estimated number of index keys to be sorted)
ENFORCE ===> (Yes/No, enforce check/referential constraints)
SORTDEVT ===> (Device type, for DFSORT temp data set alloc)
SORTNUM ===> (Number of temp data sets to be allocated)
SORTWK ===> (Number of sort work data sets, range 0-4)

Figure 228. Specify Utility Options - LOAD panel (ADB2UTC)

DB2 Admin supports unloading table (spaces) that produce a record length of less
than 32K. When a table (space) with LOB objects is unloaded, it is possible that the
required record length exceeds 32K. In this case, you must modify the unload job
or WSL to specify the utility statements and parameters that allow unloading the
table (space).

Related reading: For more information about the fields on the Specify Utility
Options - LOAD panel (ADB2UTC), see the Help panel.

Refer to the online help for detailed information about other options available in
this panel.

364 User's Guide and Reference


Related concepts
“Changing batch job utility parameters” on page 358
Related tasks
“TEMPLATE usage” on page 234
Related reference
“Option T. Tables, Views, and Aliases” on page 594
Related information
“Managing TEMPLATEs” on page 226
IBM Publications Center

Editing generated JCL


Use the Edit Generated JCL panel to edit the JCL that you have generated.

The following figure shows the output that DB2 Admin returns when you generate
JCL from the Table Utilities panel. In this example, option UX on the Table Utilities
panel was chosen (UNLOAD using REORG UNLOAD EXTERNAL).

-------------------------------------------------------------------------------
EDIT ISTJE.SPFTEMP2.CNTL Columns 00001 00072
Command ===> Scroll ===> PAGE
000016 //* STEP DELETE: DELETE OLD DATASETS
000017 //**********************************************************************
000018 //DELETE EXEC PGM=IEFBR14
000019 //SYSREC DD DSN=ISTJE.DB2X.UNLD.DEPT,
000020 // UNIT=SYSDA,DISP=(MOD,DELETE,DELETE),SPACE=(TRK,1)
000021 //SYSPUNCH DD DSN=ISTJE.DB2X.CNTL.DSN8D81A.DSN8S81D,
000022 // UNIT=SYSDA,DISP=(MOD,DELETE,DELETE),SPACE=(TRK,1)
000023 //*
000024 //**********************************************************************
000025 //* STEP UNLOAD: UNLOAD TABLES
000026 //**********************************************************************
000027 //UNLOAD EXEC DSNUPROC,SYSTEM=DB2X,
000028 // LIB='SYS1.DSNDB2X.SDSNLOAD',
000029 // UID='ISTJE'
000030 //SYSPUNCH DD DSN=ISTJE.DB2X.CNTL.DSN8D81A.DSN8S81D,
000031 // SPACE=(TRK,(5,5),RLSE),
000032 // UNIT=SYSDA,
000033 // DISP=(,CATLG,DELETE)
000034 //SYSREC DD DSN=ISTJE.DB2X.UNLD.DEPT,
000035 // DISP=(,CATLG,DELETE),
000036 // DCB=(BLKSIZE=8192),
000037 // SPACE=(8192,(5,5),RLSE),
000038 // UNIT=SYSDA
000039 //SYSIN DD *
000040 UNLOAD TABLESPACE DSN8D81A.DSN8S81D
000041 FROM TABLE
000042 "DSN8810"."DEPT"
****** **************************** Bottom of Data ****************************

Figure 229. Edit generated JCL panel—UNLOAD utility (ADB2UE)

Using index utilities


Use the Index Utilities panel to use index utilities.

To display the Index Utilities panel, as shown in the following figure, use one of
the following commands:
v UTL line command on the Indexes panel (ADB21X). This command allows you
to generate utilities for a particular index.

Chapter 16. Running DB2 utilities 365


v UTIL primary command on the Indexes panel (ADB21X). This command allows
you to generate utilities for all of the indexes that are displayed.
v UTIL IX primary command on the Databases panel (ADB21D). This command
allows you to generate utilities for all of the indexes in the databases that are
displayed.
If you want to have the utilities performed against a LISTDEF control statement
of all the indexes in the database, specify UTIL IX LISTDEF.

Use this panel to generate JCL for the utilities that can be run against indexes.
When the JCL is generated, DB2 Admin invokes ISPF edit, which enables you to
change the JCL, submit it, and copy it to another data set.

| ADB2UX in --------------------- DSN9 Index Utilities -------------------- 13:17


| Option ===>
|
| Execute utility on DB2 System: DSN9
| all the selected indexes DB2 SQL ID: VNDMPM2
|
| C - Copy full C2 - Copytocopy
| K - Check
| N - Repair nocopypend NA - Repair nocheckpend NB -Repair norcvrpend
| NR - Repair norbdpend NO – Repair noreorgpend
| O - Reorg
| R - Runstats RR - Runstats report
| RX - Runstats (to invalidate dynamic cache)
| V - Recover RB - Rebuild
| P - Report recovery
| DG - Define GDG for copy data sets
|
|
| BP - Change batch job parameters
| TU - Specify Template Usage
|
| Utility control options:
| Review/change options : YES (Yes/No)
| Generate work statement list : NO (Yes/No)
| Generate template statements : NO (Yes/No)
|
|
| Figure 230. Index Utilities panel (ADB2UX)
|
The following options help you to control and vary the output JCL from the utility:
BP
Enables you to change the default JOB card statements and other system
parameters.
TU
Enables you to select templates to use for utility JCL and work statement list
output.
Generate template statements
Use this field to enable or disable the use of templates.
When you specify the CHECK utility, templates are used regardless of the
value of this field because the CHECK utility function requires the use of
templates. Either the default templates or the templates that you specify are
used.
Generate work statement list
Specify Y to request that the utility control statements be added to a work
statement list. Specify N to request an executable utility jobstream.
When you specify the CHECK utility, a batch statement list, which is similar to
a work statement list, is generated regardless of the value of this field. The

366 User's Guide and Reference


batch statement list is required as an input file to the Batch Restart (ADBTEP2)
program, which manages the CHECK utility function.

Refer to the online help for detailed information about other options available in
this panel.

Tip: When you run the COPY utility, the default is that one copy is written to the
data set that is described by the SYSCOPY DD statement. If you want more
than one copy of the output, you can create and use templates for the utility
data sets COPYDDN 1, COPYDDN2, RECOVERYDDN1, and
RECOVERYDDN2.
Related concepts
“Changing batch job utility parameters” on page 358
Related tasks
“TEMPLATE usage” on page 234
Related reference
“Option X. Indexes” on page 600
Related information
“Managing TEMPLATEs” on page 226

Editing generated JCL


Use the Edit Generated JCL panel to edit the JCL that you have generated.

The following figure shows the type of output that DB2 Admin returns when you
generate JCL from the Index Utilities panel. In this example, option R on the Index
Utilities panel was chosen (the RUNSTATS utility).

-------------------------------------------------------------------------------
EDIT ISTJE.SPFTEMP2.CNTL Columns 00001 00072
Command ===> Scroll ===> PAGE
****** ***************************** Top of Data ******************************
==MSG>
==MSG> DB2 Admin: Edit generated JCL
==MSG>
000001 //ISTJED JOB (ADB,OM3),'DB2 UTILITY',
000002 //* RESTART=stepname, <== For restart remove * and enter step name
000003 // REGION=0M,NOTIFY=ISTJE,
000004 // MSGCLASS=H,
000005 // CLASS=9
000006 //*
000007 //**********************************************************************
000008 //*
000009 //* DB2 ADMIN GENERATED JOB TO RUN RUNSTATS ON INDEXES
000010 //*
000011 //************************************************************ADB2UXR***
000012 //*
000013 //**********************************************************************
000014 //* STEP RUNSTATS: RUNSTATS ON INDEXES
000015 //**********************************************************************
000016 //RUNSTATS EXEC DSNUPROC,SYSTEM=DB2X,
000017 // LIB='SYS1.DSNDB2X.SDSNLOAD',
000018 // UID='ISTJE'
000019 //DSNUPROC.SYSIN DD *
000020 RUNSTATS INDEX(
000021 "DSN8810"."XDEPT1"
000022 )
****** **************************** Bottom of Data ****************************

Figure 231. Edit generated JCL panel—RUNSTATS utility (ADB2UE)

Chapter 16. Running DB2 utilities 367


Running utilities on LISTDEFs
Instead of running utilities against explicitly specified table spaces or indexes, you
might want to run the utilities against a predefined LISTDEF.

To run utilities on a predefined LISTDEF:


1. Select option 5 on the Administration Menu panel to display the Utility
generation using LISTDEFs and TEMPLATEs panel.
2. Select option L to display the LISTDEFs panel.
3. Issue the UT line command for the desired LISTDEF to display the LISTDEF
Utilities panel, as shown in the following figure.

DB2 Admin --------------------- DB2X LISTDEF Utilities ------------------ 10:07


Option ===>

Execute utility using DB2 System: DB2X


LISTDEF named SYSADM.DBLT0301 DB2 SQL ID: ISTJE

C - Copy full CI - Copy incremental


CC - Copy concurrent
E - Mergecopy EN - Mergecopy newcopy
K - Check index
M - Modify
O - Reorg OU - Reorg unload only OO - Online reorg
OI - Reorg Index
P - Report recovery
Q - Quiesce
RB - Rebuild Index
R - Runstats Tablespace RT - Runstats table all RR - Runstats report
RX - Runstats (to invalidate dynamic SQL cache for table spaces)
RI - Runstats Index RIR - Runstats index report
RIX - Runstats (to invalidate dynamic SQL cache for index spaces)
V - Recover VR - Recover torba VL - Recover logonly
U - Unload VP - Recover tologpoint
SM - Standard Maintenance C O R
DG - Define GDG for copy datasets
BP - Change batch job parameters
TU - Specify TEMPLATE usage

Utility control options:


Review/change options : NO (Yes/No)
Generate work statement list : NO (Yes/No)
Generate template statements : NO (Yes/No)
Generate tablespace-only steps: NO (Yes/No)

Figure 232. Table Utilities panel (ADB25LU)

The following options help you to control and vary the output JCL from the
utility:
SM
Enables you to specify the base for a generate and establish a series of
utilities.
DG
Enables you to specify a GDG (generation data group) base.
BP
Enables you to change the default JOB card statements and other system
parameters.
TU
Enables you to select templates to use for utility JCL and work statement
list output.

368 User's Guide and Reference


Review/change options
Use this field to use or review and change the current options for the
selected utility.
Generate work statement list
Specify Y to request that the utility control statements be added to a work
statement list. Specify N to request an executable utility jobstream.
Generate template statements
Use this field to enable or disable the use of templates.
When you specify the CHECK utility, templates are used regardless of the
value of this field because the CHECK utility function requires the use of
templates. Either the default templates or the templates that you specify are
used.
Generate work statement list
Specify Y to request that the utility control statements be added to a work
statement list. Specify N to request an executable utility jobstream.
When you specify the CHECK utility, a batch statement list, which is
similar to a work statement list, is generated regardless of the value of this
field. The batch statement list is required as an input file to the Batch
Restart (ADBTEP2) program, which manages the CHECK utility function.

| Restriction: Unload jobs generated for LISTDEFS, where the objects contain
| LOB columns, will fail.
Refer to the online help for detailed information about other options available
in this panel.
When the JCL is generated, DB2 Admin invokes ISPF edit, which enables you
to change the JCL, submit it, and copy it to another data set.
Related tasks
“Creating the LISTDEF control tables” on page 217
“Adding a LISTDEF” on page 219

Using offline utilities


Offline utilities include DSN1COMP, DSN1COPY, and DSN1PRNT.

You can use the DB2 Admin table space utility and index space utility panels to
invoke the following offline utilities:
v DSN1COMP
v DSN1COPY
v DSN1PRNT

To use these offline utilities:


1. From the Table Spaces panel, use the SP line command to display the Table
Space Partitions panel (ADB21SP). From the Indexes panel, use the XP line
command to display the Index Partitions panel (ADB21XP).
2. Use the UT line command to display the utilities panels (ADB2US for table
spaces and ADB2UX for index spaces).
3. Select option DSN1 and press Enter to display the Offline Utilities Selection
panel (ADB2US1).
4. Select one of the following offline utilities to run:
1P DSN1PRNT – Print the following types of data sets:
v DB2 VSAM data sets that contain table spaces or index spaces

Chapter 16. Running DB2 utilities 369


v Image copy data sets
v Sequential data sets that contain DB2 table spaces or index spaces
1C DSN1COPY – Copy the following types of data sets:
v Copy DB2 VSAM data sets to sequential data sets
v Copy DSN1COPY sequential data sets to DB2 VSAM data sets
v Copy DB2 image copy data sets to DB2 VSAM data sets
v Copy DB2 VSAM data sets to other DB2 VSAM data sets
v Copy DSN1COPY sequential data sets to other sequential data sets
The 1C option requires an output data set, defined by a SYSUT2 DD
statement. If you do not specify an output data set, DB2 Admin defaults to
DUMMY. If you specify an existing data set (DISP=OLD), provide the name
and disposition. For a new data set (DISP=NEW), you must also specify, at
a minimum, the space units (either TRK or CYL). You can also provide the
primary and secondary space allocations and the unit type.
1M
DSN1COMP – Estimate space savings as a result of DB2 data compression
in table spaces. This option is not available for index spaces.
5. Press Enter to display the Offline Utilities Parameters panel (ADB2USOF).
6. Enter values for the parameters and press Enter to display an ISPF edit session
to edit and run the JCL.

370 User's Guide and Reference


Chapter 17. Invoking DB2 EXPLAIN
You can useDB2 Admin to issue SQL EXPLAIN statements, which gather
information about the access path that DB2 chooses to process a query, and to use
related functions.

Topics:
v “Using the main EXPLAIN panel” on page 372
v “Explaining SQL Statements” on page 372
v “Listing rows from a plan table” on page 373
v “Upgrading a plan table” on page 375
v “Creating a plan table” on page 375
v “Creating an index on a plan table” on page 376
v “Creating a statement table” on page 376
v “Creating a function table” on page 377
Related concepts
“DB2 Administration Menu panel” on page 97
Related information
IBM Publications Center

© Copyright IBM Corp. 1995, 2010 371


Using the main EXPLAIN panel
You can use the main EXPLAIN panel to have DB2 explain SQL statements, and
perform many other functions.

To invoke the DB2 Admin EXPLAIN utility, select option E on the Administration
Menu panel. The Explain panel is displayed, as shown in the following figure.

| DB2 Admin --------------------------- Explain --------------------------- 01:52


| Option ===>
|
| E - Explain an SQL statement DB2 System: DB2X
| L - List PLAN_TABLE DB2 SQL ID: ISTJE
| PLAN_TABLE owner ===> > (default is ISTJE)
| Plan name ===> > (optional)
| DBRM/package name ===> > (optional)
| Collection ID ===> > (optional)
| U - Upgrade the PLAN_TABLE to current DB2 version
| Owner ===> > (default is ISTJE)
| C - Create a PLAN_TABLE for explain
| CX - Create an index on PLAN_TABLE for the optimizer
| CS - Create a DSN_STATEMNT_TABLE
| CF - Create a DSN_FUNCTION_TABLE
| US - Upgrade a STATEMNT_TABLE to current DB2 version
| Owner ===> > (default is ISTJE)
| UF - Upgrade a FUNCTION_TABLE to current DB2 version
| Owner ===> > (default is ISTJE)
|
| CA - Create an ALIAS for ===> 1. PLAN_TABLE
| 2. DSN_STATEMNT_TABLE
| 3. DSN_FUNCTION_TABLE
|
|
| Figure 233. Explain panel (ADB2E)
|
Use this panel to do the following tasks:
v Enter an SQL statement, have DB2 explain the statement, and view the resulting
rows in a plan table (PLAN_TABLE).
v List rows from a plan table and see how DB2 will execute SQL statements in
application plans or packages that were bound with EXPLAIN(YES).
v Upgrade a plan table to the current version of DB2.
v Create a plan table (a plan table is needed before you can execute EXPLAIN
statements).
v Create an index on the plan table for the DB2 optimizer. An index is
recommended if optimizer hints are being used.
v Create a statement table in which DB2 EXPLAIN can store the estimated cost for
a statement.
v Create a function table in which DB2 EXPLAIN can store information on how
DB2 resolves function references.
v Upgrade a statement table (STATEMNT_TABLE) to the current DB2 version.
v Upgrade a function table (FUNCTION_TABLE) to the current DB2 version.
v Create an alias for the DB2 EXPLAIN table. The alias allows a user with SELECT
and INSERT privileges to populate DB2 EXPLAIN tables that are created under
a different AUTHID.

Explaining SQL Statements


You can request a DB2 EXPLAIN for an SQL statement and view the resulting
rows in a plan table.

372 User's Guide and Reference


To request a DB2 EXPLAIN for an SQL statement and to view the resulting rows in
a plan table:
1. Select option E on the Explain panel to display the Explain an SQL Statement
panel, as shown in the following figure. Optionally use the SET CURRENT
DEGREE field to set the current degree of parallelism before running the
EXPLAIN plan statement. Valid values are 1 and ANY. If the field is left blank,
the current degree is not changed.

DB2 Admin ---------------- DB2X Explain an SQL Statement ---------------- 15:50


Command ===>

SET CURRENT DEGREE = ; (Optional) DB2 System: DB2X


EXPLAIN ALL DB2 SQL ID: ISTJE

SET QUERYNO =
Query number==>
FOR
SQL stmt ==> SELECT * FROM SYSIBM.SYSTABLES WHERE NAME LIKE 'SYS

Press ENTER to execute explain, or enter EDIT on the command line to edit
the SQL statement.

Figure 234. Explain an SQL Statement panel (ADB2EE)

2. Enter a query number and an SQL statement. If you leave the query number
blank, DB2 Admin generates a query number for you in the form
YYMMDDSSS, where YYMMDD is the year/month/day and SSS is a sequence
number.
3. Press Enter to run the EXPLAIN statement. The resulting row in the plan table
is shown on the next panel.
4. Use the I line command to display the EXPLAIN results.

You can use the EDIT primary command to edit your SQL statement. When you
are in ISPF edit, use the ISPF edit copy commands to copy SQL statements to or
from other data sets.

Listing rows from a plan table


You can display the contents of the Plan Table panel.

To display the contents of the Plan Table panel, select option L on the Explain
panel. The List Plan Table panel is displayed, as shown in the following figure.

Chapter 17. Invoking DB2 EXPLAIN 373


| DB2 Admin ----------- Rows from ISTJE.PLAN_TABLE ------------------ Row 1 of 8
| Command ===> COL HINT PLAN Scroll ===> PAGE
|
| Line commands:
| I - Interpretation T - Table X - Index P - Plan M - DBRM K - Package
| DP - Delete rows for plan DK - Delete for package DQ - Delete for query no
| D - Delete current row SR - Stmt table rows FR - Function table rows
| IH - Insert optimizer hint UH - Update optimizer hint SQ - SQL for query no
|
| Query Q Collect. Progname Pl M Ac M I T Table
| S Number Bl (COLLID) (Packg) No T Ty Co O No Owner Table Name
| * * * * * * * * * * * *
| -- ----------- -- ------– -----– -- - -- -- - -- -------- -----------------
| 960125003 1 ADBLCOLI ADBMAIN 1 0 I 0 N 1 SYSIBM SYSTABLES
| 999999999 1 EEEPACK E41MAIN 1 0 I 1 N 1 SYSIBM SYSTABLES
| 970923001 1 ADBLCOLI ADBMAIN 1 0 I 1 N 1 SYSIBM SYSTABLES
| 981118002 1 ADBL ADBMAIN 1 0 I 0 N 1 SYSIBM SYSTABLES
| 981118003 1 ADBL ADBMAIN 1 0 I 0 N 1 SYSIBM SYSTABLES
| 990421001 1 ADBL ADBMAIN 1 0 I 0 N 1 SYSIBM SYSTABLES
| 990421002 1 ADBL ADBMAIN 1 0 I 2 N 1 SYSIBM SYSTABLES
| 990421003 1 ADBL ADBMAIN 1 0 I 2 N 1 SYSIBM SYSTABLES
| ******************************* END OF DB2 DATA *******************************
||
| Figure 235. List Plan Table panel (ADB2EL)
|
Use this panel to see how DB2 will execute SQL statements from
previously-executed EXPLAIN statements and from DB2 BIND commands that
specify EXPLAIN(YES).

You can view the information in this panel in three different formats. To switch
between formats, use the following primary commands:
v PLAN for plan mode, which shows Applname (PLAN) and Progname (DBRM)
v COL for package mode, which shows Collection (COLLID) and Progname
(PACKG)
v HINT for hint mode, which shows Hint ID and Hint Used

The following fields are available on this panel:


S Input field where you enter one of the line commands listed on the panel.
QUERY NUMBER
A number that identifies the SQL statement.
Q BL
Query block number. Indicates the position of the query in the statement being
explained.
APPLNAME (PLAN) or COLLECT. (COLLID) or HINT ID
Name of the application plan for the row, collection ID for the package, hint ID
or blank for a dynamic EXPLAIN statement.
PROGNAME (DBRM) or PROGNAME (PACKG) or HINT USED
DBRM name, package name, or hint used.
PL NO
Plan number. Indicates the order in which the EXPLAIN statement will be
executed.
MT
Method. Indicates the join method to be used.
AC TY
Access type. Indicates the method by which the table will be accessed. This
field contains one of the following types:

374 User's Guide and Reference


I Index
I1 One-fetch index scan
N Index scan when the matching predicate contains the IN keyword
R Table space scan
M Multiple index scan
MX Index scan
MI Intersection of multiple indexes
MU Union of multiple indexes
Blank Not applicable to current row
MCO
Matching columns. Indicates the number of index keys used in an index scan.
IO Index only. Whether only the index is accessed in this step or whether data
must also be accessed. This field contains one of the following values:
N No
Y Yes
T NO
Table number. Indicates the position of the table in the statement.
TABLE OWNER
Owner of the table being accessed.
TABLE NAME
Name of the table being accessed.

Upgrading a plan table


You can upgrade a plan table to the current version of DB2.

To upgrade a plan table to the current version of DB2, select option U on the
Explain Panel. DB2 Admin issues a series of ALTER TABLE PLAN_TABLE ADD
statements to upgrade the plan table so that it contains the maximum number of
columns supported by the current DB2 version.

There is no panel associated with this function. DB2 Admin responds with a
message that indicates whether the plan table was upgraded successfully.

Creating a plan table


Use the Create a Plan Table panel to create a plan table

To create a plan table:


1. Select option C on the Explain panel. The Create a Plan Table panel is
displayed, as shown in the following figure.

DB2 Admin ---------------- DB2X Create PLAN_TABLE ----------------------- 01:53


Command ===>

Owner ===> ISTJE (optional, default is ISTJE)


Name ===> PLAN_TABLE

IN
Database ===> (optional, default is DSNDB04. ? to lookup)
Table space ===> (optional, if blank DB2 implicitly creates a TS.
? to lookup.)

Figure 236. Create a Plan Table panel (ADB2EC)

Chapter 17. Invoking DB2 EXPLAIN 375


2. Enter the database and table space names you want to use for the plan table.
Both names are optional.
3. Press Enter to create the plan table.

Refer to the online help for detailed information about the options available in this
panel.

Creating an index on a plan table


You can create an index on a plan table for the DB2 optimizer.

To create an index on the plan table for the DB2 optimizer:


1. Select option CX on the Explain panel. The Create Index panel is displayed, as
shown in the following figure.

| ADB26CX n ---------------------- DB2X Create Index ---------------------- 09:30


| Command ===> __________________________________________________________________
|
|
| CREATE INDEX
|
| Schema . . . . . RIVERAF > (default is ULVEMAN)
| Name . . . . . . IXFGR > (? to look up)
|
| ON
| Table schema . . RIVERAF > (default is ULVEMAN)
| Table name . . . TBFGR > (? to look up)
|
| Partitions . . . 0 (0 for nonpartitioned INDEX)
|
| Like:
| Index schema . . ________ > (required for Like usage)
| Index name . . . __________________ > (? to look up)
|
|
| Figure 237. Create Index panel (ADB26CX)
|
2. Specify an index owner and name, a table owner and name, the number of
partitions (up to 4096) that the index should contain, and optionally use the
LIKE fields to model the index on another index.
3. Press Enter to display the next Create Index panel (ADB21XAR). Specify
columns for the index and, optionally, values for the attribute fields.
4. Use the CONTINUE primary command to proceed to the Create Index – Space
panel (ADB21XAS). Optionally specify values for the attributes in the ISPF
table.
5. Use the CONTINUE primary command to complete the process of creating the
index.

Refer to the online help for detailed information about the options available in this
panel.

Creating a statement table


DB2 EXPLAIN uses a statement table to store the estimated cost for an SQL
statement.

To create a statement table:

376 User's Guide and Reference


1. Select option CS on the Explain panel. The Create Statement Table panel is
displayed, as shown in the following figure.

DB2 Admin ---------------- DB2X Create DSN_STATEMENT_TABLE -------------- 01:54


Command ===>

CREATE TABLE

Owner ===> ISTJE (optional, default is ISTJE)


Name ===> DSN_STATEMENT_TABLE

IN
Database ===> ISTJEDB (optional, default is DSNDB04. ? to lookup)
Table space ===> ISTJESP (optional, if blank DB2 implicitly creates a TS.
? to lookup.)

Figure 238. Create a Statement Table panel (ADB2EC)

2. Accept the defaults or enter your own values.


3. Press Enter to create the statement table.

Creating a function table


DB2 EXPLAIN uses a function table to store information about how function
references were resolved.

To create a function table:


1. Select option CF on the Explain panel. The Create a Function Table panel is
displayed, as shown in the following figure.

DB2 Admin ---------------- DB2X Create DSN_FUNCTION_TABLE --------------- 01:54


Command ===>

CREATE TABLE

Owner ===> ISTJE (optional, default is ISTJE)


Name ===> DSN_FUNCTION_TABLE

IN
Database ===> ISTJEDB (optional, default is DSNDB04. ? to lookup)
Table space ===> ISTJESP (optional, if blank DB2 implicitly creates a TS.
? to lookup.)
Note: For DB2 Version, specify a table space with
an 8K page size or greater.

Figure 239. Create a Function Table panel (ADB2EC)

2. Accept the defaults or enter your own values.


3. Press Enter to create the statement table.

Chapter 17. Invoking DB2 EXPLAIN 377


378 User's Guide and Reference
Chapter 18. Administering DB2 Admin
You can use DB2 Admin to administer your DB2 systems.

Topics:
v “System Administration panel” on page 380
v “Displaying threads” on page 382
v “Displaying or terminating utilities” on page 383
v “Displaying or managing traces” on page 384
v “Displaying or updating the owner of Resource Limit (RLIMIT) Tables”
on page 386
v “Stopping DB2” on page 390
v “Displaying group information” on page 391
v “Displaying or managing batch checkpoint tables” on page 392
v “Managing system parameters” on page 394
v “Displaying buffer pool status” on page 399
v “Altering buffer pools” on page 399
v “Displaying buffer pool hit ratios” on page 401
v “Displaying archive log information” on page 402
v “Setting archive log parameters” on page 403
v “Archiving the current DB2 log” on page 404
v “Displaying log information” on page 404
v “Changing DB2 system checkpoint frequency” on page 405
v “Displaying or updating communications settings” on page 405
v “Displaying or cancelling distributed threads” on page 410
v “Displaying location details and threads” on page 412
v “Starting DDF” on page 413
v “Stopping DDF” on page 413
v “Managing stored procedures” on page 414
v “Managing functions” on page 425
v “Backing up and recovering a DB2 subsystem” on page 431
Related concepts
“DB2 Administration Menu panel” on page 97

© Copyright IBM Corp. 1995, 2010 379


System Administration panel
DB2 Admin provides an interface to perform many of the tasks required to
administer and maintain your DB2 systems.

The tasks that are supported by DB2 Admin are listed in the System
Administration panel, as shown in the following figure.

Each option is associated with one or more DB2 commands. For example, when
you use the 2D option, DB2 Admin issues the DB2 - DISPLAY THREAD command.

To display this panel, select option Z on the DB2 Administration Menu panel.

DB2 Admin ----------------- DB2X System Administration ------------------ 01:55


Option ===>

DB2 System: DB2X


DB2 activity related functions: DB2 SQL ID: ISTJE
2D - Display threads 2U - Display/terminate utilities
2T - Display/manage traces 2R - Display/update resource limits
2S - Stop DB2 2G - Display group
2B - Display/manage batch checkpoint 2Z - Manage System Parameters
Buffer pool functions:
BD - Display buffer pools BA - Alter buffer pools
BH - Display buffer pool hit ratios
DB2 log functions:
LD - Display archive log parameters LS - Set archive log parameters
LA - Archive current log LI - Display log information
LZ - Set log checkpoint frequency
DDF functions:
DU - Display/update CDB
DC - Display/cancel distributed thds DL - Display active locations
DT - Start DDF DS - Stop DDF
Stored procedures and functions options:
PM - Manage stored procedures FM - Manage functions
System Backup and Recovery:
SB - Backup System SR - Recover system
PT - Set Point in time

Figure 240. System Administration panel (ADB2Z)

The following tasks are supported by DB2 Admin. They are listed with their
associated option numbers.
2D – Display threads
Select this option to display the current status of DB2 threads.
2U – Display/terminate utilities
Select this option to display the status of utility jobs or to terminate utilities.
2T – Display/manage traces
Select this option to display, start, or stop traces.
2R – Display/update resource limits (RLIMIT)
Select this option to display or stop the resource limit (RLIMIT) facility or to
update the RLIMIT tables that are created in the system.
2S – Stop DB2
Select this option to stop the DB2 subsystem.
2G – Display Group
Select this option to display information about the data sharing group to which
the DB2 subsystem belongs.

380 User's Guide and Reference


2B – Display/manage batch checkpoint table
Select this option to display and manage the checkpoint table (ADBCHKPT)
that is associated with batch jobs that are running ADBTEP2. ADBTEP2 lets
you restart or resume execution of an input stream of SQL statements at an
intermediate point, in case one of the statements fails.
2Z – Manage system parameters
Select this option to dynamically manage system parameters. You can display
DB2 system parameters and update dynamic parameters in Version 7.
BD – Display buffer pools
Select this option to display the current status of one or more active or inactive
buffer pools.
BA – Alter buffer pools
Select this option to alter the attributes of active or inactive buffer pools.
BH – Display buffer pool hit ratios
Select this option to display the hit ratios for the buffer pools.
LD – Display archive log parameters
Select this option to display information about the input archive log.
LS – Set archive log parameters
Select this option to set the upper limit for the number of and the deallocation
time of tape units for the archive log.
LA – Archive current log
Select this option to archive the current DB2 log.
LI – Display log information
Select this option to display information about the DB2 log.
LZ – Set log checkpoint frequency
Select this option to set the DB2 system checkpoint frequency.
DU – Display/update CDB
Select this option to display or update a table in the communications database
(CDB).
DC – Display/cancel distributed thds
Select this option to display or cancel processing for threads that originate
locally and access remote data, or originate remotely and access local data.
DL – Display active locations
Select this option to display statistics about threads with a distributed
relationship, or display conversation information about DB2 system threads
that interact with VTAM.
DT – Start DDF
Select this option to start the distributed data facility (DDF) if it has not
already been started.
DS – Stop DDF
Select this option to stop the DDF if it has already been started.
PM – Manage stored procedures
Select this option to manage DB2 stored procedures.
FM – Manage functions
Select this option to manage DB2 user-defined functions.
SB – Backup System
Select this option to back up the DB2 subsystem.

Chapter 18. Administering DB2 Admin 381


PT – Set point in time
Select this option to specify a particular time to which to recover the DB2
subsystem.
SR – Recover System
Select this option to set up a job that will recover the DB2 subsystem to a point
in time.
Related concepts
“Dialog support for batch job checkpoint table” on page 344
“DB2 Administration Menu panel” on page 97

Displaying threads
You can display the current status of DB2 threads.

To display the current status of DB2 threads:


1. Select option 2D on the System Administration panel. The Display Threads
panel is displayed, as shown in the following figure.

| ADB2Z2D n ------------------- Display Threads ---------------------- 12:10


| Command ===>
|
| -DISPLAY THREAD(
| Connection name . . . . (name or *, default is TSO)
| TYPE . . . . . . . . . (Active, INActive, Indoubt, Postponed,
| PROC, SYStem or *)
| LOCATION . . . . . . . (name, name* or *)
| LUWID . . . . . . . . .
| DETAIL . . . . . . . . (Yes/No)
|
| Max KB DB2 output . . . 32 (1-1000)
|
| Output to . . . . . . . T (T - Table, B – Browse)
| SCOPE . . . . . . . . . (L – Local, G - Group)
| LIMIT . . . . . . . . . (Number of lines of output)
|
|
| Figure 241. Display Threads panel (ADB2Z2D)
|
2. Enter the appropriate keywords and parameters on the panel.
3. Press Enter. DB2 Admin issues the DB2 -DISPLAY THREAD command.
The information that DB2 Admin returns to you from the command is in ISPF
browse format or in a table display panel, depending on what you specify in
the Output to field.
If you choose to display the DB2 threads on a table display panel, the
Display/Cancel Threads panel (ADB2Z2D2) is displayed, as shown in the
following figure. On this panel, you can cancel DB2 threads.

Restriction: You cannot cancel a thread that is running under the active user
ID. An asterisk in the A column indicates which thread is
associated with the active user ID.

382 User's Guide and Reference


DB2 Admin ------------- DB2X Display/Cancel Threads ---------- Row 1 to 4 of 4
Command ===> Scroll ===> PAGE

Line commands:
CAN - Cancel thread

Sel Name St A Req ID Auth ID Plan ASID Token


* * * * * * * * *
---- -------- -- -- ----- ------------ -------- -------- ---- ------
TSO T 966 J351156 J351156 TSTDEV 00D6 328
TSO T * 6 ISTJE ISTJE ISTJE01 015D 336
CAN TSO T 10 DEPT10 DEPT10 D10100 0102 265
TSO T 6 JRTESTER JRTESTER TEST100 00E1 240
******************************* END OF DB2 DATA *******************************

Figure 242. Display Threads panel (ADB2Z2D2) – Cancelling a thread

Related information
IBM Publications Center

Displaying or terminating utilities


You can display the status of utility jobs or terminate utilities.

To display the status of utility jobs or terminate utilities:


1. Select option 2U on the System Administration panel. The Display/Terminate
Utilities panel is displayed, as shown in the following figure.

DB2 Admin ---------- DB2X Display/Terminate Utilities ------- ROW 1 TO 1 OF 1


Command ===> Scroll ===> PAGE

Line commands:
TERM - Terminate utility DIS - Display utility

Select Userid Utility ID Utility Stmt Phase Count Status


* * * * * * *
------ -------- ------------------ --------- ------ -------- --------- --------
ISTJE ISTJE RUNSTATS 1 RUNSTATS 0 ACTIVE
R148286 R148286 REBUILDI 1 UNLOAD 0 STOPPED
******************************* END OF DB2 DATA *******************************

Figure 243. Display or Terminate Utilities panel (ADB2Z2U2)

The following fields are available on this panel:


SELECT
Input field where you enter one of the line commands listed on the panel.
USERID
Userid of the person who is running the utility.
UTILITY ID
Utility identifier.
UTILITY
Name of the utility that is currently running.
STMT
Number of the utility statement being processed.
PHASE
Current phase of the utility, such as RELOAD.

Chapter 18. Administering DB2 Admin 383


COUNT
Depending on the utility that is currently running, the number of rows,
pages, or page sets being processed.
STATUS
Status of the utility, such as ACTIVE.
2. Issue one of the following line commands:
v TERM to terminate a utility. When you press Enter, DB2 Admin issues the
-TERMINATE UTILITY command.
v DIS to display the status of a utility. DB2 Admin issues the -DISPLAY
UTILITY command.
The information that DB2 Admin returns to you from the commands is in ISPF
browse format.

The following figure shows the type of information DB2 Admin returns when you
issue the DIS line command from the Display/Terminate Utilities panel.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-DIS UTIL(ISTJE)

********************************* TOP OF DATA *********************************


DSNU105I < DSNUGDIS - USERID = ISTJE
UTILID = ISTJE
PROCESSING UTILITY STATEMENT 1
UTILITY = RUNSTATS
PHASE = RUNSTATS COUNT = 0
STATUS = ACTIVE
DSN9022I < DSNUGCCC '-DIS UTIL' NORMAL COMPLETION
******************************** BOTTOM OF DATA ********************************

Figure 244. Display Utilities panel (ADB2DB2O)

Related information
IBM Publications Center

Displaying or managing traces


You can display, start, or stop traces.

To display, start, or stop traces:


1. Select option 2T on the System Administration panel. The Display/Manager
Traces panel is displayed, as shown in the following figure.

384 User's Guide and Reference


DB2 Admin ------------- DB2X Display/Manage Traces ---------------- Row 1 of 2
Command ===> Scroll ===> PAGE

Line commands:
STA - Start trace STO - Stop trace DIS - Display trace details

T Trace
Sel No Type Trace Classes Dest Qual
* * * * *
--- -- ------ ------------------------------------------------ ----------- ----
01 STAT 01,03,04,05 SMF NO
02 ACCTG 01 SMF NO
******************************* END OF DB2 DATA *******************************

Figure 245. Display/Manage Traces panel (ADB2Z2T2)

The following fields are available on this panel:


SEL
Input field where you enter one of the line commands listed on the panel.
T NO
Trace number.
TRACE TYPE
Trace type.
TRACE CLASSES
Trace classes active for this trace.
DEST
Destination for the trace.
QUAL
Whether the trace was further qualified.
2. Issue one of the following line commands:
v DIS to display trace details. When you press Enter, DB2 Admin issues the
-DISPLAY TRACE command.
v STA to start the trace. When you press Enter, DB2 Admin issues the -START
TRACE command.
v STO to STOP the trace. When you press Enter, DB2 Admin issues the -STOP
TRACE command.
The information that DB2 Admin returns to you from the commands is in ISPF
browse format.
| 3. If you issue the STA line command, the trace filter panel ADB2Z2TS appears.
| On this panel, you can specify filters for trace options. The Trace Functions
| panel is displayed, as shown in the following figure.
|

Chapter 18. Administering DB2 Admin 385


| ADB2Z2TS -------------------- V91A Trace Functions ------------------- 08:04
| Command ===>
| More: +
| -START TRACE(
| Trace type . . . . . . .STAT (STat, ACctg, AUdit, PErfm or MOnitor)
| CLASS . . . . . . . . .01,03,04
| DEST . . . . . . . . . .SMF (SMF, GTF, OPn, OPX and/or SRV)
| SCOPE . . . . . . . . . (L – Local, G - Group)
| IFCID . . . . . . . . .
| BUFSIZE . . . . . . . . (8-1024)
|
| TDATA CORRELATION
| Include cor header . . (Yes/No)
| Include CPU header . (Yes/No)
| Include trace hdr . (Yes/No)
| Include dist hdr . . (Yes/No)
|
| COMMENT . . . . . . . .
| RMID . . . . . . . . . .
|
| Specify the filters to include or exclude below:
| Include Exclude
| PLAN . . . . . . . . . . > >
| AUTHID . . . . . . . . . > >
| LOCATION . . . . . . . . > >
| PKGLOC . . . . . . . . . > >
| PKGCOL . . . . . . . . . > >
| PKGPROG . . . . . . . . > >
| USERID . . . . . . . . . > >
| APPNAME . . . . . . . . > >
| WRKSTN . . . . . . . . . > >
| CONNID . . . . . . . . . > >
| CORRID . . . . . . . . . > >
| ROLE . . . . . . . . . . > >
||
| Figure 246. Trace Functions (ADB2Z2TS)
|
Related information
IBM Publications Center

Displaying or updating the owner of Resource Limit (RLIMIT) Tables


You can display or update the owner of the resource limit tables.

To display or update the owner of the resource limit tables:


1. Select option 2R on the System Administration panel. The Resource Limit
Tables Owner panel is displayed, as shown in the following figure.

ADB2Z2R --------------- DB2X Resource Limit Tables Owner -------------- 01:57


Command ===>

DB2 System: DB2X

Enter the owner of the resource limit tables:

Owner ===> SYSIBM

Figure 247. Resource Limit Tables Owner panel (ADB2Z2R)

2. Enter the owner of the resource limit tables, and press Enter to display the
resource limit tables owned by that owner, as shown in the following figure.

386 User's Guide and Reference


| ADB2Z2RD ------ DB2X Display/Update Resource Limit Tables -------- Row 1 of 1
| Command ===> Scroll ===> PAGE
|
| DB2 System: DB2X
| Commands:
| DIS - Display RLIMIT STO - Stop RLIMIT
|
| Line commands:
| S - Display/update STA - Start RLIMIT with ID I - Insert row
|
| Select ID Owner Name Columns
| * * * *
| ------ -- -------- ------------------ -------
| 01 SYSIBM DSNRLMT01 9
| 01 SYSIBM DSNRLST01 11
| ******************************* END OF DB2 DATA *******************************
||
| Figure 248. Display/Update Resource Limit (RLIMIT) Tables panel (ADB2Z2RD)
|
The following fields are available on this panel:
SELECT
Input field where you enter one of the line commands listed on the panel.
ID
RLIMIT identifier.
OWNER
Authorization ID of the owner of the RLIMIT table.
NAME
Name of the RLIMIT table.
COLUMNS
Number of columns in the RLIMIT table.
3. Issue one of the following commands:
v DIS primary command. Use this command to display the current status of
the resource limit. This command is equivalent to the -DISPLAY RLIMIT DB2
command.
The following figure shows the RLIMIT status information DB2 Admin
returns when you issue the DIS primary command.

| ADB2DB2O ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
| Command ===> Scroll ===> PAGE
|
| -STA RLIMIT ID=01
|
|
| ********************************* Top of Data **********************************
| DSNT704I #DSN9- SYSIBM.DSNRLST01 HAS BEEN STARTED FOR THE RESOURCE
| LIMIT FACILITY
| DSNT704I #DSN9- SYSIBM.DSNRLMT01 HAS BEEN STARTED FOR THE RESOURCE
| LIMIT FACILITY
| DSN9022I #DSN9- DSNTCSTR 'START RLIMIT' NORMAL COMPLETION
| ******************************** Bottom of Data ********************************
||
| Figure 249. Display RLIMIT panel (ADB2DB2O)
|
v STO primary command. Use this command to stop the resource limit. This
command is equivalent to the -STOP RLIMIT DB2 command.
The following figure shows the information DB2 Admin returns when you
issue the STO primary command to stop the resource limit facility.

Chapter 18. Administering DB2 Admin 387


| ADB2DB2O ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
| Command ===> Scroll ===> PAGE
|
| -STO RLIMIT ID=01
|
|
| ********************************* Top of Data **********************************
| DSNT702I #DSN9- RESOURCE LIMIT FACILITY HAS BEEN STOPPED. WAS USING
| SYSIBM.DSNRLST01
| DSNT702I #DSN9- RESOURCE LIMIT FACILITY HAS BEEN STOPPED. WAS USING
| SYSIBM.DSNRLMT01
| DSN9022I #DSN9- DSNTCSTP 'STOP RLIMIT' NORMAL COMPLETION
| ******************************** Bottom of Data ********************************
|
|
| Figure 250. Stop RLIMIT panel (ADB2DB2O)
|
v S line command. Use this command to display or update the resource limit
status.
The following figure shows the panel returned when you:
– Issued the S line command to show the content of the RLIMIT table and
– Used the primary command PRE ON to show the predictive governor
columns, as well

| ADB2Z2RS ---- DB2X Display/Update Resource Limits ID=01 ---------- Row 1 of 1


| Command ===> Scroll ===> PAGE
|
| DB2 System: DB2X
| Line commands: D - Delete I - Insert U - Update
| F Reactive B
| u Govenor i
| n Service n
| Select Auth ID Plan Collection Package LU Name c Units d
| * * * * * * * *
| ------ -------> -------- -----------------> -------> -------> - ----------- -
| ?
| VNDOKAV COL1 PACK1 LU1 1 ? N
| VNDOKAV XCOLL XPACK XLU 1 ?
| VNDOKAV YCOLL YPACK YLU 1 ?
| VNDWLB1 WLBCOLLECTION WLBPACKA WLBLU 1 ?
| ******************************* END OF DB2 DATA *******************************
||
| Figure 251. Display RLIMIT panel (ADB2Z2RS)
|
| v S line command. Use this command to display or update the resource limit
| status of resource limit table DSNRLMTxx.
| The following figure shows the panel returned when you:
| – Issued the S line command to show the column values of DSNRLMTxx
| resource table.
|

388 User's Guide and Reference


| ADB2Z2RM ---- DB2X Display/Update Resource Limits ID=01 ----- Row 1 to 2 of 2
| Command ===> Scroll ===> PAGE
|
| DB2 System: V91A
| Line commands: D - Delete I - Insert U - Update
| F Reactive
| u Governor
| n Service
| Select User ID Appl Name Wrkstn Name IP c Units
| * * * * * *
| ------ -------> ---------------> -------------> --------------> - ---------
| ?
| SMITHJR APPL1 WORKSTATN1 30
| PAUL 125.123.123.123 8 10
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 252. Display RLIMIT panel (ADB2Z2RM)
|
v STA line command. Use this command start the resource limit with ID.
The following figure shows the information DB2 Admin returns when you
issue the STA line command to start the resource limit facility with a
particular ID.

ADB2DB2O ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-STA RLIMIT ID=01

********************************* Top of Data **********************************


DSNT704I DB2X SYSIBM.DSNRLST01 HAS BEEN STARTED FOR THE RESOURCE
LIMIT FACILITY
DSN9022I DB2X DSNTCSTR 'START RLIMIT' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 253. Start RLIMIT panel (ADB2DB2O)

v I line command. Use this command to insert a row into the resource limit
table.
The following figure shows the output when you enter the I line command
in front of a row from the RLIMIT table in Figure 251 on page 388. On the
Insert RLIMIT panel, as shown in the following figure, you can enter values
for a new row in the RLIMIT table.

Chapter 18. Administering DB2 Admin 389


| ADB2Z2RU -------------------- DB2X Insert RLIMIT ----------------------- 12:05
| Command ===>
| DB2 System: V91A
| DB2 SQL ID: SYSADM
| More: +
| Enter/verify details for auth_id.DSNRLSTxx:
| Auth id . . . . . > (blank: all)
| Plan name . . . . (blank: all)
| Collection . . . . > (blank: all)
| Package . . . . . > (blank: all)
| LU name . . . . . > (blank: local, PUBLIC: all remote)
| Function . . . . . (' ' - react gov of dyn SQL by plan
| 1 - BIND operations
| 2 - react gov of dyn SQL by package
| 3 - disable query I/O parallelism
| 4 - disable query CP parallelism
| 5 - disables sysplex parallelism
| 6 - predict. gov. of dyn SQL by plan
| 7 - predict. gov. of dyn SQL by pkg)
| Service units . . NULL (react. gov. limit: 0-2147483647)
| Bind allowed . . . (No, for function 1)
| PG warn limit . . NULL (predic. gov. warning limit serv. units
| PG err limit . . . NULL (predic. gov. error limit service units
| PG cat B act . . . (Execute, Reject, or Warn)
|
| Press ENTER to Insert RLIMIT, or press PF3 to cancel Insert.
||
| Figure 254. Insert RLIMIT panel (ADB2Z2RU)
|
| v I line command. Use this command to insert or update column values for the
| DSNRLMTxx resource limit table.
| The following figure shows the output when you enter the I line command
| in front of a row from the DSNRLMTxx RLIMIT table in panel ADB2ZRM.
|
| ADB2Z2RI -------------------- DB2X Insert RLIMIT ----------------------- 12:05
| Command ===>
| DB2 System: V91A
| DB2 SQL ID: SYSADM
| Enter/verify details for auth_id.DSNRLMTxx:
| User id . . . . . > (blank: all)
| Application name . > (blank: all)
| Workstation name . > (blank: all)
| IP address . . . . > (blank: all)
| Function . . . . . (8 - react gov of dyn SQL by client info
| 9 - pred gov of dyn SQL by client info)
| Service units . . NULL (react. gov. limit: 0-2147483647)
| PG warn limit . . NULL (predic. gov. warning limit serv. units)
| PG err limit . . . NULL (predic. gov. error limit service units)
| PG cat B act . . . (Execute, Reject, or Warn)
|
| Press ENTER to Insert RLIMIT, or press PF3 to cancel Insert
||
| Figure 255. Insert RLIMIT panel (ADB2Z2RM)
|
The information that DB2 Admin returns to you from the commands is in ISPF
browse format.
Related information
IBM Publications Center

Stopping DB2
You can stop the DB2 subsystem.

To stop the DB2 subsystem:

390 User's Guide and Reference


1. Select option 2S on the System Administration panel. The Stop DB2 panel is
displayed, as shown in the following figure.

DB2 Admin ------------------------ DB2X Stop DB2 ------------------------ 16:07


Command ===>

-STOP DB2

MODE(
Stop mode ===> (Quiesce or Force, default is quiesce)
)
Note: After using FORCE mode, exit from DB2 Admin without issuing any further
SQL statements.

Figure 256. Stop DB2 panel (ADB2Z2S)

2. Enter Quiesce or Force in the Stop mode field.


3. Press Enter to stop DB2. DB2 Admin accomplishes this task by issuing the DB2
-STOP DB2 command.
The information that DB2 Admin returns to you from the command is in ISPF
browse format.
Related information
IBM Publications Center

Displaying group information


You can display information about the data sharing group to which a DB2
subsystem belongs.

To display information about the data sharing group to which a DB2 subsystem
belongs:

Select option 2G on the System Administration panel. The Display Group panel is
displayed, as shown in the following figure.
DB2 Admin generates this panel by issuing the DB2 -DISPLAY GROUP command.
DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-DIS GROUP

********************************* Top of Data **********************************


DB2X100I -DB81 DB2XGCMD
*** BEGIN DISPLAY OF GROUP(DSNDB26 ) GROUP LEVEL(810)
GROUP ATTACH NAME(DB26)
--------------------------------------------------------------------
DB2 DB2 SYSTEM IRLM
MEMBER ID SUBSYS CMDPREF STATUS LVL NAME SUBSYS IRLMPROC
-------- --- ---- -------- -------- --- -------- ---- --------
DB81 1 DB81 -DB81 ACTIVE 810 ZPLEX IR81 DB81IRLM
DB82 2 DB82 -DB82 FAILED 810 ZPLEX1 IR82 DB82IRLM
--------------------------------------------------------------------
SCA STRUCTURE SIZE: 4096 KB, STATUS= AC, SCA IN USE: 2 %
LOCK1 STRUCTURE SIZE: 4096 KB, LOCK1 IN USE: < 1 %
NUMBER LOCK ENTRIES: 1048576
NUMBER LIST ENTRIES: 13878, LIST ENTRIES IN USE: 22
*** END DISPLAY OF GROUP(DSNDB26 )
DSN9022I -DB81 DB2XGCMD 'DISPLAY GROUP ' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 257. Display Group panel (ADB2DB2O)

Chapter 18. Administering DB2 Admin 391


Related information
IBM Publications Center

Displaying or managing batch checkpoint tables


The DB2 Admin Batch Restart program, ADBTEP2, provides the ability to restart or
resume the execution of an input stream of SQL statements, utilities, and DB2
commands in a batch job at an intermediate point, in the event that any one of the
statements in that input stream should fail.

The information to monitor the execution of the input stream is stored in a DB2
table referred to as the checkpoint table.

The Display or Manage Batch Checkpoint Table panel allows you to display and
manage the checkpoint table for batch jobs running ADBTEP2. A row exists in the
checkpoint table for each active and abnormally terminated job running ADBTEP2.

To display and manage the checkpoint table for the batch jobs that running
ADBTEP2:
1. Select option 2B on the System Administration panel. The Manage Batch
Checkpoint Table panel is displayed, as shown in the following figure.

DB2 Admin ------------ DB2X Manage Batch Job Checkpoint Table ----------- 20:39
Option ===>

Batch Job Checkpoint Table : ADB.ADBCHKPT DB2 System: DB2X


DB2 SQL ID: ISTJE
1 - Display Checkpoint Records
2 - Display Checkpoint Table Status

Enter Checkpoint Table Owner:

Table Owner ===> ADB

Enter display selection criteria for option 1:

Userid ===> (default is '')

Worklist ===> (default is '')

Figure 258. Manage Batch Job Checkpoint Table panel (ADB2Z2B)

2. Select one of the following options and press Enter.


v Option 1, Display Checkpoint Records, gives you the ability to display all
checkpoint records. Use option 1 to terminate an active ADBTEP2 job, update
or delete a record of an abnormal terminated job, or insert a new checkpoint
record.
v Option 2, Display Checkpoint Table Status, displays information about the
checkpoint table. Use this option to issue any request against the checkpoint
table that is supported by DB2 Admin, such as GRANT or REVOKE.
The following figure shows the rows in the table you have selected.

392 User's Guide and Reference


DB2 Admin ---------- DB2X Display Batch Job Checkpoint Table ------ Row 1 of 1
Command ===>

DB2 System: DB2X


DB2 SQL ID: ISTJE

Checkpoint Table: ADB.ADBCHKPT

Line commands:
D - Delete/Terminate I - Insert U - UpdateN - Skip-Next
Commit Restart Restart
S Userid Worklist Suffix Time Number Command Action
* * * * * *
- -------- -------- -------- ---------------> ----------- ----------- ------
ISTJE MYMIGR 2002-07-18-16.06 4 COPY C
VNDBRON RI03 2002-07-10-16.19 2
VNDOJFK OBJCMP 2002-06-26-16.54 1
VNDROTH AAA 2002-06-26-07.36 1 COPY C
******************************* END OF DB2 DATA *******************************

Figure 259. Display Batch Job Checkpoint Table panel (ADB2Z2B1)

When data is unloaded in one job and is then reloaded in another job, the
unload suffix has the following format: Uxxxx. The corresponding reload is
Rxxxx. An additional suffix might also exist, in the format @xxxx. Never attempt
to update or modify the @xxxx record. Delete this record only if you are
abandoning a current run of a work statement list. The @xxxx record is deleted
by the job using Rxxxx.
Use the following line commands to change the content of the table:
D To DELETE the row of an abnormally terminated job or to terminate an
active job.
I To INSERT a new row. Row values can be entered on the next panel
displayed.
U To UPDATE the row of an abnormally terminated job. If the job is
executing, the request is rejected. Row values can be changed on the next
panel.
N To instruct ADBTEP2 to skip to the next commit instruction.
| 3. If you use the I or U line commands, the insert or update a checkpoint record
| panel (ADB2Z2BU) displays. The schema and sqlid values will be used during
| a restart for setting the current sqlid and current schema special registers at the
| point of restart. When you update a checkpoint record that does not have a
| SCHEMA value (is null), the panel value displayed will be blank . If you do
| not enter a new value, the SCHEMA value remains null. When you insert a
| new checkpoint record using the panels, if you do not enter a non-blank value,
| a null value will be stored.
|

Chapter 18. Administering DB2 Admin 393


| ADB2Z2BU Admin ----------------- UPDATE an Entry ------------------------ 10:17
| Command ===>
|
| DB2 System: DSN9
| Checkpoint table : ADB.ADBCHKPT DB2 SQL ID: J148286
|
| Enter/Verify:
|
| Userid ===> J148286
| Worklist ===> UNLDLOB
| Suffix ===>
| Jobname ===> UNLDLOB
| SQLID ===> J148286
| SCHEMA ===> >
| Commit number ===> 1
| Restart cmd ===> Not Known
| Restart Act ===> C
| Timestamp ===> 2009-01-27-09.08.34.15523
| Server ===> DSN9
| Path ===> "SYSIBM","SYSFUN","SYSPROC","J148286"
|
|
|
| Program Cntrl ===> NNNINNN
|
|
| Press ENTER to UPDATE an entry, or press PF3 to cancel UPDATE.
|
|
| Figure 260. Insert or update a checkpoint record panel (ADB2Z2BU)
|
Related tasks
“Restarting a WSL that was run by another user” on page 322

Managing system parameters


You can use DB2 Admin to view, update, and load DB2 subsystem parameters.

DB2 Admin displays the currently active parameters and allows you to customize
them for your environment. The changed parameters are stored as a new source
for assembling the DSNZPARM module. You can assemble and link-edit the new
source into a new DSNZPARM load module. The system parameter source and
load modules are referred to here by the name DSNZPARM, although you can
assign them your own names.

DB2 Admin provides the SET SYSPARM LOAD option to issue the command to
load and activate the module. With DB2, you can load a new subsystem parameter
module into storage while DB2 is active, which enables you to change certain
operational parameters without stopping and starting DB2.

Restriction: Only dynamic parameters can be loaded using this feature.

To use DB2 Admin to manage system parameters, select option 2Z on the System
Administration panel. The System Parameters panel is displayed, as shown in the
following figure. Use the System Parameters panel to display the current
parameters, to create a new parameter source file, to assemble and link-edit it, and
to access the SET SYSPARM options.

| Note: This functionality requires that DB2 SDSNLOAD data sets be allocated in
| linklist or STEPLIB. If you do not allocate DB2 SDSNLOAD data sets , you
| must use the DSNTIJUZ batch job process to assemble and linkedit the
| DSNZPARM module.

394 User's Guide and Reference


DB2 Admin ------------------- DB2X System Parameters -------------------- 07:57
Option ===>

1 - Display Parameters/Generate DSNZPARM source DB2 System: DB2X


2 - Assemble and Linkedit DSNZPARM module DB2 SQL ID: R148286
3A - SET SYSPARM LOAD( )
3B - SET SYSPARM RELOAD
3C - SET SYSPARM STARTUP

Output datasets:
DSNZPARM Source ===> JCL.CNTL(TEST)
LinkEdit SYSLMOD ===> ADBV37.ISPLLIB(TEST)

Assembly listing ===> ADB.ASM.LIST


LinkEdit listing ===> ADB.LKED.LIST
Optional Debug ===> ADB.DEBUG.LIST

Input datasets:
Assembly STEPLIB ===>
Assembly SYSLIB ===> JCL.CNTL
===> 'SYS1.MACLIB'
===>

LinkEdit SYSLIB ===> 'DB2X10.SDSNLOAD'


===>
===>
Options:
Assembly ===> ADATA,LIST(133),OBJECT
Linkedit ===> LIST,XREF,LET,RENT

Figure 261. System Parameters panel (ADB2Z2Z)

The following list provides an overview of the options and fields on that panel.
See the online help for more extensive information.
1 – Display Parameters/Generate DSNZPARM source
Select this option if you want to view and optionally change the current
parameters. If you want to change parameter values, you must specify an
output data set and member. If no changes are made, the member is not
written.
2 – Assemble and Linkedit DSNZPARM module
Select this option to assemble and link-edit the parameters module. Be sure to
specify the output SYSLMOD data set name, because that is where the new
load module is stored.
SET SYSPARM options
Use these options to easily execute the SET SYSPARM commands.
3A – SET SYSPARM LOAD
Select this option to load a new system parameter load module into
storage.
3B – SET SYSPARM RELOAD
Select this option to reload the previous parameter load module into
storage.
3C – SET SYSPARM STARTUP
Select this option to reload into storage the parameter load module used at
subsystem startup.
Output data sets
Enter information pertaining to the output data sets that are used in creating
the systems parameter data set and in the subsequent assemble and link-edit

Chapter 18. Administering DB2 Admin 395


steps. Specify the output data set, DSNZPARM source because this is where
the new source is written. When a new load module is created, you must
specify the output SYSLMOD data set.
Input data sets
Enter information pertaining to additional input libraries and data sets used in
the assembly and link-edit steps. You should specify the Assembly SYSLIB
because this data set contains the DSNZPARM macros, such as DSN6SPRM,
and DSN6LOGP. DB2 Admin accesses these macros to determine which
parameters that exist for the subsystem.
Options
Specify options that you want in effect at assembly and link-edit time.
Related concepts
“System Parameters — System Parameters panel”
“Unrecognized Macro Parameters panel” on page 398
Related information
IBM Publications Center

System Parameters — System Parameters panel


You can view and change the current system parameters.

To view and change the current parameters, select option 1 on the System
Parameters panel. The System Parameters – System Parameters panel is displayed,
as shown in the following figure.

396 User's Guide and Reference


DB2 Admin --------- DB2X System Parameters - System Parameters ---------- 07:59
Command ===>

DB2 System: DB2X


DB2 SQL ID: R148286
More: +
Storage Sizes and Connections
Operator and DDF Functions
Tracing and Data Installation
Locking (IRLM)
Active Log
Archive Log
Protection and Data Definition
Stored Procedures
Data Sharing Parameters
Application Programming Defaults
Other Parameters
Restart Parameters
Allow Explain during Autobind . . . . . . . . . . . . . . YES (ABEXP ) *
Allow Autobind Operations . . . . . . . . . . . . . . . YES (ABIND ) *
Archive Log Allocation Unit . . . . . . . . . . . . . . . CYL (ALCUNIT ) *
Copy 1 prefix . . . . . . DB2X.ARCHLOG1 (ARCPFX1 ) *
Copy 2 prefix . . . . . . DB2X.ARCHLOG2 (ARCPFX2 ) *
Archive Retention Period . . . . . . . . . . . . . . . . 31 (ARCRETN ) *
Archive WTOR Routing codes . . 1,3,4 (ARCWRTC ) *
Issue WTOR before Archive Mounts . . . . . . . . . . . . . YES (ARCWTOR ) *
Read COPY2 Archives First . . . . . . . . . . . . . . . . NO (ARC2FRST) *
Plan Authorization cache size . . . . . . . . . . . . . 1024 (AUTHCACH) *
Bind New Version . . . . . . . . . . . . . . . . . . . BINDADD (BINDNV ) *
Archive Dataset Blocksize . . . . . . . . . . . . . . . 28672 (BLKSIZE ) *
IMS/BMP Timeout factor . . . . . . . . . . . . . . . . . . 4 (BMPTOUT ) *
Catalog Archive Datasets . . . . . . . . . . . . . . . . . YES (CATALOG ) *
ICF Catalog Name . . . . . . . . . . . . . . . . . . DB2X (CATALOG ) *
Current Degree Special Register . . . . . . . . . . . . . 1 (CDSSRDEF) *
System Checkpoint Frequency (LOGLOAD) . . . . . . . . 50000 (CHKFREQ ) *
Compact Archive Logs . . . . . . . . . . . . . . . . . . . NO (COMPACT ) *
Maximum Concurrent Remote Connections . . . . . . . 128 (CONDBAT ) *
Contract CT Long storage pool . . . . . . . . . . . . . . NO (CONTSTOR) *
Maximum Concurrent Allied Threads . . . . . . . . . . 300 (CTHREAD ) *
DBA can create aliases,views . . . . . . . . . . . . . . . NO (DBACRVW ) *
Database Protocol for 3-part names . . . . . . . . . . DRDA (DBPROTCL) *
Tape unit Deallocation Minutes . . . . . . . . . . . . 0 (DEALLCT ) *
Tape Unit Deallocation Seconds . . . . . . . . . . . . . . (DEALLCT ) *

Figure 262. System Parameters — System Parameters panel (ADB2ZZMN)

The System Parameters — System Parameters panel displays a list of currently


active DB2 system parameters. The top twelve lines, which have no parameter
values to the right, are selection fields. When selected, a secondary panel is
displayed that shows the parameters organized by category.

The selection fields are followed by the dynamic parameters in alphabetical order.
Enter new values for any parameters by overwriting the existing value. Only those
parameters identified by an asterisk (*) can be loaded dynamically using the SET
SYSPARM command.

Restriction: This message can also be issued for parameters not on this panel, but
whose value has changed as a result of the assembly. This situation
might occur if DB2 maintenance was applied to the macro data sets,
thereby changing the internal parameter values, and no interim
subsystem recycle was performed.

Chapter 18. Administering DB2 Admin 397


Related concepts
“Managing system parameters” on page 394
“System Parameters — Archive Log panel”

System Parameters — Archive Log panel


The System Parameters — Archive Log panel is an example of a secondary panel
that is displayed when one of the fields is selected from the top of the panel
shown in the System Parameters — System Parameters panel.

In this example, the category Archive Log was selected. The following figure
shows the System Parameters — Archive Log panel.

DB2 Admin ------------ DB2X System Parameters - Archive Log ------------- 08:18
Command ===>

DB2 System: DB2X


DB2 SQL ID: R148286

Dual Archive Logs . . . . . . . . . . . . . . . . . . . . YES (TWOARCH )


Timestamp Archive Log datasets . . . . . . . . . . . . . . EXT (TSTAMP ) *
Copy 1 prefix . . . . . . DB2X.ARCHLOG1 (ARCPFX1 ) *
Copy 2 prefix . . . . . . DB2X.ARCHLOG2 (ARCPFX2 ) *
Archive Log Allocation Unit . . . . . . . . . . . . . . . CYL (ALCUNIT ) *
Primary Space Allocation . . . . . . . . . . . . . . . 200 (PRIQTY ) *
Secondary Space Allocation . . . . . . . . . . . . . . 200 (SECQTY ) *
Catalog Archive Datasets . . . . . . . . . . . . . . . . . YES (CATALOG ) *
Copy 1 Archive Log Device Type . . . . . . . . . . . SYSDA (UNIT ) *
Copy 2 Archive Log Device Type . . . . . . . . . . . SYSDA (UNIT2 ) *
Archive Dataset Blocksize . . . . . . . . . . . . . . . 28672 (BLKSIZE ) *
Maximum Read Tape Units . . . . . . . . . . . . . . . . . . 2 (MAXRTU ) *
Tape unit Deallocation Minutes . . . . . . . . . . . . 0 (DEALLCT ) *
Tape Unit Deallocation Seconds . . . . . . . . . . . . . . (DEALLCT ) *
Maximum Archive Entries in BSDS . . . . . . . . . . . . . 1000 (MAXARCH )
Issue WTOR before Archive Mounts . . . . . . . . . . . . . YES (ARCWTOR ) *
Archive Retention Period . . . . . . . . . . . . . . . . 31 (ARCRETN ) *
Quiesce Period . . . . . . . . . . . . . . . . . . . . . . 5 (QUIESCE ) *
Compact Archive Logs . . . . . . . . . . . . . . . . . . . NO (COMPACT ) *
Archive copy 1 Mass Storage Group Name . . . . . . . (MSVGP )
Archive copy 2 Mass Storage Group Name . . . . . . . (MSVGP2 )
Limit Backout Processing During Restart . . . . . . . . . AUTO (LBACKOUT)
Restart Backout Limit . . . . . . . . . . . . . . . . . . 5 (BACKODUR)
Read COPY2 Archives First . . . . . . . . . . . . . . . . NO (ARC2FRST) *
Offload . . . . . . . . . . . . . . . . . . . . . . . . . NO (OFFLOAD )
Single Volume DASD Archives . . . . . . . . . . . . . . . NO (SVOLARC )

Figure 263. System Parameters — Archive Log panel (ADB2ZZAL)

Related concepts
“System Parameters — System Parameters panel” on page 396

Unrecognized Macro Parameters panel


DB2 Admin accesses SDSNMACS, the Assembly SYSLIB data set specified by the
user, to determine which DSNZPARM parameters exist for this subsystem.

An unrecognized macro was encountered and is displayed in the Unrecognized


Macro Parameters panel, as shown in the following figure.

398 User's Guide and Reference


DB2 Admin -------- DB2X Unrecognized Macro Parameters Row 1 to 1 of 1
Command ===>

The following are parameters in the supplied macro in the SDSNMACS


dataset but are not recognized by this function. Values from the
current subsystem parameters could not be obtained. Any listed
values are the default value for the macro. You may specify a new
value for a parameter by over-typing the default. If the macro does
not provide a default and a value is required, an assembly error may
occur.

Macro Parameter Default


DSN6ARVP SUPRHERO JOE
************************** Bottom of data ***************************

Figure 264. Unrecognized Macro Parameters panel (ADB2ZZTL)

Related concepts
“Managing system parameters” on page 394

Displaying buffer pool status


You can display the current status of one or more active or inactive buffer pools.

To display the current status of one or more active or inactive buffer pools:
1. Select option BD on the System Administration panel. The Display Buffer Pools
panel is displayed, as shown in the following figure.

DB2 Admin ------------------ DB2X Display Buffer Pools ------------------ 16:07


Command ===>

-DISPLAY BUFFERPOOL(
Buffer pool name ===> (Active, BP0-49, BP8K_, BP16K_, BP32K_, *)
) DETAIL(
Include details ===> (Interval or *)
) LIST(
Include page sets ===> (Active or *)
) LSTATS
Page set statistics ===> (Yes/No)

Max DB2 output (KB) ===> 32 (1-1000)

Figure 265. Display Buffer Pools panel (ADB2ZBD)

2. Enter the appropriate keywords and parameters on the panel. DB2 Admin
issues the DB2 -DISPLAY BUFFERPOOL command. The information that DB2
Admin returns to you from the command is in ISPF browse format.
Related information
IBM Publications Center

Altering buffer pools


You can alter the attributes of active or inactive buffer pools.

To alter the attributes of active or inactive buffer pools:


1. Select option BA on the System Administration panel. The Alter Buffer Pools
panel is displayed, as shown in the following figure.

Chapter 18. Administering DB2 Admin 399


| ADB2ZBA2 --------------- Alter Buffer Pools ---------- Row 1 to 14 of 80
| Command ==> Scroll ==> PAGE
|
| Line commands:
| AL – Alter buffer pool DIS – Display buffer pool
|
| BP PG VP VP PG Int1 Int2 VP X Auto
| Select Name VP Size Steal SEQT PSEQT FIX DWQT VDWQT VDWQT PSEQT Size
| * * * * * * * * * * *
| ------ ------ -------- ----- ---- ----- ---- ---- ----- ----- ----- ----
| *IS BP0 2000 LRU 80 50 NO 85 80 0 0 YES
| BP1 2500 LRU 80 50 NO 85 80 0 0 YES
| BP2 2000 LRU 80 50 NO 85 80 0 0 NO
| BP3 2000 LRU 80 50 NO 85 80 0 0 NO
| BP4 0 LRU 80 50 NO 30 5 0 0 NO
| BP5 0 LRU 80 50 NO 30 5 0 0 YES
| BP6 0 LRU 80 50 NO 30 5 0 0 NO
|
|
| Figure 266. Alter Buffer Pools panel (ADB2ZBA2)
|
The following fields are available on this panel:
SELECT
Input field where you enter one of the line commands listed on the panel.
BP NAME
Buffer pool name.
VP SIZE
Virtual buffer pool size.
HP SIZE
Hiperpool size.
CAST OUT
Hiperspace* CASTOUT value.
VP SEQT
Virtual sequential steal threshold.
VP PSEQT
Virtual parallel sequential threshold.
HP SEQT
Hiperpool sequential steal threshold.
DWQT
Deferred write threshold.
VDWQT
Vertical deferred write threshold.
VP X PSEQT
Assisting virtual parallel sequential threshold.
| Auto Size
| Specifies whether the buffer pool adjustment is turned on or off.
| NO Specifies that the buffer pool does not use Workload Manager
| (WLM) services for automatic buffer pool sizing adjustment. This is
| the default.
| YES Specifies that the buffer pool uses WLM services, if available, to
| automatically adjust the size of the buffer pool based on dynamic
| monitoring of the workload goals and the available storage on the
| system.
2. Issue one of the following line commands:
400 User's Guide and Reference
v AL to alter a buffer pool. When you press Enter, DB2 Admin issues the
-ALTER BUFFERPOOL command.
v DIS to display buffer pool. When you press Enter, DB2 Admin issues the
-DISPLAY BUFFERPOOL command.
The information DB2 Admin returns to you from the commands is in ISPF
browse format.
Related information
IBM Publications Center

Displaying buffer pool hit ratios


You can name the buffer pools for which buffer pool hit ratios should be
displayed.

The hit ratio is calculated as the number of hits in the buffer pool divided by the
number of GETPAGES.
1. Select option BH on the System Administration panel. The Display Buffer Pool
Hit Ratios panel is displayed, as shown in the following figure.

DB2 Admin -------------- DB2X Display Buffer Pool Hit Ratios ------------ 23:45
Command ===>

-DISPLAY BUFFERPOOL(
Buffer pool name ===> (Active, BP0-49, BP8K_, BP16K_, BP32K_, *)
) DETAIL(
Include details ===> (Interval or *)
)

Figure 267. Display Buffer Pool Hit Ratios panel (ADB2ZBH)

2. Enter the name of a buffer pool. The following values are valid:
Active All active buffer pools.
BP0–BP49, BP8K_, BP16K_, BP32K_
Select a specific buffer pool name from the valid values available.
* All buffer pools.
3. Specify the interval for which information should be displayed; the interval can
be either since the buffer pool was created (*) or since the last display
(interval).
4. Press Enter. DB2 Admin issues the DB2 DISPLAY BUFFERPOOL command to
generate the Buffer Pool Hit Rations panel, as shown in the following figure.

Chapter 18. Administering DB2 Admin 401


DB2 Admin ------------- DB2X Buffer Pool Hit Ratios ---------------------------
Command ===>

Line commands: DIS - Display buffer pool

BP Random Random Hit


Select Name VP Size HP Size Get Pages I/Os Ratio
------ ------ -------- ------- --------- ---------- ------
BP0 63605 1262 98.02
BP1 256 14 94.53
BP2 568 99 82.57
BP3 519 12 97.69
BP32K 1152 0 100.00
BP8K0 38772 2134 94.50
BP16K0 556 12 97.84
******************************* END OF DB2 DATA *******************************

Figure 268. Buffer Pool Hit Ratios panel (ADB2ZBH2)

The following fields are available on this panel:


SELECT
Input field where you list one of the line commands listed on the panel.
BP NAME
Name of the buffer pool.
VP SIZE
Size of the virtual buffer pool.
HP SIZE
Size of the hiperpool.
RANDOM GET PAGES
Number of random GETPAGES (RGP).
RANDOM I/Os
Number of random I/Os (RIO).
HIT RATIO
Buffer pool hit ratio, which is calculated as follows:
100 * (RGP - RIO) / RGP
Related information
IBM Publications Center

Displaying archive log information


You can display information about the input archive log.

To display information about the input archive log:

Select option LD on the System Administration panel. The Display Archive Log
Parameters panel is displayed, as shown in the following figure.

402 User's Guide and Reference


DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-DIS ARCHIVE

********************************* TOP OF DATA *********************************


DSNJ322I Û DISPLAY ARCHIVE REPORT FOLLOWS-
COUNT TIME
(TAPE UNITS) (MIN,SEC)
DSNZPARM 2 0,00
CURRENT 2 0,00
===============================
ADDR STATUS CORR-ID VOLSER DATASET_NAME
NO TAPE ARCHIVE READING ACTIVITY.
END OF DISPLAY ARCHIVE REPORT.
DSN9022I Û DSNJC001 '-DIS ARCHIVE' NORMAL COMPLETION
******************************** BOTTOM OF DATA ********************************

Figure 269. Display Archive Log panel (ADB2DB2O)

DB2 Admin generates this panel by issuing the -DISPLAY ARCHIVE command.
Related information
IBM Publications Center

Setting archive log parameters


You can set the upper limit for the number of and the deallocation time of tape
units for the archive log.

To set the upper limit for the number of and the deallocation time of tape units for
the archive log:
1. Select option LS on the System Administration panel. The Set Archive Log
Parameters panel is displayed, as shown in the following figure.

DB2 Admin --------------- DB2X Set Archive Log Parameters --------------- 16:08
Command ===>

-SET ARCHIVE

COUNT(
Max tape units ===> 2 (1-99, DSNZPARM default is 2)

) TIME(
Tape retain minutes ===> 0 (0-1440, DSNZPARM default is 0)
Tape retain seconds ===> 00 (0-59)
)

Figure 270. Set Archive Log Parameters panel (ADB2ZLSS)

2. Enter the appropriate keywords and parameters on the panel. Enter the
following values:
v Max tape units
v Tape retain minutes
v Tape retain seconds
3. Press Enter. DB2 Admin issues the DB2 -SET ARCHIVE command with the
parameter settings that you specified. The information DB2 Admin returns to
you from the command is in ISPF browse format.

Chapter 18. Administering DB2 Admin 403


Related information
IBM Publications Center

Archiving the current DB2 log


You can archive the current DB2 log.

To archive the current DB2 log:


1. Select option LA on the System Administration panel. The Archive Current Log
panel is displayed, as shown in the following figure. Go thru the door.

DB2 Admin ----------------- DB2X Archive Current Log -------------------- 16:08


Command ===>

-ARCHIVE LOG

MODE(QUIESCE)
Create system POC ===> (Yes/No)
TIME(
Max POC quiesce secs ===> (1-999)
) WAIT(
Wait for POC ===> (Yes/No)
)

Figure 271. Archive Current Log panel (ADB2ZLA)

2. Enter the appropriate keywords and parameters on the panel and press Enter.
DB2 Admin issues the DB2 -ARCHIVE LOG command. The information DB2
Admin returns to you from the command is in ISPF browse format.
Related information
IBM Publications Center

Displaying log information


You can display information about the DB2 log.

To display information about the DB2 log:


1. Select option LI on the System Administration panel. The Display Log
Information panel is displayed, as shown in the following figure.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-DIS LOG

********************************* Top of Data **********************************


DSNJ370I DB2X DSNJC00A LOG DISPLAY
CURRENT COPY1 LOG = DB2X.LOGCOPY1.DS02 IS 75% FULL
CURRENT COPY2 LOG = DB2X.LOGCOPY2.DS02 IS 75% FULL
H/W RBA = 000003AF8836, LOGLOAD = 50000
FULL LOGS TO OFFLOAD = 0 OF 6, OFFLOAD TASK IS (AVAILABLE)
DSNJ371I DB2X DB2 RESTARTED 19:45:59 NOV 28, 2003
RESTART RBA 000003AC7000
DSN9022I DB2X DSNJC001 '-DIS LOG' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 272. Display Log Information panel (ADB2DB2O)

404 User's Guide and Reference


2. Enter the appropriate keywords and parameters and press Enter. DB2 Admin
issues the DB2 -DISPLAY LOG command. The information DB2 Admin returns
to you from the command is in ISPF browse format.
Related information
IBM Publications Center

Changing DB2 system checkpoint frequency


You can change how frequently DB2 should perform a system checkpoint.

To change how frequently DB2 should perform a system checkpoint (in terms of
number of DB2 log records):
1. Select option LZ on the System Administration panel. The Change DB2 System
Checkpoint Frequency panel is displayed, as shown in the following figure.

DB2 Admin -------- DB2X Change DB2 System Checkpoint Frequency ---------- 00:08
Command ===>

-SET LOG

LOGLOAD
Checkpoint frequency ===> (200-16000000)
)

Figure 273. Change DB2 System Checkpoint Frequency panel (ADB2ZLZ)

2. Enter the appropriate keywords and parameters on the panel and press Enter.
DB2 Admin issues the DB2 -SET LOG command. The information DB2 Admin
returns to you from the command is in ISPF browse format.
Related information
IBM Publications Center

Displaying or updating communications settings


DB2 uses communication settings that you can display or update.

These settings are stored in communication database (CDB) tables (SYSIBM.xxx).


1. Select option DU on the System Administration panel. The Display/Update
CDB panel is displayed, as shown in the following figure.

DB2 Admin ------------------- DB2X Display/Update CDB ------------------- 17:34


Option ===>

DB2 System: DB2X


L - Display/update LOCATIONS DB2 SQL ID: ISXSTL
1 - Display/update LUNAMES
2 - Display/update IPNAMES
3 - Display/update LUMODES
4 - Display/update MODESELECT
5 - Display/update USERNAMES
6 - Display/update LULIST

Option xI can be used to insert rows into empty tables (x= option number)

Switch Catalog Copy ===> N (N/S/C)

Figure 274. Display/Update CDB panel (ADB2Z5)

Chapter 18. Administering DB2 Admin 405


2. Select one of the following options and press Enter. Another panel is displayed
that lists the rows in the corresponding CDB table.
v Select option L to delete, insert, or update rows in the SYSIBM LOCATIONS
table.
v Select option 1 to delete, insert, or update rows in the SYSIBM LUNAMES
table.
v Select option 2 to delete, insert, or update rows in the SYSIBM IPNAMES
table.
v Select option 3 to delete, insert, or update rows in the SYSIBM LUMODES
table.
v Select option 4 to delete, insert, or update rows in the SYSIBM
MODESELECT table.
v Select option 5 to delete, insert, or update rows in the SYSIBM USERNAMES
table.
v Select option 6 to delete, insert, or update rows in the SYSIBM LULIST table.
v Select option xI (where x represents one of the previous seven option
identifiers) to insert rows into an empty CDB table. For example, to insert
rows into the SYSIBM.LVMODES table, enter 3I.
3. Follow the directions on the panel that is displayed.

Use this panel to select the table in the communications database (CDB) you want
to display or update.

If you want to insert rows into an empty table, you can do this by choosing option
xI, where x represents the table (for example, 3I tells DB2 Admin to insert rows
into the LUMODES table).

Displaying or updating the LOCATIONS table


Use the Display/Update LOCATIONS table to update the LOCATIONS table.

Select option L on the Display/Update communications database (CDB) panel to


display the Display/Update LOCATIONS panel, shown in the following figure.

This panel displays the rows in the LOCATIONS table in the CDB. You can use the
following line commands to update the LOCATIONS table:
D Deletes the row.
I Inserts a new row. Row values can be entered on the next panel.
U Updates the row. Row values can be changed on the next panel.

406 User's Guide and Reference


| ADB2Z5L n ------------ DSN9 Display/Update LOCATIONS ------- Row 1 to 11 of 20
| Command ===> Scroll ===> PAGE
|
| DB2 System: DSN9
| Line commands:
| D - Delete I - Insert U - Update DIS - Display location S - Select
| ALIAS - Aliases for location LU - LU name IP - IP name
| ILU - Insert LU IIP - Insert IP name
|
| Link
| Select Location Name Port TP Name DBALIAS TRUSTED SECURE
| * * * * * * *
| ------ ---------------> -------> ---------> -------> --------> ------- ------
| STLEC1 QMFEC01 446 N Y
| DSN8 STM4DSN8 8028 N N
| STPLEX4A_DSN7 STM4DSN7 8020 N N
| DSN9 STM4DSN9 8016 N N
| QMFAIX82 RSNAKE 50002 N N
| SQLV73A VMRACFDB 7300
| SQLV74A VMRACFDB 7400
||
| Figure 275. Display/Update LOCATIONS panel (ADB2Z5L)
|
Related information
IBM Publications Center

Displaying or updating the LUNAMES table


Use the Display/Update LUNAMES panel to update the LUNAMES table.

Select option 1 on the Display/Update communications database (CDB) panel to


display the Display/Update LUNAMES panel, as shown in the following figure.

This panel displays the rows in the LUNAMES table in the CDB. You can use the
following line commands to update the LUNAMES table:
D Deletes the row
I Inserts a new row. Row values can be entered on the next panel.
U Updates the row. Row values can be changed on the next panel.

| DB2 Admin ------------- DB2X Display/Update LUNAMES --------------- Row 1 of 2


| Command ===>
|
| DB2 System: DB2X
| Line commands:
| D - Delete I - Insert U - Update LOC - Locations LUM - Lu modes
| USER - User names MODE - Mode select ILOC - Insert location
| ILUM - Insert LU modes IMODE - Insert mode IUSER - Insert user
|
| System Security: Encrypt Mode User
| Select LU Name Mode Name In Out Password Select Names Generic
| * * * * * * * *
| ------ -------> --------- --- --- -------- ------ ----- -------
| V P Y N O N
| DKLUDB2W V A N N O N
| ******************************* END OF DB2 DATA *******************************
||
| Figure 276. Display/Update LUNAMES panel (ADB2Z51)
|

Chapter 18. Administering DB2 Admin 407


Related information
IBM Publications Center

Displaying or updating the IPNAMES table


Use the Display/Update IPNAMES panel to update the IPNAMES table.

Select option 2 on the Display/Update communications database (CDB) panel to


display the Display/Update IPNAMES panel, as shown in the following figure.

| ADB2Z52 ------------- DB2X Display/Update IPNAMES --------------- Row 1 of 1


| Command ===>
|
| DB2 System: DB2X
| Line commands:
| D - Delete I - Insert U - Update LOC - Locations USER - User names
| ILOC - Insert location IUSER - Insert user
|
| Link Security User
| Select Name Out Names IP address
| * * * *
| ------ -------> -------- ----- ---------------------------------------------->
| DKIP91 P O 132.131.61.91
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 277. Display/Update IPNAMES panel (ADB2Z52)
|
Related information
IBM Publications Center

Displaying or updating the LUMODES table


Use the Display/Update LUMODES panel to update the update the LUMODES
table.

Select option 3 on the Display/Update communications database (CDB) panel to


display the Display/Update LUMODES panel, as shown in the following figure.

The Display/Update LUMODES panel displays the rows in the LUMODES table in
the CDB. You can use the following line commands to update the LUMODES table:
D Deletes the row.
I Inserts a new row. Row values can be entered on the next panel.
U Updates the row. Row values can be changed on the next panel.

DB2 Admin -------------- DB2X Display/Update LUMODES -------------- Row 1 of 1


Command ===>

DB2 System: DB2X


Line commands:
D - Delete I - Insert U - Update LU - LU name
Conv
Select LU Name Mode Name Limit
* * *
------ -------> --------- ------
* DKLUDB2X IBMRDB 5
STM4DSN6 IBMDSN6M 50
STM4DSN5 IBMDSN5M 50
******************************* END OF DB2 DATA *******************************

Figure 278. Display/Update LUMODES panel (ADB2Z53)

408 User's Guide and Reference


Related information
IBM Publications Center

Displaying or updating the MODESELECT table


Use the Display/Update MODESELECT panel to update the MODESELECT table.

Select option 4 on the Display/Update communications database (CDB) panel to


display the Display/Update MODESELECT panel, as shown in the following
figure.

This panel displays the rows in the MODESELECT table in the CDB. You can use
the following line commands to update the MODESELECT table:
D Deletes the row.
I Inserts a new row. Row values can be entered on the next panel.
U Updates the row. Row values can be changed on the next panel.

| DB2 Admin ----------- DB2X Display/Update MODESELECT ------ ROW 1 TO 21 OF 22


| Command ===>
|
| DB2 System: DB2X
| Line commands:
| D - Delete I - Insert U - Update LU - LU name LUM - LU modes
|
| Select Auth ID Plan Name LU Name Mode Name
| * * * *
| ------ -------- --------- -------> ------->
| QMF DKLUDB2X IBMRDRS
| ST11DB2M IBMDB2LM
| ST11DB2E IBMDB2LM
| ST11DB2L IBMDB2LM
| STM4DSN6 IBMDSN6M
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 279. Display/Update MODESELECT panel (ADB2Z54)
|
Related information
IBM Publications Center

Displaying or updating the USERNAMES table


Use the Display/Update USERNAMES panel to update the USERNAMES table.

Select option 5 on the Display/Update communications database (CDB) panel to


display the Display/Update USERNAMES panel, as shown in the following figure.

This panel displays the rows in the USERNAMES table in the CDB. You can use
the following line commands to update the USERNAMES table:
D Deletes the row.
I Inserts a new row. Row values can be entered on the next panel.
U Updates the row. Row values can be changed on the next panel.

Chapter 18. Administering DB2 Admin 409


DB2 Admin ----------- DB2X Display/Update USERNAMES --------------- Row 1 of 2
Command ===>

DB2 System: DB2X


Line commands:
D - Delete I - Insert U - Update LU - LU name IP - IP name

Select T Auth ID Link New ID Password


* * * * *
------ - -------- -------- -------- --------
O
O SYSADM DKLUDB2X NORMUSR
******************************* END OF DB2 DATA *******************************

Figure 280. Display/Update USERNAMES panel (ADB2Z55)

Related information
IBM Publications Center

Displaying or updating the LULIST table


Use the Display/Update LULIST panel to update the LULIST table.

Select option 6 on the Display/Update communications database (CDB) panel to


display the Display/Update LULIST panel, as shown in the following figure.

This panel displays the rows in the LULIST table in the CDB. You can use the
following line commands to update the LULIST table:
D Deletes the row.
I Inserts a new row. Row values can be entered on the next panel.
U Updates the row. Row values can be changed on the next panel.

| DB2 Admin ------------ DB2X Display/Update LULIST -----------------------------


| Command ===>
|
| DB2 System: DB2X
| Line commands: D - Delete I - Insert U - Update LU - LU name
|
| Link Generic
| Select Name LU Name
| * *
| ------ -------> ------>
| DKLUDB21 DKLUDB2
| DKLUDB22 DKLUDB2
| ******************************* END OF DB2 DATA *******************************
||
| Figure 281. Display/Update LULIST panel (ADB2Z56)
|
Related information
IBM Publications Center

Displaying or cancelling distributed threads


You can cancel processing for distributed data facility (DDF) threads that originate
locally and access remote data, or that originate remotely and access local data.

To cancel processing for distributed data facility (DDF) threads that originate
locally and access remote data, or that originate remotely and access local data:

410 User's Guide and Reference


1. Select option DC on the System Administration panel. The Display/Cancel
Distributed Threads panel is displayed, as shown in the following figure.

DB2 Admin ------- DB2X Display/Cancel Distributed Threads --- ROW 1 TO 2 OF 2


Command ===>

Line commands:
CAN - Cancel thread DIS - Display thread details

Sel Name St A Req ID Auth ID Plan ASID Luwid


* * * * * * * * *
--- -------- -- -- ----- ------------ -------- -------- ---- ------
TSO TR * 255 ISTJE ISTJE ADB 008D 2440
DKIBM000.DKLUDB2X.AB16480C5ADD=2440 ACCESSING DATA AT
DENMARK_DB2X
BATCH TR 3 DB2XDTS IS512C1 DSNTEP2 008C 2441
DKIBM000.DKLUDB2X.AB164981904B=2441 ACCESSING DATA AT
NORDIC_DB2X
******************************* END OF DB2 DATA *******************************

Figure 282. Display/Cancel Distributed Threads panel (ADB2ZDC2)

The following fields are available on this panel:


SEL
Input field where you enter one of the line commands listed on the panel.
NAME
Connection name.
ST
Connection status.
A Active indicator.
REQ
Number of DB2 requests.
ID Correlation ID.
AUTH ID
Authorization ID.
PLAN
Plan name.
ASID
Address space ID.
LUWID
Logical unit-of-work ID.
2. Issue one of the following line commands:
v CAN to cancel a thread. When you press Enter, DB2 Admin issues the
CANCEL DDF THREAD command.
v DIS to display detailed information about a thread. When you press Enter,
DB2 Admin issues the DB2 – DISPLAY THREAD DETAILS command.
The following figure shows the type of information DB2 Admin returns
when you issue the DIS line command to display information about a thread.

Chapter 18. Administering DB2 Admin 411


DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===>

-DIS THD(*) LUWID(2440) DETAIL

********************************* TOP OF DATA *********************************


DSNV401I < DISPLAY THREAD REPORT FOLLOWS -
DSNV402I < ACTIVE THREADS -
NAME ST A REQ ID AUTHID PLAN ASID
TSO TR * 256 ISTJE ISTJE ADB 008D
-DKIBM000.DKLUDB2X.AB16480C5ADD=2440 ACCESSING DATA AT
-DENMARK_DB2X
--LOCATION SESSID A ST TIME
--DENMARK_DB2X F0839112CD27CFBC S1 9513816160825
DISPLAY ACTIVE REPORT COMPLETE
DSN9022I < DSNVDT '-DIS THD' NORMAL COMPLETION
******************************** BOTTOM OF DATA ********************************

Figure 283. Display Distributed Threads panel (ADB2DB2O)

The information DB2 Admin returns to you from the commands is in ISPF
browse format.
Related information
IBM Publications Center

Displaying location details and threads


You can display statistics about threads with a distributed relationship, or display
conversation information about DB2 system threads that interact with VTAM.

To display statistics about threads with a distributed relationship, or display


conversation information about DB2 system threads that interact with VTAM:
1. Select option DL on the System Administration panel. The Display Active
Locations panel is displayed, as shown in the following figure.

DB2 Admin ------------ DB2X Display Active Locations -------------- Row 1 of 1


Command ===> Scroll ===> PAGE

Line commands:
DIS - Display location details DIST - Display threads

Select Location PRDID Linkname Requesters Servers Convs


* * * * * *
------ ---------------- -------- ---------------- ---------- -------- --------
DENMARK_DB2P DSN04010 DKLUDB2P 0 1 3
DENMARK_DB2X DSN05010 DKLUDB2X 0 0 2
NORDIC_DB2P DSN05010 NOLUDB2P 0 0 2
NORDIC_DB2R DSN05010 NOLUDB2R 0 0 2
NORDIC_DB2T DSN05010 NOLUDB2T 0 0 2
NORDIC_DB2X DSN05010 NOLUDB2X 0 0 2
******************************* END OF DB2 DATA *******************************

Figure 284. Display Active Locations panel (ADB2ZDL2)

The following fields are available on this panel:


SELECT
Input field where you enter one of the line commands listed on the panel.
LOCATION
Location name.

412 User's Guide and Reference


PRDID
Database product.
LINKNAME
LU name.
REQUESTERS
Number of requestors.
SERVERS
Number of servers.
CONVS
Number of conversations.
2. Issue one of the following line commands:
v DIS to display detailed information about a thread. When you press Enter,
DB2 Admin issues the DB2 – DISPLAY THREAD DETAILS command.
v DIST to display the threads. When you press Enter, DB2 Admin issues the
DB2 – DISPLAY THREAD command.
The information DB2 Admin returns to you from the commands is in ISPF
browse format.
Related information
IBM Publications Center

Starting DDF
You can start DDF.

To start DDF:

Select option DT on the System Administration panel, and press Enter. DB2 Admin
issues the DB2 -STA DDF command and displays the status of the command in an
ISPF browse session, as shown in the following figure.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-STA DDF

********************************* TOP OF DATA *********************************


DSNL021I Û START DDF COMMAND ACCEPTED
******************************** BOTTOM OF DATA ********************************

Figure 285. Start DDF panel (ADB2DB2O)

Related information
IBM Publications Center

Stopping DDF
You can stop the distributed data facility (DDF) if it has already been started.

To stop the distributed data facility (DDF) if it has already been started:
1. Select option DS on the System Administration panel. The Stop DDF panel is
displayed, as shown in the following figure.

Chapter 18. Administering DB2 Admin 413


DB2 Admin ------------------------ DB2X Stop DDF ------------------------ 16:16
Command ===>

-STOP DDF

MODE(
Stop mode ===> (Quiesce or Force, default is quiesce)
)

Figure 286. Stop DDF panel (ADB2ZDS)

2. Enter Quiesce or Force in the Stop Mode field.


3. Press Enter. DB2 Admin issues the DB2–STOP DDF command. The information
DB2 Admin returns to you from the command is in ISPF browse format.
Related information
IBM Publications Center

Managing stored procedures


You can manage stored procedures.

To manage stored procedures:


1. Select option PM on the System Administration panel. The Manage Stored
Procedures panel is displayed, as shown in the following figure. This panel lists
the stored procedure-related operations that are supported by DB2 Admin. The
format of this panel varies depending on the version of DB2 that you are using.

DB2 Admin ---------------- DB2X Manage Stored Procedures ---------------- 00:09


Option ===>

DB2 System: DB2X


1 - Display/alter stored procedures DB2 SQL ID: ISTJE
2 - Create stored procedure
3 - Display stored procedure statistics
4 - Start all stored procedures
5 - Stop all stored procedures
6 - Create view on SYSIBM.SYSROUTINES
7 - Display views on SYSIBM.SYSROUTINES

Stored procedure catalog table/view for option 1:


Owner ===> (default is SYSIBM)
Name ===> (default is SYSROUTINES)

Stored procedures are also available from option 1.0

Figure 287. Manage Stored Procedures panel (ADB2ZP)

2. Select an option and press Enter. If you choose option 1, fill in the Owner and
Name fields. When you press Enter, another panel is displayed that
corresponds to the option that you chose.

Displaying or altering stored procedures


You can display or alter stored procedures.

To display or alter stored procedures:

Select option 1 on the Manage Stored Procedures panel. TheDisplay/Alter Stored


Procedures panel is displayed, as shown in the following figure.

414 User's Guide and Reference


| DB2 Admin ---------------- DB2X Stored Procedures ---------------- Row 1 of 11
| Command ===> Scroll ===> PAGE
|
| Line commands:
| AH - Schema Auth A - Auth DROP - Drop AL - Alter K - Package PA - Parms
| DIS - Display STO - Stop STA - Start GR - Grant COM - Comment
| ? - Show all line commands
| S
| Res Q S P C External
| Sel Schema Name Version A Lang Parms Set O L R T R Name
| * * * * * * * * * * * * *
| ---- -------- ------------------ -------> - ---- ------ --- - - - - - -------->
| SMITHJR PJ PLI 0 0 E M N M N PJ
| SMITHJR PJCOPD2 V1 Y SQL 5 0 N M N N
| SMITHJR PJCOPED PLI 5 0 E M N M N PJCOPED
| SMITHJR PJJAVAPRC JAVA 0 10 E M N S N PKG402110
| SMITHJR PJNSP DISABLED N SQL 1 0 N M N N
| SMITHJR PJNSP VER1 Y SQL 1 0 N M N N
| SMITHJR PJNSP VER2 N SQL 1 0 N M N N
| SMITHJR PJNSP VER3 N SQL 1 0 N M N N
| SMITHJR PJNSP VER4 N SQL 1 0 N M N N
| ******************************* END OF DB2 DATA *******************************
||
| Figure 288. Display/Alter Stored Procedures panel (ADB21O)
|
This panel shows the stored procedures you have defined in your system.
The following fields are available on this panel:
SEL
Input field where you enter one of the line commands listed on the panel.
SCHEMA
Schema of the stored procedure.
NAME
Name of the stored procedure.
| VERSION
| Version of the native SQL procedure.
| A Active. Identifies the active version of a native SQL procedure.
LANGUAGE
Implementation language.
PARMS
Number of parameters for the stored procedure.
LANGUAGE
Implementation language.
RES SET
Maximum number of result sets that can be returned.
| O Origin of the native SQL procedure.
SQL
Whether SQL statements are allowed, which is one of the following:
N Contains no SQL statements
C Contains SQL statements
R Reads SQL data
M Modifies SQL data
SR
Whether the program should remain resident when it ends.
Y Program remains resident
N Program does not remain resident

Chapter 18. Administering DB2 Admin 415


blank Not external or user-defined function.
PT
Program type, which is one of the following:
M Main
S Subroutine
CR
Commit on return.
Y Program is committed immediately.
N Program continues.
blank Not applicable.
EXTERNAL NAME
Load module name for the stored procedure.

| Note: The SRC line command is not supported for native SQL procedures. Press
| PF1 if you get an invalid line command message and look at the O column.
| If there is an N in that column, then the SRC command is not supported. An
| E in the O column indicates the SRC command is supported.

Creating stored procedures


You can create a stored procedure.

Restriction: When creating SQL stored procedures, the maximum length of the
procedure body is 2MB (32,767KB).

To create a stored procedure:


1. Select option 2 on the Manage Stored Procedures panel. The Create Stored
Procedure panel is displayed, as shown in the following figure.

| DB2 Admin -------------------- DB2X Create Procedure -------------------- 11:00


| Command ===>
|
| CREATE PROCEDURE
|
| Schema . . . . . SMITHJR > (Default is SMITHJR)
| Name . . . . . . PJNEWSP > (? to look up existing procedures)
|
| (
| Number of parameters . . 1 (0-255)
| )
|
| LANGUAGE . . . . SQL (ASSEMBLE,C,PLI,COBOL,REXX,JAVA,SQL)
|
| Native SP . . . Y (Yes,No)
| VERSION . . . V7 > (optional, default is V1)
||
| Figure 289. Create Stored Procedure panel (ADB26CO)
|
2. Enter the required parameters and press Enter to continue with the create
operation, or press End to avoid creating a procedure.
| 3. On the Create Stored Procedure Parameters panel, enter the stored procedure
| parameters for the language you specified. For example, the language SQL
| procedure types panel is shown in the following figure. DB2 Admin issues the
| SQL CREATE PROCEDURE statement with the parameters you specify.
|

416 User's Guide and Reference


| DB2 Admin -------------------- DB2X Create Stored Procedure Parameters------------- 11:00
| Command ===>
|
| CREATE PROCEDURE "PJ_NP" ..
| (parameter number 1) LANGUAGE SQL ..
|
| Parm type . . . IN (IN, OUT, or INOUT)
| Parm name . . . P1 > (Parameter name)
|
| For a non table like parameter specify:
|
| Data type . . . BIGINT > (Built-in only)
| Length . . . . . (1 if DBCLOB with units indicator G)
| Scale . . . . .
|
| FOR ? DATA . . . (BIT, SBCS, or MIXED)
| CCSID . . . . . (ASCII, EBCDIC, or UNICODE)
| AS LOCATOR . . . (Yes/No)
|
| For a TABLE LIKE parameter specify:
| Table owner . . > (Default is SMITHJR)
| Table name . . . > (Table parameter, ? to look up)
||
| Figure 290. Create Stored Procedure Parameters panel (ADB26COU)
|
Related tasks
“Creating native SQL procedures”
Related information
IBM Publications Center

| Creating native SQL procedures


| You can use the CREATE SQL procedure to create a native SQL procedure.

| Restriction: The maximum length of the native SQL procedure body is 2 MB


| (32,767 KB).

| You can create a native SQL procedure to help you with commonly performed
| tasks. For example, if you often need to create a test database, you can create a
| native SQL procedure to create a test database every time that you need to do so.
| You can also use other functions within DB2 Admin to generate the native SQL
| procedure's DDL and to reuse that DDL for a different database and its objects.

| To create a native SQL procedure that creates a test database:


| 1. Select option 2.4 on the Administration Menu and then enter option CO. The
| Create Procedure panel is displayed.
|

Chapter 18. Administering DB2 Admin 417


| DB2 Admin -------------------- DB2X Create Procedure -------------------- 11:00
| Command ===>
|
| CREATE PROCEDURE
|
| Schema . . . . . > (Default is SMITHJR)
| Name . . . . . . SPTDEMO1 > (? to look up existing procedures)
|
| (
| Number of parameters . . 0 (0-255)
| )
|
| LANGUAGE . . . . SQL (ASSEMBLE,C,PLI,COBOL,REXX,JAVA,SQL)
|
| Native SP . . . YES (Yes,No)
| VERSION . . . V1 > (optional, default is V1)
||
| Figure 291. Create Procedure panel (ADB26CO)
|
| 2. Enter the required parameters and press Enter.
| 3. On the Create SQL Procedure Body panel, enter the SQL procedure body. For
| example, enter CREATE DATABASE DBDEMO1, as shown in the following
| figure:
| Now that the native SQL procedure has been created, use either the DDL line
| ADB26COQ ----- DB2X Create SQL Stored Procedure Body ---- Columns 00001 00072
| Command ===> Scroll ===> CSR
|
| CREATE PROCEDURE "SPTDEMO1" ..
| ****** ***************************** Top of Data ******************************
| ==MSG> -Warning- The UNDO command is not available until you change
| ==MSG> your edit profile using the command RECOVERY ON.
| ''''''
| '''''' CREATE DATABASE DBDEMO1
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ''''''
| ****** **************************** Bottom of Data ****************************
||
| Figure 292. Create Stored Procedure Parameters panel (ADB26COQ)
|
| command or the GEN function to generate the DDL. The next steps show you
| how to use the GEN function to generate the DDL with masking into a work
| statement list.
| 4. Select option 1 - DB2 system catalog on the Administration Menu. Then select
| option O on the System Catalog panel to display the Stored Procedures panel
| ADB210. Type GEN next to your SQL procedure name.
|

418 User's Guide and Reference


| ADB21O in ---------------- DB2X Stored Procedures ------------ Row 1 to 1 of 1
| Command ===> Scroll ===> CSR
|
| Commands: GRANT
| Line commands:
| AH - Schema Auth A - Auth DROP - Drop AL - Alter K - Package PA - Parms
| DIS - Display STO - Stop STA - Start GR - Grant COM - Comment
| ? - Show all line commands
| S
| Res Q S P C External
| Sel Schema Name Version A Lang Parms Set O L R T R Name
| * * * * * * * * * * * * *
| ---- -------- ------------------ -------- - ---- ------ --- - - - - - ---------
| GEN SYSADM SPTDEMO1 V1 Y SQL 0 0 N M N N
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 293. Stored Procedures panel (ADB210)
|
| The Generate SQL from DB2 catalog panel (ADB2GENS) is displayed.
| 5. Use the GEN function to generate the DDL with masking into a work
| statement list. Specify YES in the CREATE PROCEDURE, Use Masking, and
| Add to work stmt list list fields.
| The ADB2EDIT panel is displayed.
| ADB2GENS -------------- DB2X Generate SQL from DB2 catalog ------------- 15:36
| Option ===>
|
| Generate SQL statements for: DB2 System: V91A
| stored procedure SYSADM.SPTDEMO1 DB2 SQL ID: SYSADM
| More: +
| SQL statement types to be generated from the DB2 catalog:
|
| CREATE PROCEDURE . . . . : Y (Y,N,A) GRANT access ON PROCEDURE. : N (Y,N)
| REBIND PLAN. . . . . . . : Y (Y,N,D) COMMENT ON . . . . . . . . : Y (Y,N)
|
| New names/values for generated SQL: (leave blank to use current values)
| Object owner. . . . . : > Run SQLID. . . . . . . . . :
| Object grantor. . . . :
| Object schema . . . . : >
| Target DB2 version. . : (Current DB2 version: 915)
| Use Masking . . . . . : YES (Yes/No)
| Generate catalog stats: NO (Yes/No/Only)
| Target cat qualifier: > (Default is SYSIBM)
|
| Output file and execution mode:
| Add to work stmt list : YES (Yes/No)
| Data set name . . . . : 'SYSADM.NSPDMO1.DDL
| Data set disposition. OLD (OLD, SHR, or MOD)
| Execution mode. . . . . BATCH (BATCH or TSO)
| Commit statements per . (All or None. Default is All)
| DB2 defaults handling . (Keep or Remove. Default is Keep)
|
| DB2 Command output file:
| Data set name . . . . .
| Data set disposition. OLD (OLD, SHR, or MOD)
|
| BP - Change batch job parameters
||
| Figure 294. Generate SQL from DB2 catalog panel (ADB2GENS)
|
| 6. On the ADB2EDIT panel, specify masks for the SQL stored procedure.. In the
| following example, specify SPTDEMO1, SPTDEM02 for STPNAME and DBDEMO1,
| DBDEMO2 for DBNAME.
|

Chapter 18. Administering DB2 Admin 419


| ADB2EDIT -------------------- -------------------------- Columns 00001 00072
| Command ===> Scroll ===> CSR
|
| ==MSG> - To support/migrate DB2V8 masking input,OWNER,TBOWNER and
| ==MSG> IXOWNER will mask both owner and schema fields.SCHEMA,
| ==MSG> TBSCHEMA and IXSCHEMA will be applied to schema fields only.
| ==MSG> Examples:
| ==MSG> COMPRESS:MYDB*.MYTS*,YES
| ==MSG> SEGSIZE:MYDB*.MYTS*,8
| ==MSG> DSSIZE:MYDB*.MYTS*,4G
| ==MSG> PRIQTY:*.*,REXX(MYPRIQTY,DBNAME='MYDBTEST')
| ==MSG> TSPRIQTY:MYDB*.MYTS*,30
| ==MSG> IXPRIQTY:MYCR*.MYIX*,25%
| ==MSG> IXSECQTY:MYCR*.MYIX*,REXX(MYSECQTY,IXNAME,IXCREATOR,PCT=20%)
| ==MSG> DEFER:USER001.*IXNAME,NO
| ==MSG> DEFINE:DBNAME*.*TSPC,REXX(MYDEFINE,DEFINE='YES')
| ==MSG>
| ==MSG> -Warning- The UNDO command is not available until you change
| ==MSG> your edit profile using the command RECOVERY ON.
| 000100 STPNAME:SPTDEMO1,SPTDEMO2
| 000200 DBNAME:DBDEMO1,DBDEMO2
| ****** **************************** Bottom of Data ****************************
||
| Figure 295. ADB2EDIT panel
|
| 7. Return to panel ADB2GENS and specify the work statement list data set name
| and the work statement list name.
|
| ADB2GENS -------------- DB2X Generate SQL from DB2 catalog ------------- 15:36
| Option ===>
|
| Generate SQL statements for: DB2 System: V91A
| stored procedure SYSADM.SPTDEMO1 DB2 SQL ID: SYSADM
| More: +
| SQL statement types to be generated from the DB2 catalog:
| EssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssN
| e ADB2WLDA ------------------ Specify Work Statement List ----------------- e
| e e
| e e
| e Work stmt list dsn . . . 'SYSADM.NSPDEMO2.WSL' e
| e Work stmt list name . . . NSPDEMO2 e
| e e
| e e
| e e
| e e
| e e
| e e
| e e
| e e
| DssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssM
| Data set name . . . . : 'SYSADM.NSPDMO1.DDL
||
| Figure 296. Generate SQL from DB2 catalog panel (ADB2GENS)
|
| 8. Open the DB2 Admin menu and select the W option for WSL. The ADB2W
| panel is displayed. Select option 1 to show the work statement list library.
|
| ADB2W min --------------- DB2X Manage Work Statement Lists -------------- 15:43
| Option ===> 1
|
| 1 - Show work statement list library DB2 System: V91A
| 2 - Show work statement list DB2 SQL ID: SYSADM
|
| Work stmt list dsn ===> 'SYSADM.NSPDEMO2.WSL'
| Work stmt list name ===> NSPDEMO2
||
| Figure 297. Manage Work Statement Lists panel (ADB2W)
|

420 User's Guide and Reference


| 9. On the ADB2W1 panel enter the S line command to show the work statement
| list.
|
| ADB2W1 in ----------- Work Statement List Library: 'SYSADM.NSP Row 1 to 1 of 1
| Command ===> Scroll ===> CSR
|
| Line commands:
| S - Show R - Run in batch D - Delete C - Copy A - Append Q - Clone
| I - Interpret V - Validate E - Edit O - Run online
|
| Sel Name Created Changed ID
| * * * *
| --- -------- ---------- ---------------- --------
| S NSPDEMO2 2009/06/01 2009/06/01 15:43 SYSADM
| ******************************* END OF DB2 DATA *******************************
||
| Figure 298. Work Statement List Library panel (ADB2W1)
|
| The work statement list is displayed:
|
| ADB2W1S n ----------- Show Work Statement List: NSPDEMO2 -- Row 27 to 39 of 39
| Command ===> Scroll ===> CSR
|
| Line commands:
| D - Delete I - Insert E - Edit C - Copy M - Move A - After B - Before
| R - Repeat
|
| Select Type Statement
| * *
| ------ ---- ------------------------------------------------------------------>
| COM --
| DML SET CURRENT PATH = "SYSIBM","SYSFUN","SYSPROC","SYSADM"
| COM --
| DDL CREATE PROCEDURE SYSADM.SPTDEMO2.. ().. VERSION V1.. LAN
| COM --
| DML COMMIT
| COM --
| COM --#SET TERMINATOR ;
| COM --
| COM -------------------------------------------------------------------
| COM -- ADB2GEN - End of generated DDL
| COM -------------------------------------------------------------------
| COM --
||
| Figure 299. Show Work Statement List panel
|
| 10. Return to panel ADBW1 and enter the V line command to validate the work
| statement list.
|
| ADB2W1 in ----------- Work Statement List Library: 'SYSADM.NSP Row 1 to 1 of 1
| Command ===> Scroll ===> CSR
|
| Line commands:
| S - Show R - Run in batch D - Delete C - Copy A - Append Q - Clone
| I - Interpret V - Validate E - Edit O - Run online
|
| Sel Name Created Changed ID
| * * * *
| --- -------- ---------- ---------------- --------
| V NSPDEMO2 2009/06/01 2009/06/01 15:43 SYSADM
| ******************************* END OF DB2 DATA *******************************
||
| Figure 300. Work Statement List Library panel
|
| The Validation Work Statement List Report is displayed:
|

Chapter 18. Administering DB2 Admin 421


| SDSF OUTPUT DISPLAY VLDNSP2 JOB00083 DSID 105 LINE 27 COLUMNS 02- 81
| COMMAND INPUT ===> SCROLL ===> CSR
| RENAME statements.
| --------------------------------------------------------------------------------
|
|
| VALIDATE WORK STATEMENT LIST REPORT
| ===================================
|
| Prepared on V91A (DB2 Release 915) by SYSADM at 2009-06-01 16:10
| for SYSADM.NSPDEMO2.WSL(NSPDEMO2)
|
| ADB3020W Warning for Procedure SYSADM.SPTDEMO2M in CREATE/ALTER Procedure NSP body
| statement:
| Objects referenced in
| Create/Alter/Comment/Drop/Exchange/Label/Rename may or may not exist during NSP
| runtime
|
| CREATED OBJECTS
| ----------------
| Procedure SYSADM.SPTDEMO2M
|
|
| Figure 301. Validation Work Statement List Report
|
| 11. After you validate the work statement list, enter the R line command to run
| the JCL job.
|
| ADB2W1 in ----------- Work Statement List Library: 'SYSADM.NSP Row 1 to 1 of 1
| Command ===> Scroll ===> CSR
|
| Line commands:
| S - Show R - Run in batch D - Delete C - Copy A - Append Q - Clone
| I - Interpret V - Validate E - Edit O - Run online
|
| Sel Name Created Changed ID
| * * * *
| --- -------- ---------- ---------------- --------
| R NSPDEMO2 2009/06/01 2009/06/01 16:02 SYSADM
| ******************************* END OF DB2 DATA *******************************
||
| Figure 302. Work Statement List Library panel (ADB2W1)
|
| 12. Return to panel ADB210 and verify that the SPTDEMO2 native SQL procedure
| was created successfully.
|
| ADB21O in ---------------- DB2X Stored Procedures ------------ Row 1 to 2 of 2
| Command ===> Scroll ===> CSR
|
| Commands: GRANT
| Line commands:
| AH - Schema Auth A - Auth DROP - Drop AL - Alter K - Package PA - Parms
| DIS - Display STO - Stop STA - Start GR - Grant COM - Comment
| ? - Show all line commands
| S
| Res Q S P C External
| Sel Schema Name Version A Lang Parms Set O L R T R Name
| * * * * * * * * * * * * *
| ---- -------- ------------------ -------- - ---- ------ --- - - - - - ---------
| SYSADM SPTDEMO1 V1 Y SQL 0 0 N M N N
| SYSADM SPTDEMO2 V1 Y SQL 0 0 N M N N
| ******************************* END OF DB2 DATA *******************************
||
| Figure 303. Stored Procedures panel (ADB210)
|
| v You used the CREATE Stored Procedure function to create a native SQL
| procedure.

422 User's Guide and Reference


| v You used the GEN function to generate the DDL with masking into a work
| statement list to create another native SQL procedure.
| v You validated and ran the generated work statement list to successfully create
| the new native SQL stored procedure.
| Related tasks
| “Creating stored procedures” on page 416

Displaying stored procedure statistics


You can display stored procedure statistics.

To display stored procedure statistics:

Select option 3 on the Manage Stored Procedures panel to display the Display
Stored Procedure Statistics panel, as shown in the following figure. This panel
shows statistics for stored procedures that are accessed by DB2 applications.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-DIS PROC(SYSPROC.DSNWZP)

********************************* Top of Data **********************************


DSNX940I ? DSNX9DIS DISPLAY PROCEDURE REPORT FOLLOWS -
------- SCHEMA=SYSPROC
DSNX9DIS PROCEDURE DSNWZP HAS NOT BEEN ACCESSED OR IS NOT DEFINED
DSNX9DIS DISPLAY PROCEDURE REPORT COMPLETE
DSN9022I ? DSNX9COM '-DISPLAY PROC' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 304. Display Stored Procedure Statistics panel (ADB2DB2O)

Starting all stored procedures


You can start all stored procedures.

To start all stored procedures:

Select option 4 on the Manage Stored Procedures panel. DB2 Admin issues the DB2
START STORED PROCEDURE(*.*) command, and displays the status of the
command in an ISPF edit session, as shown in the following figure.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-STA PROC(*.*)

********************************* Top of Data **********************************


DSNX946I ? DSNX9ST2 START PROCEDURE SUCCESSFUL FOR *.*
DSN9022I ? DSNX9COM '-START PROC' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 305. Start All Stored Procedures panel (ADB2DB2O)

Stopping all stored procedures


You can stop all stored procedures.

To stop all stored procedures:

Chapter 18. Administering DB2 Admin 423


Select option 5 on the Manage Stored Procedures panel. When you press Enter,
DB2 Admin issues the DB2 STOP PROCEDURES(*.*) command and displays the
status of the command in an ISPF edit session, as shown in the following figure.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-STO PROC(*.*)

********************************* Top of Data **********************************


DSNX947I ? DSNX9SP2 STOP PROCEDURE SUCCESSFUL FOR *.*
DSN9022I ? DSNX9COM '-STOP PROC' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 306. Stop All Stored Procedures panel (ADB2DB2O)

Creating views of stored procedures


You can create a view of stored procedures on SYSIBM.SYSROUTINES which is
useful if you want to let people administer their own stored procedures.

To create a view of stored procedures:


1. Select option 6 on the Manage Stored Procedures panel. The Create View on
SYSIBM.SYSROUTINES panel is displayed, as shown in the following figure.
This panel lets you define a view for all procedures with the (LIKE) pattern
you define.

DB2 Admin ------------- DB2X Create View on SYSIBM.SYSROUTINES ---------- 00:12


Command ===>

CREATE VIEW

Owner ===> ISTJE >


Name ===> ADB_ROUTINES >

AS SELECT *
FROM SYSIBM.SYSROUTINES
WHERE SCHEMA LIKE '
Pattern ===> ADB% > '

WITH CHECK OPTION ;

GRANT SELECT,INSERT,UPDATE,DELETE ON (above table) TO


Grantees ===>

Figure 307. Create View on SYSIBM.SYSROUTINES panel (ADB2ZP6)

2. Fill in the fields on this panel to create a view, for example, define view
ABC.PROCEDURES as a view on SYSIBM.SYSROUTINES WHERE SCHEMA
LIKE 'ABC. View ABC.PROCEDURES contains all stored procedures with the
schema starting with ABC. In addition, you can issue GRANT SELECT,
INSERT, UPDATE, or DELETE statements on the view to a list of authorization
IDs (grantees).

Displaying views of stored procedures


You can display views of stored procedures.

To display the views that exist on SYSIBM.SYSROUTINES:

Select option 7 on the Manage Stored Procedures panel. The Tables, Views, and
Aliases panel is displayed, as shown in the following figure. This panel shows the

424 User's Guide and Reference


views that exist on SYSIBM.SYSROUTINES; for example, it would show the views
created using option 6 on the Manage Stored Procedures panel.

| DB2 Admin ----------- DB2X Tables, Views, and Aliases ------- ROW 1 TO 3 OF 3
| Command ===>
|
| Commands: GRANT MIG ALL
| Line commands:
| C - Columns A - Auth L - List X - Indexes S - Table space D - Database
| V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
| ? - Show all line commands
|
| Sel Name Schema T DB Name TS Name Cols Rows Checks
| * * * * * * * * *
| ----- ------------------ -------- - -------- -------- ------ ----------- ------
| PROCEDURES ISTJE V DSNDB06 SYSOBJ 79 -1 0
| FUNCTIONS ISTJE V DSNDB06 SYSOBJ 79 -1 0
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 308. Tables, Views, and Aliases panel showing views on SYSIBM.SUBROUTINES
| (ADB21T)

Related reference
“Option T. Tables, Views, and Aliases” on page 594

Managing functions
You can use DB2 Admin to manage functions.

To manage functions:
1. Select option FM on the System Administration panel. The Manage Functions
panel is displayed, as shown in the following figure. This panel lists the
Functions-related operations that are supported by DB2 Admin.

DB2 Admin ---------------- DB2X Manage Functions ------------------------ 18:35


Option ===>

DB2 System: DB2X


1 - Display/alter functions DB2 SQL ID: ISXSTL
2 - Create functions
3 - Display function statistics
4 - Start all functions
5 - Stop all functions
6 - Create view on SYSIBM.SYSROUTINES
7 - Display views on SYSIBM.SYSROUTINES

Catalog table/view for options 1-2:


Owner ===> SYSIBM (default is SYSIBM)
Name ===> SYSROUTINES (default is SYSROUTINES)

User defined functions can also be managed from option 1.F

Figure 309. Manage Functions panel (ADB2ZF)

2. Select an option and press Enter. If you choose option 1, fill in the Owner and
Name fields. When you press Enter, another panel is displayed that
corresponds to the option that you chose.

Displaying or altering functions


You can display or alter functions.

To display or alter functions:

Chapter 18. Administering DB2 Admin 425


Select option 1 on the Manage Functions panel. The Display or Alter Functions
panel is displayed, as shown in the following figure.
The Display or Alter Functions panel displays information about all the
DB2 Admin -------------------- DB2X Functions -------------------- Row 1 of 44
Command ===> Scroll ===> PAGE

Line commands:
AH - Schema auth A - Auth DROP - Drop AL - Alter K - Package PA - Parms
RT - Return type DIS - Display STO - Stop STA - Start GEN - Generate DDL
COM - Comment I - Interpret CRE - Create func GR - Grant JAR - JAVA detail
DDL - Object DDL
D S
F E E C P Q S P E External
S Schema Name Specific Name O T Parms T A F S F L R T S Name
* * * * * * * * * * * * * * * *
---- -------> -------> -----------------> - - ------ - - - - - - - - - --------
ISTJE + SQL990208100338896 U S 2 N
ISTJE - KR_MINUS U S 2 N
ISTJE BLOB SQL99020816075424# S S 1 Y
ISTJE CHAR SQL990208160600039 S S 1 Y
ISTJE CLOB SQL99020816074873# S S 1 Y
ISTJE D SQL99020817171170M S S 1 Y
ISTJE DATE SQL99020816083184# S S 1 Y
ISTJE DECIMAL SQL99011815223541B S S 1 Y
ISTJE DECIMAL SQL99021816281595J S S 1 Y
ISTJE DECIMAL SQL99020817171173M S S 1 Y

Figure 310. Manage Functions panel (ADB21F)

user-defined functions in your DB2 subsystem.


The following fields are available on this panel:
S Input field where you enter one of the line commands listed on the panel.
SCHEMA
Schema of the function.
NAME
Name of the function.
SPECIFIC NAME
Specific name of the function.
O Origin of the function, which is one of the following:
E External
U Sourced
S System generated
Q SQL
FT Function type, which is one of the following:
C Column
S Scaler
T Table
PARMS
Number of parameters for the function.
DET
Whether the external function returns the same result when called using the
same parameters. This field contains one of the following:
Y Yes
N No
blank The routine is a function, but not an external function.

426 User's Guide and Reference


EA
Whether the external function changes the state of an object that DB2 does not
manage. This field contains one of the following:
Y Yes
N No
blank The routine is not an external function.
CF
Cast function, which is one of the following:
Y Yes
N No
PS Parameter style, which is one of the following:
D DB2SQL
G General
N General with nulls
J Java
blank Not external or user-defined function.
F Fenced (applies if it is run separately from DB2).
SQL
Whether SQL statements are allowed, which is one of the following:
N Contains no SQL statements
C Contains SQL statements
R Reads SQL data
M Modifies SQL data
blank Not applicable
SR
Whether the program should remain resident when it ends.
Y Program remains resident
N Program does not remain resident
blank Not external or user-defined function.
PT
Program type, which is one of the following:
M Main
S Subroutine
blank Not external or user-defined function.
ES External security, which is one of the following:
D DB2 address space user
U User
C Definer
blank Not external or user-defined function.
EXTERNAL NAME
Load module name for the stored procedure. This field is blank if it is not an
external or user-defined function.

Creating functions
You can create new, user-defined functions.

To create a new user-defined function:


1. Select option 2 on the Manage Functions panel. The Create Function panel is
displayed, as shown in the following figure.

Chapter 18. Administering DB2 Admin 427


DB2 Admin --------------------- DB2X Create Function -------------------- 18:38
Command ===>

CREATE FUNCTION

Schema ===> > (Default is ISTJE)


Name ===> > (? to look up existing functions)

(
Number of parameters ===> (0-255)
)

SPECIFIC ===> > (Specific name)


(continued...)

Figure 311. Create Function panel (ADB26CF)

2. Enter the required parameters and press Enter to continue with the create
operation, or press End to avoid creating a function. DB2 Admin issues the
SQL CREATE FUNCTION statement with the parameters you specify.
To create a new SQL scalar function:

Restriction: When creating SQL scalar functions, the maximum length of the
return statement is 2MB (32,767KB).
a.Write the SQL scalar function as part of the CREATE statement.
b.Pre-compile, compile, and link the program.
c.If the program has SQL statements, bind a package.
d.Create the function to register it to DB2 and grant execute to authorize all
appropriate users.
e. Use the function in application programs.
Related information
IBM Publications Center

Displaying function statistics


You can display function statistics.

To display function statistics:

Select option 3 on the Manage Functions panel. The Display Function Statistics
panel, as shown in the following figure, is displayed. This panel displays statistics
about external user-defined functions accessed by DB2 applications.

428 User's Guide and Reference


DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-DIS FUNCTION SPEC(*.*)

********************************* Top of Data **********************************


DSNX975I DB2X DSNX9DIS DISPLAY FUNCTION SPECIFIC REPORT FOLLOWS -
FUNCTION STATUS ACTIVE QUEUED MAXQUE TIMEOUT WLM_ENV
APPL1 STARTED 1 0 0 0 PAYROLL
APPL2 STARTED 1 0 0 0 PAYROLL
APPL3 STARTED 0 1 2 0 PAYROLL
APPL5 STOPREJ 0 0 0 0 SANDBOX
APPL6 STOPABN 0 0 0 0 PAYROLL
FUNC1 STOPQUE 0 0 0 0 SANDBOX
DSNX9DIS DISPLAY FUNCTION SPECIFIC REPORT COMPLETE
DSNX975I - DSNX9DIS DISPLAY FUNCTION SPECIFIC REPORT FOLLOWS -
******************************** Bottom of Data ********************************

Figure 312. Display Function Statistics panel (ADB2DB2O)

When you press Enter, DB2 Admin issues the -DIS FUNCTION SPEC(*.*)
command.
Related information
IBM Publications Center

Starting all functions


You can start all functions.

To start all functions:

Select option 4 on the Manage Functions panel. DB2 Admin issues the -STA
FUNCTION SPEC(*.*) command, and displays the status of the command in an
ISPF edit session, as shown in the following figure.

DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-STA FUNCTION SPEC(*.*)

********************************* Top of Data **********************************


DSNX973I DB2X DSNX9ST2 START FUNCTION SPECIFIC SUCCESSFUL FOR *.*
DSN9022I DB2X DSNX9COM '-START FUNC' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 313. Start All Functions panel (ADB2DB2O)

Related information
IBM Publications Center

Stopping all functions


You can stop all functions.

To stop all functions:

Select option 5 on the Manage Functions panel. DB2 Admin issues the -STO
FUNCTION SPEC(*.*) command and displays the status of the command in an
ISPF edit session, as shown in the following figure.

Chapter 18. Administering DB2 Admin 429


DB2 Admin ------- DB2X Browse DB2 Command Output --- Line 00000000 Col 001 080
Command ===> Scroll ===> PAGE

-STO FUNCTION SPEC(*.*)

********************************* Top of Data **********************************


DSNX974I DB2X DSNX9SP2 STOP FUNCTION SPECIFIC SUCCESSFUL FOR *.*
DSN9022I DB2X DSNX9COM '-STOP FUNC' NORMAL COMPLETION
******************************** Bottom of Data ********************************

Figure 314. Stop All Functions panel (ADB2DB2O)

Related information
IBM Publications Center

Creating views of functions


You can create a view of a function on SYSIBM.SYSROUTINES which is useful if
you want to let people administer their own functions.

To create a view of a function:


1. Select option 6 on the Manage Functions panel. The Create View on
SYSIBM.SYSROUTINES panel is displayed, as shown in the following figure.
This panel enables you to define a view for all procedures with the (LIKE)
pattern you define.

DB2 Admin ----------- DB2X Create View on SYSIBM.SYSROUTINES ------------ 18:39


Command ===>

CREATE VIEW

Owner ===> >


Name ===> >

AS SELECT *
FROM SYSIBM.SYSROUTINES
WHERE SCHEMA LIKE '
Pattern ===> > '

WITH CHECK OPTION ;

GRANT SELECT,INSERT,UPDATE,DELETE ON (above table) TO


Grantees ===>

Figure 315. Create View on SYSIBM.SYSROUTINES panel (ADB2ZF6)

2. Fill in the fields on this panel to create a view, for example, Define view
ABC.FUNCTIONS as a view on SYSIBM.SYSROUTINES WHERE SCHEMA
LIKE 'ABC. View ABC.FUNCTIONS contain all user-defined functions in
schemas starting with ABC. In addition, you can issue GRANT SELECT,
INSERT, UPDATE, or DELETE statements on the view to a list of authorization
IDs (grantees).

Displaying views of functions


You can display views of functions.

To display the views that exist on SYSIBM.SYSROUTINES:

Select option 7 on the Manage Functions panel. The Tables, Views, and Aliases
panel is displayed, as shown in the following figure. This panel displays the views

430 User's Guide and Reference


that exist on SYSIBM.SYSROUTINES.
The panel being displayed is the same panel you get if you use option 1.T and
DB2 Admin ----------- DB2X Tables, Views, and Aliases ----------- - Row 1 of 2
Command ===> Scroll ===> PAGE

Commands: GRANT MIG


Line commands:
C - Columns A - Auth L - List X - Indexes S - Table space D - Database
V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
? - Show all line commands

Sel Name Owner T DB Name TS Name Cols Rows Checks


* * * * * * * *
----- ------------------ -------- - -------- -------- ------ ----------- ------
PROCEDURES ISTJE V DSNDB06 SYSOBJ 79 -1 0
FUNCTIONS ISTJE V DSNDB06 SYSOBJ 79 -1 0
******************************* END OF DB2 DATA *******************************

Figure 316. Tables, Views, and Aliases panel showing views on SYSIBM.SYSROUTINES
(ADB21T)

option Z.PM.7.

Backing up and recovering a DB2 subsystem


The DB2 subsystem can be backed up, and jobs can be set up to specify a
particular point in time to which to recover the subsystem or to recover the DB2
subsystem to a point in time.

Subsystem-level backups and recovery are possible only with DB2 for z/OS
Version 8 or later, which supports the BACKUP SYSTEM and RESTORE SYSTEM
utilities. Both utilities invoke z/OS DFSMShsm (Version 1 Release 5 or above). The
BACKUP SYSTEM utility uses copy pools, which are new constructs in z/OS
DFSMShsm. The RESTORE SYSTEM utility uses data that is copied by the
BACKUP SYSTEM utility, and the data sets that are to be recovered must be
SMS-managed data sets.

You can submit the batch job that DB2 Admin creates for backing up the system
directly from DB2 Admin. You cannot directly submit the other batch jobs that DB2
Admin creates for specifying a particular time to which to recover the subsystem
or for recovering the subsystem. These batch jobs cannot be run from DB2 Admin.

Topics:
v “Backing up the DB2 subsystem”
v “Specifying a point in time to which to recover” on page 432
v “Recovering the DB2 subsystem” on page 433
Related information
IBM Publications Center

Backing up the DB2 subsystem


You can back up the DB2 subsystem.

To back up the DB2 subsystem:


1. Select option SB on the System Administration panel. The Generate Backup
panel is displayed, as shown in the following figure.

Chapter 18. Administering DB2 Admin 431


| DB2 Admin------------------------- DB2X System Backup-------------------- 20:24
|
|
| DSN of System Backup JCL . .
| Member name . . . . . . . .
|
| Backup Scope . . . . . . . . (F-Full, D-Data only)
|
| FORCE . . . . . . . . . . . (Yes/No)
| DUMP . . . . . . . . . . . (Yes/No)
| DUMPCLASS . . . . . . . . > (Up to 5 dump classes)
| FORCE . . . . . . . . . . (Yes/No)
| DUMPONLY . . . . . . . . . . (Yes/No)
| TOKEN . . . . . . . . . . (Hex string)
| DUMPCLASS . . . . . . . . > (Up to 5 dump classes)
|
| BP - Change batch job parameters specified
|
|
| Figure 317. System Backup panel (ADB2ZSB)
|
2. Enter the name of the data set and member in which the generated JCL is to be
stored and specify copy options (or backup scope). Depending on the level of
DB2 that you are using, some of the fields on this panel might be hidden. See
the online help for a description of the fields that are displayed.
3. Press Enter. DB2 Admin displays the generated JCL for the backup job.
4. Submit the JCL to have the system backed up.

Specifying a point in time to which to recover


You can set up a batch job that will specify a particular time to which to recover
the DB2 system.

To set up a batch job that will specify a particular time to which to recover the
DB2 subsystem:
1. Select option PT on the System Administration panel. The Generate Backup
panel is displayed, as shown in the following figure.

DB2 Admin------------------------- DB2X System Point In Time Recovery---- 21:04


Command ===>

DSN for DSNJU003 JCL. . . . :


Member name . . . . . . . . :

RBA/LRSN . . . . . . . . . :

BP - Change batch job parameters

Figure 318. System Point in Time Recovery panel (ADB2ZSB)

2. Enter the name of the data set and member in which the generated JCL is to be
stored and specify an RBA value as the point in time for recovery of a non-data
sharing member and an LSRN value as the point in time for recover of a data
sharing member.
3. Press Enter. DB2 Admin displays the generated JCL for the job, as shown in the
following figure.

432 User's Guide and Reference


//* STEP PITBKUP: RUN POINT-IN-TIME BACKUP
//**************************************************************
//PITBKUP EXEC PGM=DSNJU003
//STEPLIB DD DISP=SHR,DSN=USER.TESTLIB
// DD DISP=SHR,DSN=DSN810.SDSNLOAD
//SYSUT1 DD DISP=SHR,DSN=BSDS01
//SYSUT2 DD DISP=SHR,DSN=BSDS02
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
CRESTART CREATE,SYSPITR=BBBBBBB
/*

Figure 319. Example of Generated JCL for System Point in Time Recovery

4. Edit the generated JCL to specify the appropriate BSDS data set names in
//SYSUT1 and //SYSUT2.
5. Save the JCL for the batch job. The batch job cannot be submitted directly after
being created. It cannot be run from DB2 Admin.

Recovering the DB2 subsystem


You can set up a batch job that will recover the DB2 subsystem to a previous point
in time.

To set up a batch job that will recover the DB2 subsystem to a previous point in
time:
1. Select option SR on the System Administration panel. The System Restore panel
is displayed, as shown in the following figure.

| DB2 Admin------------------------- DB2X System Restore------------------- 21:31


| Command ===>
|
|
| DSN for Restore System JCL
| Member name . . . . . . . .
|
| LOGONLY . . . . . . . . . . (Yes/No)
| FROMDUMP . . . . . . . . . . (Yes/No)
| DUMPCLASS . . . . . . . . (DFSMShsm dump class to use)
| TAPEUNITS . . . . . . . . . (Yes/No)
| Number of tape units . . . (Number of tape units to use)
|
| BP - Change batch job parameters specified
||
| Figure 320. System Recovery panel (ADB2ZSR)
|
2. Enter the name of the data set and member in which the generated JCL is to be
stored and specify appropriate options.
| Depending on the level of DB2 that you are using, some of the fields on this
| panel might be hidden. See the online help for a description of the fields that
| are displayed.
3. Press Enter. DB2 Admin displays the generated JCL for the job, which invokes
the RESTORE SYSTEM utility.
4. Save the JCL for the batch job.

Restriction: The batch job cannot be submitted directly after being created. It
cannot be run from DB2 Admin.

Chapter 18. Administering DB2 Admin 433


434 User's Guide and Reference
Chapter 19. Managing space
DB2 Admin manages space by displaying DB2 and VSAM statistics for DB2 page
sets and by invoking functions against objects.

Using the DB2 Admin Space Manager panels, you can:


v Display DB2 and VSAM information about DB2 page sets and invoke functions
against objects. The statistical data is gathered from the DB2 catalog and merged
with data from the VSAM catalogs.
v Alter page set properties
v Resize page sets to eliminate extents and free unused space
v Change to and from STOGROUP- and VCAT-defined space
v Estimate primary and secondary space allocation for new table spaces or indexes

Topics:
v “Launching DB2 Admin Space Manager” on page 436
v “Displaying page set statistics” on page 437
v “Resizing page sets” on page 438
v “Moving between STOGROUP- and VCAT-related space” on page 439
v “Table Space Estimator panel” on page 441
v “Index Space Estimator panel” on page 441

Restriction: The following limitations apply to the DB2 Admin Space Manager:
v The resize function generates separate jobs for each page set that
exceeds the limits specified (primary command RESZ). This means
that an index is reorganized twice, first by reorganizing the table
space and then by reorganizing the index if the criteria for resizing
are met by both spaces. Only the specific job for the index will
update the allocations for the index.
v Resize calculations are based on the High Used RBA for the VSAM
data set that contains the table space or index. This means that if
activity on tables has left freespace in the pages, resize might
overallocate space. This can be verified by repeating the resize. DB2
Admin Space Manager displays the message “No changes” if all
selected spaces conform to the limitations given (number of extents,
% used).
Related concepts
“DB2 Administration Menu panel” on page 97

© Copyright IBM Corp. 1995, 2010 435


Launching DB2 Admin Space Manager
You can launch DB2 Admin Space Manager.

To launch DB2 Admin Space Manager:


1. Select option SM on the Administration Menu panel. The Space Manager menu
is displayed, as shown in the following figure.

DB2 Admin ---------------------- DB2 Space Manager ---------------------- 16:33


Option ===>

1 - Display page set space by database DB2 System: DB2X


2 - Table space estimator DB2 SQL ID: ISTJE
3 - Index space estimator

For option 2 (optional):

Table space name ===> (? to look up)


In database ===> (? to look up. Default DSNDB04)

For option 3 (optional):

Index name ===> (? to look up)


Owner ===> (Default ISTJE)

Switch catalog copy ===> N (N/S/C)

Figure 321. The Space Manager menu (ADB2M)

2. Select one of the following options:


1 – Display page set space by database
Select this option to:
v Display statistics for a page set.
v Resize a page set to eliminate extents and to free unused space.
v Switch between STOGROUP and VCAT-defined space.
2 – Table space estimator
Select this option to estimate the space that is required for a table.
3 – Index space estimator
Select this option to estimate the space that is required for an index.
Switch catalog copy
Select the catalog copy to use:
N No change. Continue using the same catalog.
S Switches to the local DB2 system catalog.
C Switches to a copy of the catalog or to a catalog at a distributed
site. The Select Copy of DB2 Catalog panel is displayed, on which
you can choose a copy of the catalog to use.

436 User's Guide and Reference


Related tasks
“Displaying page set statistics”
“Resizing page sets” on page 438
“Moving between STOGROUP- and VCAT-related space” on page 439
“Table Space Estimator panel” on page 441
“Index Space Estimator panel” on page 441

Displaying page set statistics


You can display page set statistics in various formats and issue a command against
space-related objects.

To display page set statistics:


1. Select option 1 on the Space Manager menu. The Space Management by
Database panel is displayed, as shown in the following figure.

DB2 Admin ------------ DB2X Display Pageset Space by Database ----------- 16:47
Option ===>

Enter the partial name of the database you want to display space statistics
for:

Partial database name . . : % (required)


Partial space name . . : % (optional)

Partial owner name . . : % > (optional)


Partial VCAT name . . : % (optional)
Partial storage group . . : % > (optional)

Include spaces . . . . . . : A (All,indeXes, or tableSpaces)

Figure 322. Space Management by Database panel (ADB2M1)

2. Enter the following information:


v Enter a partial database name. To improve performance, specify as much of
the database name as possible.
v Optionally, enter a partial space name. To improve performance, specify as
much of the space name as possible.
v Enter a partial owner name.
v Enter a partial VCAT name.
v Enter a partial storage group name.
v Specify the type of spaces to be displayed.
– Enter A to display both index and table space data.
– Enter X to display index data.
– Enter S to display table space data.
3. Press Enter. The Page Set Statistics for VSAM Statistics panel is displayed, as
shown in the following figure. This panel contains VSAM-related page set data.

Chapter 19. Managing space 437


| ADB2M1S n ------------------- DB2X Page Set Statistics ----------- Row 8 of 18
| Command ===> Scroll ===> PAGE
|
| Commands: VDEF VSTAT DDEF DSTAT RESZ
| Line commands:
| I - Info S - Space SP - Space Part G - Storage Group DIS - Display
| STA - Start STO - Stop LISTC - Listcat LISTD - Listcat Data
| AL - Alter MOVE - Move VDEF - VSAM define statement
| RESZ - Resize page set HR - HSM recall HL - HSM list UT - Utility
| ? - Show all line commands
|
| Data Page Sub VSAM VSAM Pct VSAM
| Sel Base Set Num T Type KB Alloc KB Used Usd Exts Volser #V
| * * * * * * * * * * > *
| ----- -------- -------- ---- -- ---- -------- ----------- --- ---- ------ --
| DSN8D61A DSN8S61D 1 S SEG 48 48 100 1 RE9M01 1
| DSN8D61A DSN8S61E 1 S LOB 144 144 100 3 RE9M05 1
| DSN8D61A DSN8S61E 2 X IAUX 144 144 100 3 RE9M03 1
| DSN8D61A DSN8S61E 3 S 48 48 100 1 RE9M08 1
| DSN8D61A DSN8S61E 4 SP 144 144 100 3 RE9M05 1
| DSN8D61A DSN8S61P 1 S SEG 192 96 50 1 RE9M10 1
| DSN8D61A DSN8S61R 1 S LOB 48 48 100 1 RE9M10 1
| DSN8D61A DSN8S61S 1 S LOB 48 48 100 1 RE9M05 1
| DSN8D61A XACT1 1 X XML 48 48 100 1 RE9M08 1
|
|
| Figure 323. Page Set Statistics panel (ADB2M1S) for VSAM statistics
|
You can focus on another area of page set statistics by issuing any of the
following commands:
v VDEF to display VSAM definitions for the page data set
v DSTAT to display DB2 statistics for the page data set
v SDEF to display DB2 definitions for the page data set
| v LISTC, LC, LIST, or LD to go to panel ADB2LCAT, TSO LISTCAT Output
| Display.
For more information about the fields that comprise these panels, see the online
help. To display the VSAM Statistics panel again, issue the VSTAT command.
4. Use line commands to perform various space-related functions.
Related tasks
“Launching DB2 Admin Space Manager” on page 436

Resizing page sets


You can resize page sets in order to eliminate extents and to free unused space.

DB2 Admin Space Manager enables you to resize all page sets for a database or to
select specific page sets to resize. The following instructions describe both
methods.
1. Complete steps 1 through 3 of “Displaying page set statistics” on page 437. The
Page Set Statistics for VSAM statistics panel is displayed.
2. Resize all page sets or a specific page set.
v If you want to resize all page sets, issue the RESZ primary command and
press Enter.
v If you want to resize a specific page set, tab to the page set that you want to
resize and issue the RESZ line command and press Enter.
The Resize Page Sets panel is displayed, as shown in the following figure. If the
page set cannot be resized (because it is not overallocated or in extents), DB2
Admin issues a messages that indicates that there is nothing to resize.

438 User's Guide and Reference


DB2 Admin -------------------- DB2X Resize Page Sets -------------------- 20:50
Option ===>

Resize pagesets having:


No. of extents greater than ===> 30 (1-100)
Pct. used less than ===> 90 (5-90)

BP - Change batch job parameters

Figure 324. Resize Page Sets input panel (ADB2M1R)

3. Specify the following information:


v In the No. of extents greater than field, specify the minimum number of
extents that a page set must have in order to be resized, or
v In the Pct. used less than field, specify the percentage of space that must be
available for a page space to be resized. For example, if you enter 45 in this
field, only those page sets that are using less than 45 percent of the space
available are resized.
4. Press Enter. DB2 Admin creates a batch job to resize those page sets that meet
the criteria that you specified.
5. Submit the job to resize the page sets.
Related tasks
“Launching DB2 Admin Space Manager” on page 436

Moving between STOGROUP- and VCAT-related space


You can move a page set that is currently in a STOGROUP-defined space to a
VCAT-defined space on another volume

You can also move a page set that is currently in a VCAT-defined space to a
STOGROUP-defined space.

If you enter the MOVE line command, you are prompted for additional input. The
input asked for depends on whether you wish to move a STOGROUP-defined or a
VCAT-defined page set.

To move between STOGROUP- and VCAT-related space:


1. Complete steps 1 through 3 of “Displaying page set statistics” on page 437. The
Page Set Statistics for VSAM statistics panel is displayed.
2. Tab to the page set that you want to move and issue the MOVE line command.
3. In the panel that displays, enter additional information. If you are moving a
STOGROUP-defined page set, the Move Page Set Input panel (ADB2M1M) is
displayed, as shown in the following figure.

DB2 Admin --------------- DB2 Space Manager Move Page Set --------------- 20:50
Option ===>

1 - Move page set to another STOGROUP (with new VCAT)


4 - Move page set from STOGROUP to VCAT

New STOGROUP ===> (current STOGROUP: DSN8G610 with VCAT: C1DB2)


New Vcat ===> (for option 4)
New volumes ===>

Figure 325. Move Page Set input panel (ADB2M1M): STOGROUP-defined page sets

Chapter 19. Managing space 439


Option 1
If you select Option 1, Move page set to another STOGROUP (with new
VCAT), you must enter the names of the new storage group, and optionally
that of a new catalog.
New STOGROUP
Specify the name of the new storage group. The name of the current
storage group and VSAM catalog are displayed for your information.
New VCAT
Specify the name of a VSAM catalog.
Option 4
If you select Option 4, Move page set from STOGROUP to VCAT, you must
enter the name of a new VSAM catalog, and optionally, the new volumes
for the page set. Use commas to separate volume names.
New VCAT
Specify the name of a VSAM catalog.
New VOLUMES
Optionally, specify the name of a new volume. For multiple volumes,
separate the volume names with a comma.

If you are moving a VCAT-defined page set, the Move Page Set Input panel
(ADB2M1M) is displayed, as shown in the following figure.

DB2 Admin --------------- DB2 Space Manager Move Page Set --------------- 20:50
Option ===>

2 - Move page set to another VCAT


3 - Move page set to other volume(s)
5 - Move page set from VCAT to STOGROUP

New STOGROUP ===> (for option 5)


New VCAT ===> (current VCAT: C1DB2)
New volumes ===>

Figure 326. Move Page Set input panel (ADB2M1M): VCAT-defined page set

Option 2
If you select Option 2, Move page set to another VCAT, you must enter the
name of the new VCAT, and optionally, the new volumes for the page set.
New VCAT
Specify the name of a VSAM catalog. The name of the current VCAT is
displayed for your information.
New VOLUMES
Specify the name of a new volume. For multiple volumes, separate the
volume names with a comma.
Option 3
If you select Option 3, Move page set to other volume(s), enter the name(s)
of one or more volumes.
New volumes
Specify the name of a new volume. For multiple volumes, separate the
volume names with a comma.
Option 5
If you select Option 5, Move page set from VCAT to STOGROUP, enter the
name of a new STOGROUP.

440 User's Guide and Reference


New STOGROUP
Specify the name of the new storage group.
Related tasks
“Launching DB2 Admin Space Manager” on page 436

Table Space Estimator panel


You can use the DB2 Admin Space Manager to estimate the space requirements for
a table.

To estimate the space requirements for a table:


1. Select option 2, Table space estimator, on the Space Manager menu. The Table
Space Estimator panel is displayed, as shown in the following figure. Initially,
all of the fields on the Table Space Estimator panel are blank.

DB2 Admin ------------------ DB2 Table Space Estimator ------------------ 20:51


Option ===>

Input values:
No. of rows ===> 100000 (required)
Avg. row size ===> 100 (required, 1-32714)
Page size ===> 4 (4,8,16, or 32, optional, default smallest)
Max rows/page ===> 255 (1-255, optional, default 255)
Compression ===> 0 (0-99, optional, default 0)
Pctfree ===> 5 (0-99, optional, default 5)
Freepage ===> 0 (0-255, optional, default 0)
Segment size ===> 0 (0 or 4,8,..,64, optional, default 0)
Unit type ===> 3390 (3380 or 3390, default 3390)

Estimates: Suggested:
Usable page size : 3870 Primary quantity : 11520 (16 cylinders)
Rows per page : 35 Secondary qty : 1440 (2 cylinders)
Pages used : 2858 DASD estimates:
Total pages : 2860 Number of trks : 239
Number of KB : 11440 Number of cyls : 16

Figure 327. Table Space Estimator panel example (ADB2MES)

2. Fill in the fields in the Input values section of the panel.


3. Press Enter. The Table Space Estimator panel is displayed again. Based on the
input values you entered, the Table Space Estimator provides information about
the estimated space that the table will require and suggests the amount of
space that you should allocate for this table.
For the Compression field, the value represents the percentage of rows that
will not be compressed. For example, a compression value of 1 yields the
maximum compression (because 99% of the rows are compressed). A
compression value of 99 yields the minimum compression (because only 1% of
the rows is compressed). A value of zero represents zero compression.
Related tasks
“Launching DB2 Admin Space Manager” on page 436

Index Space Estimator panel


You can use the DB2 Admin Index Space Estimator to estimate the index space
requirements for a table.

To estimate the index space requirements for a table:

Chapter 19. Managing space 441


1. Select option 3, Index space estimator, on the Space Manager. The Index Space
Estimator panel is displayed, as shown in the following figure. Initially, all of
the fields on the Index Space Estimator panel are blank.

DB2 Admin ------------------ DB2 Index Space Estimator ------------------ 20:51


Option ===>

Input values:
No. of rows ===> ? (required)
Key length ===> ? (required, 1-255)
Unique ===> ? (required, Yes/No )
Distinct ===> (for non-unique: no. of distinct keys)
OR rows/key ===> (for non-unique: avg. rows per key)
Pctfree ===> (0-99, default 5)
Freepage ===> (0-255, default 0)
Large TSpace ===> (Yes/No, Default No)
Unit type ===> (3380 or 3390, default 3390)
No. of pieces ===> (1-32, 1-4096 with large table space)
OR piecesize ===> (nX, n=numeric value, see help,X=K/M/G)
Estimates: Suggested:
Usable page size : Primary quantity :
Keys per page : Secondary qty :
Leaf pages : Piecesize :
Index levels : DASD estimates:
Total pages : Number of trks :
Number of KB : Number of cyls :

Figure 328. Index Space Estimator panel (ADB2MEX)

S
2. Fill in the fields in the Input values section of the panel.
3. Press Enter. The Index Space Estimator panel is redisplayed. Based on the input
values you entered, the Index Space Estimator provides additional information
about the estimated space that the table will required and suggests the amount
of space that you should allocate for this table.
The following fields are available on the panel. The first three fields are
required.
No. of rows
The number of rows to be loaded into the table space.
Key length
The sum of the length of all the columns of the key, plus the number of the
columns that allow nulls.
Unique
Specify whether the key is unique. 'NO' means non-unique.
Distinct
For a non-unique index: number of distinct keys. If specified it will be used
to calculate the average number of rows per key. Can not be specified if
“Rows/key” is specified.
OR rows/key
For a non-unique index: average number of rows per distinct key. Cannot
be specified if “Distinct” is specified.
The remainder of the fields are optional.
Pctfree
The percentage of each page to leave as free space when the table is loaded
or reorganized. The default is 5 percent.

442 User's Guide and Reference


Freepage
Specifies how often DB2 will leave a page of free space when the table is
loaded or reorganized.
Large TS
Specifies whether the table space used by this index is defined as LARGE.
Unit type
Unit type to be used when calculating the estimated number of tracks and
cylinders.
No. of pieces
Number of data set pieces into which to split the index. When you specify
a value and press Enter, the Suggested Piecesize field is calculated and
displayed.
OR piecesize
Value in kilobytes (K), megabytes (M), or gigabytes (G). The suggested
number of pieces is calculated and displayed. Example values include:
1024M, 1G, and 4096K. Valid values for n are:
K 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144,
524288, 1048576, 2097152, and 67108864.
M 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384,
32768, and 65536.
G 1, 2, 4, 8, 16, 32, and 64.
The remainder of the panel consists of estimates and recommendations
generated by the index space estimator.
The output fields are:
Usable page size
The number of bytes per page that can be used for rows.
Keys per page
The number of keys per leaf page.
Leaf pages
The number of leaf pages.
Index levels
The number of index levels.
Total pages
The total number of pages in the index. Includes header pages, space map
pages, and free pages.
Number of KB
The estimated number of KB required for this index.
Primary quantity
The suggested primary quantity for this index in KB.
Secondary qty
The suggested secondary quantity for this index.
Piecesize
The suggested piece size when number of pieces is specified. The default
value for Piecesize is 2G (2 gigabytes).
Number of trks
The estimated number of tracks required.

Chapter 19. Managing space 443


Number of cyls
The estimated number of cylinders required.

The following figure shows a second view of the Index Space Estimator panel.
Assuming that the values have been entered in the fields, the space estimator
generates the estimates shown in the lower portion of the panel. Both input and
output values are displayed on the panel.

DB2 Admin ------------------ DB2 Index Space Estimator ------------------ 20:51


Option ===>

Input values:
No. of rows ===> 100000 (required)
Key length ===> 10 (required, 1-255)
Unique ===> Y (required, Yes/No)
Distinct ===> (for non-unique: no. of distinct keys)
OR rows/key ===> (for non-unique: avg. rows per key)
Pctfree ===> 5 (0-99, default 5)
Freepage ===> (0-255, default 0)
Large TSpace ===> NO (Yes/No, Default No)
Unit type ===> 3390 (3380 or 3390, default 3390)
No. of pieces ===> (1-32, 1-4096 with large table space)
OR piecesize ===> 256K (nX, n=numeric value, see help,X=K/M/G)
Estimates: Suggested:
Usable page size : 3836 Primary quantity : 1824 (38 tracks)
Keys per page : 225 Secondary qty : 48 (1 track)
Leaf pages : 445 Piecesize : 256 K ( 8 pieces)
Index levels : 3 DASD estimates:
Total pages : 450 Number of trks : 38
Number of KB : 1808 Number of cyls : 3

Figure 329. Index Space Estimator panel example (ADB2MEX)

Related tasks
“Launching DB2 Admin Space Manager” on page 436
Related information
IBM Publications Center

444 User's Guide and Reference


Chapter 20. Managing changes to DB2 objects
DB2 Admin manages and tracks the changes that you make to your DB2 objects.

Topics:
v “Overview of Change Management” on page 446
v “Change Management scenarios” on page 454
v “Making changes through Change Management” on page 457
v “Recovering a change made through Change Management” on page 468
v “Modifying a change” on page 470
v “Promoting changes” on page 472
v “Importing changes” on page 473
v “Masks” on page 477
v “Ignores” on page 482
v “Versions” on page 489
v “Version scopes” on page 494
v “Tracking changes and changed objects” on page 498
Related concepts
“DB2 Administration Menu panel” on page 97
“Managing work statement lists” on page 310

© Copyright IBM Corp. 1995, 2010 445


Overview of Change Management
The Change Management function in DB2 Admin simplifies the process of
recording and tracking the changes that you make to your DB2 objects, which can
be very complex, especially when others have defined changes that have yet to be
run.

Change Management provides the following features:


v Assigns a change ID for every change that you make to your DB2 objects, and
registers each change in the Change Management database
v Enables you to analyze how a change affects existing objects
v Warns you if there are pending changes to the same object that you plan to
change, which gives you the opportunity to specify whether your change should
supersede or follow the pending changes
v When pending changes exist for the objects, allows you to define the new
changes as if the pending changes have already been made
v Facilitates the generation of new versions to provide a snapshot of your database
definitions after changes have been made
v Uses an interface that allows you to track and query changes to objects and
quickly find all of the components that are involved in a change
v Provides an audit trail and helps automate the process of recovering changes
v Maintains the relationships between changes, versions, masks, ignores, generated
DDL, and unloaded data
v Facilitates moving changes from one DB2 subsystem to another

You can use Change Management for changes that you make by using the
following DB2 Admin or DB2 Object Comparison Tool features:
| v SQL CREATE, ALTER, DROP, RENAME, GRANT, COMMENT, and LABEL
| statements that are executed from the input screen or from a data set and SQL
| REVOKE statements that are executed from the input screen or from a data set
| as immediate changes
v The AL line command to change or rename a database
| v The AL line command or AL RDEF command to change a table space or index
| space
v The AL line command or ALC line command to change a table
v Comparisons in which changes are made to synchronize the target system with
the source system
v Changes that are defined through the Change Management panels

Change Management terminology


Understanding the terminology that is involved in managing changes will help
you use Change Management.

The following terminology will help you use Change Management:


v A version is a snapshot of a set of object definitions at a point in time. With
Change Management, you have the option of creating a new version after
applying a change, which you can then use as the base version for a subsequent
change
Change Management also uses a special type of version file that is called a delta
version, which is a catalog representation of the changes that are being made.

446 User's Guide and Reference


v A version scope identifies the set of objects to be included in processing a version.
It determines the objects that will be included in a version.
v Ignores specify the DB2 catalog fields that should be ignored when objects are
compared.
| v Masks (or translation masks) specify how names are to be translated when objects
| are compared or when they are moved from one system to another (source to
| target). Masks also allow you to overwrite the values of certain table space and
| index space attributes.
| v A prerequisite change is a change that must be run before the current change is
| run. When you create a change for an object, the object might have pending
| changes, which are changes that have yet to be run. You can choose to make the
| pending changes remain as prerequisite changes for the new change or make
| your new change a supersede change, which puts the new change ahead of the
| pending changes.
| v A fast change is a change that can or should be run immediately. If the affected
| objects have pending changes, the fast change is called an emergency change, and
| it will supersede the pending changes. If the affected objects do not have any
| pending changes, the fast change is called an immediate change.
| v A recover change is a change that lets you back out a change that has been
| completed.
| v Backing out a completed change requires determining whether the change has a
| recover change, whether other changes must be recovered first and in which
| order, and whether there are pending changes to the objects being affected by
| the change that will have to be reanalyzed after the change is recovered. DB2
| Admin uses a recover strategy to determine all of this information for you.

The Change Management process


The most common tasks that you need to perform when you use Change
Management to make changes are defining the changes, registering the changes,
analyzing the changes, and running the changes.
Defining a change
Changes can come from a variety of sources. For example, you can use the
regular features of DB2 Admin or DB2 Object Comparison Tool to generate
DB2 object changes, import statements into a change from a data set, or
import changes that have been promoted from other DB2 subsystems.
| The objects that you are changing might have pending changes, which are
| changes that are being made through Change Management and have yet to
| be completed. You will need to specify whether the change that you are
| defining should supersede these pending changes or not. When and where
| you specify how pending changes should be handled depends on whether
| the pending changes can be applied as virtual changes:
| v When the pending changes can be applied as virtual changes, you
| specify how to handle the pending changes at the time you define the
| change.
| When you define the change, the list of pending changes is displayed,
| and you must specify whether to apply these pending changes and
| define your new change based on a virtual representation of the objects
| with the pending changes applied. When you choose to supersede the
| pending changes, you define your change without taking the effect of
| the pending changes into account, and the new change becomes a
| prerequisite change for the pending changes.

Chapter 20. Managing changes to DB2 objects 447


| Pending changes can be treated as virtual changes when you make
| changes by using the following methods:
| – The Alter dialogs to:
| - Rename a database (AL RENAME)
| - Redefine a table space (AL RDEF)
| - Redefine an index (RDEF)
| - Redefine a table (ALC)
| – The Create dialogs (option 2.4 from the DB2 Admin main menu) to
| create a table space, table, index, materialized table, view, and trigger
| – The Tables, Views, and Aliases system catalog panel (option 1.T from
| the DB2 Admin main menu) to rename a table
| For performance reasons to minimize the amount of time spent
| traversing relationships, especially for renames, the list of pending
| changes that DB2 Admin displays might not be complete. However, if
| you apply the pending changes, all of pending changes for the objects
| are applied whether or not they appear in the list.

| Tip: To minimize the amount of time that it takes to apply pending


| changes, keep the number of uncompleted changes (DEFINED,
| ANALYZED, RUNNING) to a minimum.
| v When the pending changes cannot be applied as virtual changes, you are
| prompted to specify how the pending changes should be handled at the
| time you register the change (or shortly before you register the change
| when the source of the change is from importing statements into a
| change from a data set, importing changes that have been promoted
| from other systems, or performing a comparison in DB2 Object
| Comparison Tool). You have to determine whether your new change
| should be added to a pending change, be made before or after any
| pending changes that exist, or be executed immediately.

| Exception: You are not prompted to specify how to handle pending


| changes if you use the Change Management panels to define
| a change (that is, insert a change on the Changes panel and
| then create change statements for the change)
| Registering a change
After you define a change, DB2 Admin prompts you to register the change
in the Change Management database. You specify a name for the change
and a name for the delta version for the change. DB2 Admin automatically
assigns a change ID to the change and creates a delta version, which
contains a catalog representation of the changes.
Depending on the method that was used to define the change, you might
be prompted to specify whether to register the change as a normal change,
an emergency change, or an immediate change and how to handle pending
changes for the objects that are involved in the change:
v If there are pending changes, you can register the change as a normal
change or an emergency change. If you register the change as a normal
change, you also must specify whether the change should be made
before or after the pending changes.
v If there are no pending changes, you can register the change as a normal
change or an immediate change.
DB2 Admin runs emergency and immediate changes immediately. The
analyze and run phases do not apply. A delta version is not created for an
emergency or immediate change.

448 User's Guide and Reference


Analyzing a change
A normal change must be analyzed before the change can be applied to the
objects. When you issue the command to analyze a change, DB2 Admin
generates a batch job that you submit.
| The batch job analyzes how the change modifies existing objects, both in
| DB2 and in any of the prerequisite changes, and creates a work statement
| list (WSL) that will be used to run the changes. During the analyze
| process, DB2 Admin automatically generates a base version of the objects
| and merges the delta versions with this base version to create two new
| base versions:
| v A target version, which represents the objects in the DB2 catalog plus
| any prerequisite changes
| v A source version, which is the target version plus the changes for the
| change that being analyzed
| DB2 Admin then invokes DB2 Object Comparison Tool to compare the
| source and target base versions to generate a WSL that will be used in the
| run process to apply the changes. The base versions that are used in this
| process are temporary and are not saved.

DB2 Admin generates the base version that is merged with the delta
versions using one of the following methods:
Automatic (A)
The base version is generated from the DB2 catalog using the
objects that are referenced in the change.
User-defined (U)
The base version is generated from the DB2 catalog using the
objects that are specified in the version scope.
Existing (E)
An existing base version is used. DB2 Admin uses the current
contents of the existing version and the contents of the DB2 catalog
are not considered.
You can specify the method that DB2 Admin uses when there are no
prerequisite changes for the change. If prerequisite changes exist, DB2
Admin chooses the method based on the following criteria:
User-defined (U)
This method is forced if all the prerequisites have a status of
ANALYZED and use the same version scope. The same version
scope will be used for the change you are analyzing.
Existing (E)
This method is forced if all the prerequisites have a status of
ANALYZED and use the same base version. The same base version
will be used for the change you are analyzing.
Automatic (A)
This method is forced if neither of the above conditions are true.
| When you analyze a change, you can specify that a recover change be
| created automatically. Creating a recover change gives you the option of
| backing out the change. When you first choose to create a recover change,
| you are prompted to register the recover change. The recover change is
| automatically updated if the original change is reanalyzed.

Chapter 20. Managing changes to DB2 objects 449


Running a change
After a change has been successfully analyzed, it is ready to be run. That
is, you are ready to apply the change to the database. When you issue the
command to run the change, DB2 Admin creates a batch job that you
submit. The batch job runs the WSL that was generated during the analyze
process.
| If the change has prerequisite changes, you cannot run the change, and
| DB2 Admin will prompt you to run the prerequisite changes first.
| The run job performs a task called runtime analyze, which ensures that the
| DB2 catalog has not changed from the time the change was analyzed. The
| run job reanalyzes the change and creates a second WSL, using the current
| DB2 catalog and the automatic base version method. The second WSL is
| compared with the WSL that was generated during the normal analyze. If
| the DDL and DCL content are the same, the run job continues and the
| WSL that was generated during the normal analyze is run to apply the
| changes. If the DDL or DCL content are different, the run job stops with a
| return code of 8, and the change is not run.
When you run a change, you have the option of specifying that a new base
version be created after the changes have been made successfully. If you
want to have a new base version created, a version scope that defines the
set of objects to be included in the base version must exist.

Requirement: Always use the RN command on the CM - Changes panel


(ADB2C11) to run changes that are being managed under
Change Management. Do not run the WSL that was
generated during the analyze process directly from the
Work Statement List Library panel (ADB2W1) because DB2
Admin cannot track changes that are made outside of the
| Change Management process. Also, do not use the line
| commands on the Work Statement List Library panel to edit,
| delete, copy, append, or clone a WSL that was generated
| during the analyze process.

You can also use Change Management to complete many other tasks. You can
recover changes; track changes and changed objects; manage masks, ignores,
versions, and version scopes; and promote changes from one system to another.
Related tasks
“Registering a change” on page 457
“Analyzing a change” on page 462
“Running a change” on page 465

Types of changes and change status


To facilitate change management, DB2 Admin categorizes changes into several
types and assigns a status to each change as it moves through the change
management process.

The type is assigned when a change is registered. The following table describes the
types of changes:

450 User's Guide and Reference


Table 20. Types of changes
Type of change Description
| CHANGE A change that is defined through the usual change functions in DB2
| Admin and DB2 Object Comparison Tool, such as ALC, AL RDEF,
| and compare, which go through the change management process of
| being analyzed and then run.
FAST A change that is run immediately. If pending changes exist for the
object or related objects that are affected by the fast change, the fast
change is called an emergency change, and it supersedes the
pending changes. The pending changes are placed in DEFINED
status. If no pending changes exist, the fast change is called an
immediate change.

Because fast changes are run immediately upon registration, you


cannot analyze or run them manually. You also cannot modify fast
changes, recover them, or promote them to other systems.
| COMPARE A change that is generated by comparing two items such as two
| base versions, two DDL files, two catalog objects, or a DDL file and
| a catalog object.
PROMOTE A change that is generated by importing statements from a data set
or a changes file.
RECOVER A change that was automatically generated to back out another
change. When you analyze a change, you have the option of having
a recover change created. DB2 Admin generates a recover change,
assigns a change ID to the recover change, creates a delta version
for the recover change, and puts the recover change in ANALYZED
status.

To recover a change, you issue the RC line command for the


original change. You do not issue the RN line command for the
recover change.

The status of a change is updated when actions are taken on the change. The
following table describes the possible values for the status:
Table 21. Status of changes
Status Description
INITIAL The change has been created, but its registration in the Change
Management database is incomplete. You can try to get the change
registered by issuing the restart line command (RST) on the
Changes panel (ADB2C11).

If a change is in INITIAL status and you issue the restart line


command to attempt to complete it, DB2 Admin cannot detect and
process any prerequisite changes that might exist. You will need to
identify any prerequisite changes yourself and reanalyze any change
in ANALYZED status to ensure its validity.
DEFINED The change has been created and registered in the Change
Management database. The change is ready to be analyzed.
ANALYZED The change has been validated and a WSL to run the change has
been generated. The change is ready to be run.
RUNNING The change is currently being run. A RUNNING status that does
not change to COMPLETE status indicates that the job to run the
change failed at some point.
COMPLETE The change has been run successfully.

Chapter 20. Managing changes to DB2 objects 451


Table 21. Status of changes (continued)
Status Description
CANCELED The change has been canceled.
FAILED The change is a fast change that was run immediately but did not
complete successfully.

The Change Management main menu panel


The Change Management (CM) panel, which can be accessed by using the CM
option on the DB2 Administration Menu panel, is the main menu for accessing
Change Management functions.

The Change Management (CM) panel is shown in the following figure:

DB2 Admin -------------------- Change Management (CM) ------------------- 19:27


Option ===>

1 - Manage changes DB2 System: DB2X


2 - Manage masks DB2 SQL ID: ISTJE
3 - Manage ignores
4 - Manage versions
5 - Manage ID table
6 - Report changes

Figure 330. Change Management (CM) panel (ADB2C)

The following options are available on this panel:


Manage changes
Select this option to manage changes. From the Manage Changes panel, you
can display changes to perform various actions such as analyzing the change,
running the change, or recovering the change. You can also use this panel to
create a change, create a delta for a target location (promoting a change), or
import a delta that was created (importing a change).
Manage masks
Select this option to manage masks. From the Manage Masks panel, you can
display the masks that are defined or you can create a new mask.
Manage ignores
Select this option to manage ignores. From the Manage Ignores panel, you can
display the ignores that are defined or you can create a new ignore.
Manage versions
Select this option to manage versions. From the Manage Versions panel, you
can display versions and version scopes. You can also create a version scope.
Manage ID table
Select this option to change the default Change Management level or to
override the default level for specific SQL IDs.
Report changes
Select this option to display changes or changed objects.

Restriction: The value of the character input fields on the Change Management
panels cannot contain an apostrophe (or single quotation mark). For
example, do not specify an apostrophe in the name of any change,
version, mask, or ignore.

452 User's Guide and Reference


Tip: You can issue the CMM special command from any DB2 Admin panel to go
directly to the Change Management (CM) panel.

Prerequisites for Change Management


DB2 Object Comparison Tool Version 7 Release 2 must be installed to use Change
Management, and DB2 Admin must have been customized so that Change
Management is enabled.

In addition, for you to be able to register changes in the Change Management


database, either the default Change Management level or the level for the current
SQL ID must be either REQUIRED or OPTIONAL. The Change Management levels
are:
REQUIRED
All changes must be registered in the Change Management database.
OPTIONAL
Changes can be registered in the Change Management database. When you
define a change, you are prompted as to whether to make the change
through Change Management.
| Changes to a set of objects that are being managed under Change
| Management should all be made through Change Management.
| OPTIONAL might be used when you are testing Change Management or
| when you can ensure that the SQL ID will register the changes to objects
| that are being managed under Change Management when prompted.
NONE
No changes can be registered in the Change Management database.
Related concepts
“Step 3. Set up to use Change Management” on page 33
“Recommendations for designing a Change Management strategy” on page 454

Setting the default Change Management level


The default Change Management level in the Change Management ID table
determines whether changes must be registered, can be registered, or cannot be
registered in the Change Management database if a level has not been specifically
defined for the current SQL ID.

To change the default Change Management level:


1. On the Change Management (CM) panel, specify option 5 to display the
Manage ID Table panel.
2. Change the default change management level setting to the desired value:
REQUIRED, OPTIONAL, or NONE.
3. Issue the SAVE command to update the Manage ID Table.

Setting the Change Management level for specific SQL IDs


You can override the default Change Management level for one or more specific
SQL IDs by defining an entry for the SQL IDs in the Change Management ID table.

To specify the Change Management level for a specific SQL ID:


1. On the Change Management (CM) panel, specify option 5 to display the
Manage ID Table panel.
2. Add a new SQL ID or change the Change Management level for an existing ID.

Chapter 20. Managing changes to DB2 objects 453


v To add a new SQL ID, issue the I line command, and specify the SQL ID and
the change management level for the SQL ID (REQUIRED, OPTIONAL, or
NONE).
v To change the Change Management level for an existing SQL ID, type over
the current value in the Level column.
3. Issue the SAVE command to update the Manage ID Table.

Recommendations for designing a Change Management


strategy
An effective change management strategy is one that is well planned. The most
important factor to consider is to ensure that changes to a set of objects are either
all performed through Change Management or are all performed without Change
Management.

Requiring that all changes go through Change Management is easy when the
objects that should go through Change Management are handled by a few SQL IDs
and the SQL IDs are used only for these objects. If the SQL IDs are also being used
to change objects that should not go through Change Management, you should set
the Change Management level option to OPTIONAL, and the user will have to
decide whether the change should go though Change Management.

A few example Change Management strategies are:


v When Change Management is being used for the objects for only one
application:
– Set the Change Management level for the SQL ID that is used to manage the
objects for the application to REQUIRED.
– Set the level for the other SQL IDs to NONE by setting the default Change
Management level to NONE.
v When Change Management is being used for the objects for all applications
except for a few objects that are under design and development:
– Set the default Change Management level to REQUIRED.
– Set the Change Management level for the SQL IDs that are used to change the
objects that are under design and development to NONE. If those SQL IDs
are also used to change objects that are not under design and development,
set the Change Management level for the SQL IDs to OPTIONAL; the user
will need to specify whether to use Change Management upon each change.
v When Change Management is being tested:
– Set the default Change Management level to OPTIONAL.
Related concepts
“Prerequisites for Change Management” on page 453

Change Management scenarios


Change Management scenarios illustrate how you might use Change Management
to make a simple change to a database and move changes that are made on one
system to another.

Topics:
v “Scenario: Making a simple change to a database” on page 455
v “Scenario: Promoting changes from one system to another” on page 456

454 User's Guide and Reference


Scenario: Making a simple change to a database
This scenario explains how to make changes to part of a database structure on a
development system.

Specifically, for the EMP table, you want to drop the COMMISSION column and
increase the length of the LASTNME column to 45 bytes.

In making these changes, you have the following goals:


v Ensure that there is a snapshot of the database structure for fallback purposes.
v For the dropped column, repair any side effects of the change, such as handling
inoperative or undefined objects such as packages, views, and triggers.
v Ensure that data is preserved for the change to the column length.
v Optimize the database with respect to the changes, such as running RUNSTATS
or rebinding where necessary.
v Capture the changes for auditing purposes.

The following steps show you how you might use Change Management to make
these changes and achieve your goals:
1. Generate operations to track the change in Change Management. Create a
version scope of the human resources database. You want to define a version
scope because you want to create a snapshot (or base version) of the database
structure after the changes are made. The version scope defines the objects that
should be in the base version.
2. Modify the length of the LASTNME column and drop the COMMISSION
column.
a. Find and select the EMP table.
b. Issue the ALC command to change the table. If there are any pending
changes to the table, specify whether to implement your changes based on
the assumption that the pending changes have been performed or that they
have not been made and your change should supersede them. In this
scenario, assume that there are no pending changes.
c. Type over the length of the LASTNME column to increase the length to 45.
d. Issue the D line command to delete the COMMISSION column.
3. Identify the impact that the changes have. To assess the impact of increasing
the length of the LASTNME column and dropping the COMMISSION column:
a. Type the REL primary command to see the related objects.
b. Select each related object individually and determine if any changes are
required because of the change in length to LASTNME or for
COMMISSION being dropped. In this example, assume that a view is
impacted by the dropped column.
4. Repair the side effects for the change. To fix the view:
a. Issue the A line command to change the view.
b. In the edit session that is displayed, remove the predicate from the view
and save the edit session. The new definition of the view will be included
as part of the change.
c. Issue the CONTINUE command to finalize the changes to the table and the
view.
5. Register the change in the Change Management database. Change registration
occurs in this scenario because Change Management is enabled and required.
To register the change, specify an owner and name for the change.

Chapter 20. Managing changes to DB2 objects 455


6. Analyze the change. To analyze the change:
a. Go to the Change Management main menu and display the list of changes.
b. Issue the analyze command for the change.
| c. Submit the batch job that DB2 generates to perform the analyze. The batch
job produces a report of the changes that will be made and generates a WSL
that will make the changes.
7. Run the change and capture a snapshot of the database structure after the
change is complete. To run the change:
a. Go to the Change Management main menu and display the list of changes.
b. Issue the run command for the change, specifying that a new base version
of the database structure should be created after the changes are made.
| c. Submit the batch job that runs the WSL that applies the changes.

Scenario: Promoting changes from one system to another


This scenario supposes that you are asked to promote the changes that were made
to the human resources database on the development system to the test system.

This task requires you to determine the differences between the development and
test system and apply the changes to the test system.

Assume that versions for the current state of the databases exist (Release 11C in
DEV and Release 11B in TEST). You will compare the two versions to generate a
delta changes data set that contains the SQL statements that represent the
differences, transfer the delta changes data set to the test system, import the delta
changes data set on the test system as a new change, and then apply the changes
to the test database.

In synchronizing the human resources database, you have the following goals:
v Ensure that there is a snapshot of the database structures for fallback purposes.
v Capture the changes that are made on the test system for auditing purposes.

The following steps show you how you might use Change Management to make
these changes and achieve your goals:
1. On the source system (the development system), use the current versions of the
development and test databases to identify the differences between the
databases and promote the differences to the target system (the test system). To
find and promote the differences in a delta changes data set:
a. Go to the Change Management main menu and display the Manage
Changes panel.
b. Select the option to create a delta changes file for the target system.
c. Identify the version of the test database as the starting version and the
version of the development database as the ending version. Provide a name
for the job that will generate the delta changes data set and a name for the
delta changes data set. The starting version is a snapshot of the objects
before changes are made, and the ending version is a snapshot of the objects
after changes are made. In this scenario, you want to bring the level of the
test system up to the level of the development system.
d. Register the change in the Change Management database. You will be
prompted to register the changes that are being promoted.
e. Submit the batch job that creates the delta changes data set.

456 User's Guide and Reference


2. Import the delta changes data set as a new change on the test system. To
import the promoted changes on the test system:
a. Go the Change Management main menu on the test system and display the
Manage Changes panel.
b. Select the option to import changes.
c. Specify the name of the delta changes data set to import into a change, and
register the imported change in the Change Management database.
Importing a change is a two-step process. First, DB2 Admin performs an
analysis to determine if there are any prerequisite changes that are pending
for the objects that are affected by the imported change. Next, the change is
registered. The steps can be performed either in the foreground (TSO) or the
background (batch).
3. Analyze the imported change. To analyze the change:
a. Go to the Change Management main menu and display the list of changes.
b. Issue the analyze command for the change.
| c. Submit the batch job that DB2 generates to perform the analyze. The batch
job produces a report of the changes that will be made and generates a WSL
that will make the changes.
4. Run the imported change and capture a snapshot of the test human resources
database after the change is complete. To run the change:
a. Go to the Change Management main menu and display the list of changes.
b. Issue the run command for the change, specifying that a new base version
of the database structure should be created after the changes are made.
c. Submit the batch job that runs the WSL that applies the changes.
Related tasks
“Promoting changes” on page 472
“Importing changes” on page 473

Making changes through Change Management


Making a change through Change Management consists of three steps.

Topics:
v “Registering a change”
v “Analyzing a change” on page 462
v “Running a change” on page 465
Related tasks
“Deleting a change” on page 471
“Importing changes” on page 473
“Modifying a change” on page 470
“Promoting changes” on page 472
“Recovering a change made through Change Management” on page 468

Registering a change
When you create a change and Change Management is required (or Change
Management is optional and you have specified to use Change Management), DB2
Admin prompts you to register the change in the Change Management database.

To create and register a change:

Chapter 20. Managing changes to DB2 objects 457


1. Define the change. For example, change a table by using the ALC command or
run SQL statements from a data set or screen input.
If DB2 Admin displays a list of pending changes for the affected objects in the
Pending Changes - Conflict Resolution panel, specify whether to apply the
pending changes as virtual changes before you continue to define your change.

Tip: If Change Management is optional for your SQL ID, specify YES when you
are prompted whether to use Change Management.
2. Fill in the fields on the Register Options panel, and issue the CONTINUE
command.
3. Specify the following information:
v Specify an owner and a name for the change. The default owner is the
current SQL ID. If you specify the name of a existing change, the change
statements are included in the existing change, if possible.
| You can include the change statements in an existing change when the
| existing change has no prerequisite changes and the existing change is not a
| recover change, a fast change, or a promote change on the source side.
v Optionally, specify a comment for the change.
v Specify an owner and a name for the delta version. The default value is the
same as the owner and name of the change. If you leave these fields blank
and press Enter, the default value is filled in.
The following figure shows an example of the Register Options panel:

DB2 Admin -------------------- CM - Register Options -------------------- 21:36


Option ===>

Commands: CONTINUE DB2 System: DB2X


DB2 SQL ID: JOHNSON
Specify the following values to register a change:

Owner . . . . . . . . JOHNSON > (Optional, default is JOHNSON)


Name . . . . . . . . EMP_CH4 >
Comment . . . . . . . Increase the length of WORKDEPT >
Change Type . . . . : CHANGE (Promote, Change, Compare, Recover, Fast)

Specify the owner and name values to use for this change:
Owner Name
Ignore . . . . . . . > > (? to look up)
Mask . . . . . . . . > > (? to look up)
Delta Version . . . . > > (? to look up)

Figure 331. Register Options panel (ADBCRO)

Exception: Depending on how the change was defined, you might first be
prompted about how to register the change on the Register Change
panel:
v If there are no pending changes, you can register the change as
an immediate change or as a normal change.
v If there are pending changes, you can register the change as an
emergency change or as a normal change. When you register it as
a normal change, you must specify whether the pending changes
should be prerequisite changes for the change or whether the
change should supersede the pending changes.
If you register the change as an immediate or emergency change,
you specify an owner and name for the change, and optionally, a
comment. When you press Enter, the change runs immediately. If

458 User's Guide and Reference


you register the change as a normal change and press Enter, the
panel in the previous figure is displayed.

| Note: For DB2 V9 or later versions, Register might insert SET CURRENT
| SCHEMA statements. If the first statement of the change is not a SET
| SCHEMA statement and if the value of CURRENT SCHEMA is different
| from the value of CURRENT SQLID, register will insert a SET SCHEMA
| statement into ADBCHGS prior to processing other given statements.
| And the LASTSCHEMA column of change table ADBCHG will be
| updated with the current SCHEMA.

| Note: Also, when more statements are added to an existing change, the
| LASTSCHEMA will be checked against the current schema and, if they
| are different, another SET SCHEMA statement will be inserted by
| Resister.

| Restriction: When Register is triggered via Restart or Editing the change


| statements via CM panels, SET SCHEMA statements will not be
| inserted by Register. However, the new column LASTSCHEMA in
| table ADBCHG will be updated.
4. Optional: Verify that the change was registered and is in DEFINED status by
completing the following steps:
a. Enter the CMM command to display the Change Management (CM) panel.
b. Select option 1 to display the Manage Changes panel.
c. Select option 1 to display the Changes panel.
d. Verify that your change is included in the list of changes.
| 5. If the change is not registered successfully and is placed in INITIAL status, you
| can issue the restart line command (RST) to attempt to complete registration.
| However, when you restart the change, DB2 Admin cannot detect and process
| any pending changes that might exist. You will need to identify any pending
| changes yourself and reanalyze any change in ANALYZED status to ensure its
| validity.

DB2 Admin has registered your change in the Change Management database and
has automatically assigned a change ID to it. In addition, DB2 Admin has created a
delta version of the change.
Related concepts
“The Change Management process” on page 447

Example 1: Registering a change that is defined with the ALC


command
This example shows how to register a change when pending changes can be
applied as virtual changes before you define your change, such as when you use
the ALC command to redefine a table.

To register the change:


1. Issue the ALC command for the table that you want to change.
2. If Change Management is optional for your SQL ID, specify YES when you are
prompted whether to use Change Management in the Change Management
Prompt pop-up panel that is displayed.
3. If DB2 Admin displays a list of pending changes that exist for the affected
object (that have been registered in Change Management), specify how the
pending changes are to be handled before the object definition is shown, and

Chapter 20. Managing changes to DB2 objects 459


issue the CONTINUE command. The following figure shows an example of an
object that has pending changes:

DB2 Admin ------------ Pending Changes - Conflict Resolution - Row 1 to 2 of 2


Command ===> Scroll ===> PAGE

Commands: CONTINUE
Line commands:
CH - Change I - Interpret

Pending changes exist for table JOHNSON.EMP


Apply virtual changes . . . (Apply, Supersede)

Sel Owner Name Statement


* * *
--- -------- ------------------ ---------------------------------------------->
JOHNSON EMP_CH2 ADMIN ALTER TABLE "JOHNSON"."EMP" INSERT "MO
JOHNSON EMP_CH3 ADMIN ALTER TABLE "JOHNSON"."EMP" ALTER COL
******************************* END OF DB2 DATA *******************************

Figure 332. Pending Changes - Conflict Resolution panel (ADB2CCR)

When you apply the pending changes, you define your new changes based on
a virtual representation of the objects as if the pending changes were
performed.
When you supersede the pending changes, you define the new changes
without taking into account the effect of any pending changes; the new change
becomes a prerequisite change for the pending changes, and any pending
changes that are in ANALYZED status are set to DEFINED status.
4. Fill in the fields on the Register Options panel, and issue the CONTINUE
command.
The following figure shows an example of the Register Options panel:

DB2 Admin -------------------- CM - Register Options -------------------- 21:36


Option ===>

Commands: CONTINUE DB2 System: DB2X


DB2 SQL ID: JOHNSON
Specify the following values to register a change:

Owner . . . . . . . . JOHNSON > (Optional, default is JOHNSON)


Name . . . . . . . . EMP_CH4 >
Comment . . . . . . . Increase the length of WORKDEPT >
Change Type . . . . : CHANGE (Promote, Change, Compare, Recover, Fast)

Specify the owner and name values to use for this change:
Owner Name
Ignore . . . . . . . > > (? to look up)
Mask . . . . . . . . > > (? to look up)
Delta Version . . . . > > (? to look up)

Figure 333. Register Options panel (ADBCRO)

Example 2: Registering a change that is created from screen


input
This example shows how to register a change when you are prompted on the
Register panel to specify whether to register the change as a normal or a fast
change (emergency or immediate) and how any pending changes should be
resolved. This example assumes that there are pending changes to the affected
objects.

To register the change:

460 User's Guide and Reference


1. Specify option 2.1 from the DB2 Admin main menu to display the Execute SQL
Statements from Screen Input panel.
2. Enter the SQL statements that you want to run and press Enter.
3. If Change Management is optional for your SQL ID, specify YES when you are
prompted whether to use Change Management in the Change Management
Prompt pop-up panel that is displayed.
4. On the Register Change panel that is displayed, specify how the change should
be registered, and press Enter.
The following figure shows an example of the Register Change panel:

DB2 Admin ------------------ DB2X CM - Register Change ------------------ 21:36


Option ===> N

C - Cancel
E - Register and run as an emergency change
N - Register as a normal change, pending changes become prereqs
S - Register as a normal change, supersede pending changes
D - Display pending changes to the same object(s)

For option E enter the following information for the change:


Owner . . . . . > (Optional, default is JOHNSON)
Name . . . . . . >
Comment . . . . >

Statement that is about to be executed (first 28 lines)


CREATE TABLESPACE HRTS1 IN HRB1

+----------------------------------------------------------------------+
| There are pending changes related to the objects you are modifying. |
| Use the "Display pending changes" option to see the pending changes. |
+----------------------------------------------------------------------+

Figure 334. Example of Register Change panel (ADBCMRG) when there are pending
changes

Tip: Use option D to review the pending changes to help you make the
appropriate register decision for your change.
If you register the change as an emergency change or as a normal change that
should supersede the pending changes, any pending changes that are in
ANALYZED status are set to DEFINED status. They will need to be analyzed
again.
The following figure shows an example of the Register Change panel had there
been no pending changes for the affected objects:

Chapter 20. Managing changes to DB2 objects 461


DB2 Admin ------------------ DSN8 CM - Register Change ------------------ 21:36
Option ===>

C - Cancel
I - Register and run as an immediate change
N - Register as a normal change

For option I enter the following information for the change:


Owner . . . . . > (Optional, default is TONELLO)
Name . . . . . . >
Comment . . . . >

Statement that is about to be executed (first 28 lines)


CREATE TABLESPACE HRTS1 IN HRB1

Figure 335. Example of Register Change panel (ADBCMRG) when there are no pending
changes

If you specify E or I on this panel to register the change as an emergency


change (pending changes exist) or an immediate change (pending changes do
not exist), you must specify an owner and a name for the change. An
emergency or immediate change is run immediately.
5. Fill in the fields on the Register Options panel, and issue the CONTINUE
command.
The following figure shows an example of the Register Options panel:

DB2 Admin -------------------- CM - Register Options -------------------- 21:38


Option ===>

Commands: CONTINUE DB2 System: DB2X


DB2 SQL ID: JOHNSON
Specify the following values to register a change:

Owner . . . . . . . . JOHNSON > (Optional, default is JOHNSON)


Name . . . . . . . . >
Comment . . . . . . . >
Change Type . . . . : CHANGE (Promote, Change, Compare, Recover, Fast)

Specify the owner and name values to use for this change:
Owner Name
Ignore . . . . . . . > > (? to look up)
Mask . . . . . . . . > > (? to look up)
Delta Version . . . . > > (? to look up)

Figure 336. Register Options panel (ADBCRO)

Analyzing a change
| When you analyze a change, you run a job that creates a work statement list (WSL)
| that will be used in the run process to apply the changes.

A change must be in DEFINED or ANALYZED status to be analyzed.

To analyze a change:
1. Display the change to be analyzed by selecting option 1 on the Change
Management panel, and then select option 1 on the Manage Changes panel.
2. Issue the AN line command for the change that you want to analyze.
3. Fill in the fields on the Generate Analyze Job panel and press Enter. Specify the
following information:

462 User's Guide and Reference


v The base version method that DB2 Admin should use for the compare to
generate the changes.
If you specify U (User-defined), you are prompted to specify the version
scope to use. If you specify E (Existing), you are prompted to specify the base
version to use.
v Whether to change reporting options before submitting the analyze job.
If you specify YES, you are prompted to specify the reporting options to use.
v Data set information for the WSL that is created and for the generated jobs.
The member name will be Cnnnnnnn for the change (and Rnnnnnnn for the
recover change if you choose to have a recover change generated
automatically) where nnnnnnn is the change ID of the change prefixed with
zeros, if necessary.

| Tip: Keep the WSLs that are generated for changes made through change
| management separate from the other WSLs. Do not mix them in the
| same data set. Also, make the data set names for the WSLs and for the
| JCL unique enough so that members for different Change Management
| databases are not put in the same data set.
v Job options.
| If you choose to have DB2 Admin automatically generate a change that will
| recover the current change, you are prompted to register the recover change.
| When you choose to have a recover change generated, you must specify
| whether to have the original data or the existing data in the table recovered.
| Original data is the data that exists just before the original change is run.
| Existing data is the data that exists in the table just before the original
| change is recovered. Original data can be recovered only for objects that are
| dropped as part of the original change; referential integrity is not considered.
| Original data cannot be recovered for changes that are made using an SQL
| ALTER or RENAME statement.
v Optional utility job steps.
v Whether to use active templates.
| If you specify Yes, templates are generated for the non-utility data sets using
| the template definitions that are defined for Object Comparison Tool. If you
| specify No, the defaults for Prefix for data sets apply. If the Take an image
| copy or Run REORG options are Yes, the utility templates are used.
The following figure shows an example of the Generate Analyze Job panel:

Chapter 20. Managing changes to DB2 objects 463


| DB2 Admin ----------------- Generate Analyze Job ----------------------- 21:45
| Command ===>
|
| Specify the following for Analyze:
|
| Base version method . . . . . (Auto, User, or Existing)
|
| Change reporting options . . NO (Yes/No)
|
| Required data set information:
| PDS for WSL . . . . . . . C0000108.ANALYZE.WSL
| PDS for jobs . . . . . . C0000108.ANALYZE.JCL
| Prefix for data sets . . JOHNSON
|
| Options:
| Run SQLID . . . . . . . . <NONE> (<NONE>/Blank)
| Validate WSL . . . . . . NO (Yes/No)
| Use utility options . . . NO (Yes/No)
| Use an ignore . . . . . . NO (Yes/No)
| Generate templates . . . NO (Yes/No)
| Build JCL to run WSL . . NO (Yes/No)
| Generate a recover change YES (Yes/No)
| Data to recover E (Original or Existing)
|
| Stop on conversion error. NO (Yes/No)
| Use DEFER YES . . . . . . YES (Yes/No)
| Unload Method . . . . . . U (Unload, HPU)
|
| Optional jobs after Reload or Alter:
| Run CHECK DATA . . . . NO (Yes/No)
| Take an image copy . . N (after: Reload/Alter/Both/None)
| Run REORG . . . . . . . N (Mandatory, All relevant, None)
| Run RUNSTATS . . . . . N (after: Reload/Alter/Both/None)
| Run REBIND . . . . . . NO (Yes/No)
|
| BP - Change batch job parameters
| TU - Specify TEMPLATE usage
| UO - Change utility options
||
| Figure 337. Generate Analyze Job panel (ADB2C11A)
|
Depending on the values that you specify on the panel, you might be
prompted for additional information before the jobs to perform the analysis are
generated and before an ISPF Edit session is displayed.
4. If the change that you are analyzing has already been analyzed (that is, the
change is in ANALYZED status, specify whether to continue with or to cancel
the analyze request when you are prompted. The warning prompt indicates
that the change will be put back in DEFINED status before the new analyze job
is created if you continue.
5. Edit and submit the generated job. When the job completes successfully, the
change is placed in ANALYZED status.
If you requested that a recover change be generated, the recover change is
created and is also placed in ANALYZED status. In addition, a delta version for
the recover change is created.
6. Press PF3 to return to the Changes panel to verify that the status of the change
is ANALYZED. If you requested that a recover change be generated, you can
verify that it is included in the list of changes.

| Tip: If you return to the Changes panel before the submitted job completes,
| you can enter the REF primary command after the job completes to see
| the refreshed status of the change.

464 User's Guide and Reference


If the job does not complete successfully, check the error messages in the job
output. Correct any errors and then reanalyze the change by issuing the AN
command.
Related concepts
“The Change Management process” on page 447
“Base version method”
Related tasks
“Importing changes” on page 473

| Base version method


| During the analysis of a change, DB2 Admin needs to know the current state of the
| objects that are being changed.

| DB2 Admin can get this information from an existing version that was created
| earlier or extract the information from the DB2 catalog.

| When the information is extracted from the DB2 catalog, DB2 Admin either
| extracts it based on a user-defined scope or based on the objects that are being
| changed.

| The base version method that you choose depends on your installation's needs.
| Your shop might prefer to create a new snapshot (base version) after every change
| to use as a backup and also as the base version for new changes. When the next
| change needs to be analyzed, you can specify to have the existing version used
| and avoid extracting the object definitions from the DB2 catalog to get the current
| status. Processing time is saved when you do not have to extract the objects from
| the catalog.

| Other shops might want to work on one application at a time. A scope can be
| defined that includes all of the objects in the application (for example, one or more
| databases) and always use this scope as the base when analyzing a change.

| Some shops might not want to use existing base versions or user-defined scopes
| and choose to have the base automatically generated from the DB2 catalog when
| analyzing a change.
| Related tasks
| “Analyzing a change” on page 462

Running a change
When you run a change, the work statement list (WSL) that was created during the
analyze process is run.

A change must be in ANALYZED status to be run. If you plan to have a base


version of the objects created after the change, a version scope that defines the set
of objects to be included in the base version must exist.

To run a change:
1. Display the change to be run by selecting option 1 on the Change Management
panel, and then select option 1 on the Manage Changes panel.
2. Issue the RN line command for the change that you want to run. If the change
has prerequisite changes, DB2 Admin will issue a message that prompts you to
run the prerequisite changes first.

Chapter 20. Managing changes to DB2 objects 465


3. Fill in the fields on the Run a Change panel and press Enter. Specify the
following information:
v Data set information for the generated jobs.
v Whether to generate a base version that reflects the objects after the change
are made. If you specify YES, enter an owner and name for the version scope
and for the base version. You must identify an existing version scope. If you
specify the name of an existing base version, you will be prompted about
whether the existing base version should be replaced.
| v Whether to change the Object Compare reporting options for the runtime
| analyze.
| Changes, such as those that are not made through Change Management,
| might have occurred to the DB2 catalog since the WSL that was generated
| during the analyze process was created. That WSL might now conflict with
| or undo those changes. To minimize the possibility of run-time errors, you
| can verify the WSL by generating a new WSL and having it compared to the
| WSL that was generated during the normal analyze process.
| The new run-time WSL is generated for the change, and its recover change if
| one exists, based on the current DB2 catalog and using the automatic base
| version method. The run-time WSL files are compared with the WSL files
| that were created during the normal analyze process. If the DDL and DCL
| content are the same, the run job continues and the WSL that was generated
| during the normal analyze is run to apply the changes. If the DDL or DCL
| content are different, the run job stops with a return code of 8, and the
| change is not run. A message is issued to indicate that the WSLs did
| compare equally. If the WSLs mismatch, go the Changes panel and issue the
| AN line command to analyze the change again to resolve the differences
| before trying to run the change again.
The following figure shows an example of the Run a Change panel:

| DB2 Admin ---------------- CM - Run a Change ----------------------------------


| Command ===>
| Enter required field
|
|
| Change . . . : JOHNSON.EMP_CH4
|
| Data set information:
| PDS for jobs . . . . . . DSN8.RUN.JCL
| Prefix for data sets . . JOHNSON
|
| Create a new base version YES (Yes/No)
| Scope Information:
| Owner . . . . . . . . JOHNSON > (? to lookup)
| Name . . . . . . . . . HR_SCOPE > (? to lookup)
|
| Version Information:
| Owner . . . . . . . . JOHNSON > (? to lookup)
| Name . . . . . . . . . HR_VER2 > (? to lookup)
|
| Runtime analyze:
| Change reporting options NO (Yes/No)
||
| Figure 338. Run a Change panel (ADB2CEX1)
|
Tip: If you create a new base version and the change is for an object outside of
the current version scope, ensure that you update the definition of the
version scope after the change is run. You want to update the version
scope to include all objects so that any subsequent changes for which you
create a new base version include all the objects. For example, if the

466 User's Guide and Reference


version scope includes database DB01 and the change is to add a second
database DB02, change the definition of the version scope to include
database DB02.
4. Edit and submit the generated job. The change is placed in COMPLETE status.
| When you run a change, the run job reanalyzes the change and creates a
| second WSL. This second WSL is compared with the WSL that was generated
| during the normal analyze process. If the DDL and DCL content are the same,
| the run job continues and the WSL that was generated during the normal
| analyze is run to apply the changes. If the DDL or DCL content are different,
| the run job stops with a return code of 8, and the change is not run. A message
| is issued to indicate that the WSLs did compare equally. If the WSLs mismatch,
| go the Changes panel and issue the AN line command to analyze the change
| again to resolve the differences before trying to run the change again.
| 5. Press PF3 to return to the Changes panel to verify that the status of the change
| is COMPLETE.

| Tip: If you return to the Changes panel before the submitted job completes,
| you can enter the REF primary command after the job completes to see
| the refreshed status of the change.

If the job fails (the status of the job does not change to COMPLETE), the action to
take depends upon the status in which the change is left:
| v If the status is ANALYZED, check the job output. If a message indicates that the
| run-time WSL did not match the WSL that was generated during the analyze
| process, return to the Changes panel and issue the AN line command to
| reanalyze the change. Then, run the change again.
| v If the status is RUNNING, check the job output. Determine the cause of the
| failure and make any necessary corrections. Then, return to the Changes panel,
| issue the ER line command to edit the run job, and resubmit it. When you
| submit the run job, the job is restarted at the appropriate step.
| When you issue the ER line command, the JCL for the run job is placed in edit
| mode. Before the job is displayed in edit mode, a RESTART parameter is
| automatically added to the job card to restart the job at the step that runs
| ADBTEP2 so that you do not have to determine the step name where the job
| should be restarted. In addition, if the RESTART parameter for ADBTEP2 was
| changed to RESTART(NO) by using the ER line command during an earlier edit
| session, the parameter is automatically changed to RESTART(YES) because
| ADBTEP2 must be restarted with the parameter RESTART(YES). If the parameter
| is missing, ADBTEP2 assumes a YES value.
| These automatic changes and any edit changes that you make are saved to the
| JCL data set so that you do not need to re-enter the changes for a subsequent ER
| line command for the job.
| When you submit the run job, the job is restarted at the appropriate step.

| Important: Any user can use the ER line command to edit and resubmit a
| change in RUNNING status. The user who originally ran the change
| is not required to resubmit the job. The restart record in the
| checkpoint table for the change retains the userid of the original
| submitter. DB2 Admin locates the record by using CHANGEID
| parameter. The RN and ER line commands automatically include the
| CHANGEID parameter when the run job is built so that you do not
| have to manage this process.

Chapter 20. Managing changes to DB2 objects 467


Related concepts
“The Change Management process” on page 447
Related tasks
“Importing changes” on page 473

| Recovering a change made through Change Management


| You can recover changes that have been made through Change Management.

| Changes must be backed out one at a time.

| The following criteria must be met to recover a change:


| v The change must be in COMPLETE status.
| v A recover change must exist for the change and be in ANALYZED status. That
| is, when the change was analyzed, it was specified that a recover change be
| created. The WSL that was generated for the recover change during the analyze
| process must also be available.
| v All completed changes that must be recovered first have been recovered. For
| example, assume that you made the following changes:
| 1. Created a table space.
| 2. Created a table in the table space.
| 3. Modified the table to insert a new column.
| If you want to recover the change that created the table space, which would be
| to drop the table space, you must first recover the change to insert the new
| column into the table and then recover the change to create the table. Each of
| these changes must have a recover change.
| When you attempt to recover a change, DB2 Admin will automatically identify
| any completed changes that must be recovered first and list them in the order in
| which you need to recover them. The list of changes represents those changes
| that have completed after the change to be recovered completed and that modify
| the same or a related set of objects in the change to be recovered.

| To recover a change:
| 1. Display the change to be recovered by selecting option 1 on the Change
| Management panel and then option 1 on the Manage Changes panel.
| 2. Issue the RC line command for the change that you want to recover.

| Important: You always recover a change by issuing the recover line command
| (RC) for the change to recover. You cannot issue the run line
| command (RN) for the recover change itself.
| DB2 Admin will prompt you in the following situations:
| v If the change cannot be recovered because it has no recover change (or
| change that must be recovered first does not have a recover change), an error
| message is issued.
| v If the change cannot be recovered because other changes must be recovered
| first, a panel is displayed with the list of changes that must be recovered first
| and the order in which the changes must be recovered. Recover the list of
| changes in the order that is specified before you recover this change.
| The following figure shows an example of the panel that might be displayed
| when other changes need to be recovered first.
|

468 User's Guide and Reference


| DB2 Admin ---------------- DB2X CM - Recover Strategy ----------- Row 1 from 4
| Command ===> Scroll ===> PAGE
|
|
| Recover strategy for change "JOHNSON"."CR_HRDB"
| Line commands:
| CH - Change I - Interpret
|
| Rcvr
| Sel Order Owner Name Statement
| * * * *
| --- ----- -------- ------------------ ---------------------------------------->
| 1 JOHNSON CR_HRDEPT CREATE TABLE HRDEPT (DEPTNO CHAR(3) NOT N
| 2 JOHNSON CR_HREMP CREATE TABLE HREMP (EMPNO CHAR(6)) IN HRD
| 3 JOHNSON CR_HRTS2 CREATE TABLESPACE HRTS2 IN HRDB
| 4 JOHNSON CR_HRTS1 CREATE TABLESPACE HRTS1 IN HRDB
| ******************************* END OF DB2 DATA *******************************
|
|
| +--------------------------------------------------------------------------+
| | Change "JOHNSON"."CR_HRDB" cannot be recovered now because the following |
| | changes must be recovered first. |
| +--------------------------------------------------------------------------+
|
|
| Figure 339. Example of list of changes that must be recovered
|
| v If the change can be recovered but recovering the change will cause other
| changes in ANALYZED status to be set to DEFINED status, a panel is
| displayed with the list of changes that will be set to DEFINED status.
| The following figure shows an example of the panel that might be displayed
| when recovering a change will cause the status of other changes to be set to
| DEFINED.
|
| DB2 Admin ---------------- DB2X CM - Recover Strategy ----------- Row 1 from 1
| Command ===> Scroll ===> PAGE
|
| Commands: CONTINUE
| Recover strategy for change "JOHNSON"."CR_HRDEPT"
| Line commands:
| CH - Change I - Interpret
|
| Rcvr
| Sel Order Owner Name Statement
| * * * *
| --- ----- -------- ------------------ ---------------------------------------->
| 0 JOHNSON MOD_HREMP2 ALTER TABLE HREMP FOREIGN KEY RED (WORKDE
| ******************************* END OF DB2 DATA *******************************
|
|
|
|
| +------------------------------------------------------------------------------+
| | These pending changes need to be superseded in order for the change to be |
| | recovered. Each of these changes that are not in DEFINED status will be set |
| | to DEFINED. You must ensure the PCACT parameter in the recover job is set |
| | to supersede (e.g. PCACT(SUPERSEDE)) to confirm the supersede action. |
| | Note: The recover strategy is re-calculated at runtime and thus may be |
| | different from what it is now. |
| +------------------------------------------------------------------------------+
||
| Figure 340. Example of list of changes that will be set to DEFINED status
|
| 3. If a panel is displayed that shows the changes in DEFINED status and changes
| in ANALYZED status that will be set to DEFINED status, review the list of
| changes. Issue the CONTINUE command to proceed with recovering the
| change.

Chapter 20. Managing changes to DB2 objects 469


| 4. Edit and submit the generated job. When the job completes successfully, the
| status of the change that is recovered is set to DEFINED and the status of the
| recover change is set to COMPLETE.
| 5. Press PF3 to return to the Changes panel to verify that the status of the change
| is DEFINED and the status of the recover change is COMPLETE.

| Tip: If you return to the Changes panel before the submitted job completes,
| you can enter the REF primary command after the job completes to see
| the refreshed status of the change.

| If the job fails, check the job output to determine the cause of failure, make the
| necessary corrections, and restart the job.

| Restriction: The following restrictions apply to recovering changes:


| v If an ignore was specified for a change, the change cannot be
| recovered.
| v If privileges were granted as part of the change that was recovered,
| the privileges are not revoked when the change is recovered. You
| must create a new change to revoke the privileges. Changes to
| revoke privileges can be made through Change Management only if
| they are run as immediate changes.
| Related concepts
| “Making changes through Change Management” on page 457

| Modifying a change
| You can modify the change statements in an existing change if the change is in
| INITIAL, DEFINED, or ANALYZED status.

| However, modifying an existing change is considered a manual intervention and is


| not recommended for several reasons. When you modify an existing change, DB2
| Admin cannot apply virtual changes or determine whether pending changes exist.
| Modifying an existing change can also impact other existing changes substantially.
| For example, the change you are modifying might be a pending change that was
| applied when another change was created.

| To modify the change statements in an existing change:


| 1. Identify and consider the impact of the changes to dependent changes. For
| example, assume that want to modify a change that adds a new column to a
| table to change the name of the column. The change might be a prerequisite
| change to other changes that use that column such as another change that
| creates an index that includes that column.
| 2. Display the change to be modified by selecting option 1 on the Change
| Management panel, and then select option 1 on the Manage Changes panel.
| 3. Issue the ST line command to display the change statements in the change that
| you want to modify on the Change Statements panel. The following figure
| shows an example of the Change Statements panel:
|

470 User's Guide and Reference


| DB2 Admin ------------- CM - Change Statements ------------------ Row 1 from 1
| Command ===> Scroll ===> CSR
|
| Change statements for change "JOHNSON"."EMP_CH2"
| Line commands:
| E - Edit D - Delete I - Insert S - Show
|
| Sel Sequence O Qual Name Statement
| * * * * *
| --- ----------- -- -------- ------------------ ------------------------------->
|
| 1 TB JOHNSON HREMP ALTER TABLE "JOHNSON"."HREMP"
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 341. Change Statements panel (ADB2C1S )
|
| 4. Issue the E line command to change any of change statements in the change,
| the D line command to delete a change statement, and the I line command to
| insert a new change statement. When you use the E and I line commands, you
| are put into an ISPF edit session and can work with the SQL statement.
| 5. Press F3 to return to the Change Statements panel. DB2 Admin reregisters the
| change. A message is displayed to indicate whether the change was registered
| successfully. When a modified change is reregistered, pending changes or
| prerequisite changes are not processed.
| 6. Reanalyze any change that is in ANALYZED status and that is impacted by the
| modifications that you made to this change. Reanalyzing the impacted changes
| ensures the validity of the changes.
| Related concepts
| “Making changes through Change Management” on page 457

| Deleting a change
| You can delete certain types of changes if DB2 Admin has been configured to
| support the delete change line command and you have the appropriate privileges.

| You can delete only the following types of changes:


| v Changes that have a status of CANCELED
| v Changes that have a type of FAST and a status of FAILED.
| v Changes that have a type of COMPARE

| To delete a change:
| 1. Display the change to be deleted by selecting option 1 on the Change
| Management panel, and then select option 1 on the Manage Changes panel.
| 2. Issue the DEL line command against the change that you want to delete. A
| pop-up window is displayed to confirm your intention to delete the change.
| 3. Select 2 to continue with deleting the change.

| After a change is deleted, it will no longer appear in the list of changes. The
| change is removed from the Change Management database, which removes any
| audit tracking for the change.

Chapter 20. Managing changes to DB2 objects 471


| Related concepts
| “Making changes through Change Management” on page 457

Promoting changes
| Promoting changes allows you to move changes from one system to another
| because a delta changes data set is generated, which you can then import into a
| change on another system.

To promote a change, two versions must exist. The starting version represents the
state of objects before any changes are made and the ending version represents the
state of objects after the promoted changes are made. During the promote process,
DB2 Admin compares the ending version with the starting version and generates a
delta changes data set the contains the SQL statements that are required to bring
the other system up to the same level as the system from which your promoting
the changes.

To promote a change:
1. Select option 1 on the Change Management panel, and then select option 3 on
the Manage Changes panel to display the Promote panel.
Alternatively, you can use either of the following methods to display the
Promote panel:
v If you know the ending version, specify the PR line command for the version
on the Versions panel. The Promote panel will be displayed with the
information for the ending version filled in.
v If you know the change and a new base version was created when the
change was run, specify the PR line command for the change on the Changes
panel. The Promote panel will be displayed with the information for the
ending version filled in.
2. Specify the following information on the Promote panel and press Enter.
v The starting version
v The ending version
v The data set name for the promote batch job
v The data set name for the delta changes statements
The following figure shows an example of the Promote panel:

472 User's Guide and Reference


DB2 Admin ----------------------- CM - Promote -------------------------- 18:33
Command ===>

Start Version (Old):


Owner . . . . . . JOHNSON > (? to look up)
Name . . . . . . HR_VER1 > (? to look up)

or enter a data set name that contains a Start Version:

Data set name . .

End Version (New):


Owner . . . . . . JOHNSON > (? to look up)
Name . . . . . . HR_VER2 > (? to look up)

Output data set names:


Promote JOB JCL . DSN8.PROMOTE.JCL
Delta change . . PROMOTE.CH.HR01

Figure 342. Promote (ADB2CPS) panel

3. Specify the following information on the register panel and issue the
CONTINUE command:
a. Specify an owner and a name for the change. The default owner is the
current SQL ID.
b. Optionally, specify a comment for the change, an ignore for the change, and
a mask for the change.
The change will be registered as a COMPARE change.
4. Edit and submit the generated job. When the job completes successfully, the
change is placed in COMPLETE status.

You can now import the delta changes data set into a new change on another
system, analyze the change, and run the change to bring the level of the other
system up to the level of the current system.
Related concepts
“Making changes through Change Management” on page 457
“Versions” on page 489
Related tasks
“Importing changes”
“Scenario: Promoting changes from one system to another” on page 456

Importing changes
You can create a change by importing SQL statements from a data set. When you
import the statements, a new change is created and registered. You can import
multiple delta changes as a group in one change.

| When importing changes:


| v You can import SQL statements (DDL) and you can import delta changes as
| generated by the DB2 Object Comparison Tool.
| v DB2 Object Comparison Tool will create a delta change if "CHANGE" is
| specified for "Generate apply jobs" on panel GOC5 (this generates parameter
| CMDELTA for GOC2CMP).
| v Importing an DB2 Object Comparison Tool change data set that is not generated
| as a delta change can have unwanted side effects. This cannot be checked during
| import.

Chapter 20. Managing changes to DB2 objects 473


| v You can import a mix of SQL statements and delta changes (as long as they
| logically relate).

If the imported SQL statements affect objects for which pending changes exist, you
determine whether the imported change becomes a prerequisite change for those
pending changes or not.

| You can create a single change by importing multiple files at the same time. Each
| file must be one of the types mentioned below. All types can be part of the same
| Import.

| The data sets from which you are importing the SQL statements must be either:
| v The delta changes data set that was generated when changes were promoted
| with Change Management from another system. Thus, you can import the
| changes that were promoted from another system that uses Change
| Management.
| v The delta changes data set that DB2 Object Comparison Tool generated when
| objects were compared. DB2 Object Comparison Tool uses the worklist name for
| this data set (qualifier1.worklist_name.CHG). The worklist name will be generated
| by specifying CHANGE in the "Generate apply jobs" field on panel GOC5. You
| can specify a data set name and optionally specify a member name if the data
| set is partitioned.
| v A data set that contains SQL statements that meets these requirements:
| – A fixed-block sequential data set (RECFM=Fx,LRECL=80)
| – A member of a partitioned data set with a logical record length of 80
| (RECFM=Fx,LRECL=80)

| If you are importing a delta changes data set, the data set must represent one
| generated delta changes file. Concatenating or merging multiple data sets into one
| can cause unpredictable results because statements are reordered during the import
| process.

When you import SQL statements into a change, the version of DB2 that is on the
system must support the SQL statements that you are importing.

To import a change:
1. Select option 1 on the Change Management panel to display the Manage
Changes panel.
| 2. Select option 4 to import changes.
| 3. Specify the name of the data set that contains the SQL statements. This panel is
| re-displayed after each entry so that you can enter more input data sets. Thus,
| you can generate a list of input dataset names that will be processed in the
| specified sequence. The following figure shows the Import Changes panel:
|

474 User's Guide and Reference


| ADB2C14 n ------------------- CM - Import Changes ------------------- 08:05
| Command ===
|
| Commands : CONTINUE RESET DB2 System: DSN8
|
| Input data set information:
| Data set name .
| Member . . . (member name or pattern if partitioned)
| Line commands :
| M - Move A - After B – Browse D - Delete
|
| Select Seq Data set name Oper.
| ------ --- -------------------------------------------------------- ------
|
| 1 USER01.PROD.CHANGES(FEB08001)
| 2 USER01.PROD.CHANGES(FEB08002)
| 3 USER01.PROD.CHANGES(FEB08003)
| 4 USER01.PROD.CHANGES(FEB08010)
| 5 USER01.PROD.CHANGES(FEB08011)
| 6 USER01.PROD.CHANGES(FEB08071)
| 7 USER01.PROD.CHANGES(FEB08072)
| 8 USER01.PROD.CHANGES(FEB08073)
| 9 USER01.PROD.CHANGEXX
| 10 USER01.PROD.CHANGES(XXCHGA)
| 11 USER01.PROD.CHANGES(XXCHGB)
| ******************************* END OF DB2 DATA *******************************
||
| Figure 343. Import Changes panel (ADB2C14)
|
| If the input dataset is a PDS, you must specify a member name or a member
| pattern (as defined by ISPF) . If a member pattern is specified, all members that
| fit the pattern will be added to the list of data sets to import in member name
| sequence. If you want a different sequence, you can use line commands to
| move entries in the list
| To process the import, issue the CONTINUE command. To clear the list of data
| sets, issue RESET.Importing multiple data sets into a single change should be
| carefully planned. Import cannot check whether the changes in the specified
| sequence will logically work as desired. The input changes will be imported
| into the change individually in the sequence they are specified, and you must
| ensure that any change in the list logically has all preceding changes as
| prerequisites.
4. Importing a change is a two-phase process in which DB2 Admin determines if
there are any pending changes for the objects and then registers the imported
change. The processing modes are:
TSO Perform the processing in the foreground (TSO)
Batch Perform the processing in background (batch)
| The following figure shows the Import Changes - Select process modes panel:
|
| ADB2C14M ------- CM Import changes - Select process modes --14:28
|
|
| Specify how to continue Import :
|
| Prereq resolution mode . BATCH (TSO/Batch)
| Execution mode . . . . . BATCH (TSO/Batch)
||
| Figure 344. Import Changes - Select process modes panel (ADB2C14M)
|
5. If you specify TSO for both prerequisite checking and change registration,
complete the following steps:
a. Fill in the fields of the Register panel, and issue the CONTINUE command.
Specify the following information:

Chapter 20. Managing changes to DB2 objects 475


v Specify an owner and a name for the change. The default owner is the
current SQL ID.
v Optionally, specify a comment for the change, an ignore for the change,
and a mask for the change.
v Specify an owner and a name for the delta version. The default value is
the same as the owner and name of the change. If you leave these fields
blank and press Enter, the default value is filled in.
b. If the changes in the data set affect objects that have pending changes,
specify the action to take on the Import Pending panel and press Enter. The
following actions are possible:
Prereq Make the pending changes for the objects prerequisite changes for
the imported change
Supersede
Make the imported change a prerequisite change for the pending
changes
Cancel
Cancel importing the change
Display
Display the changes that are pending
c. When the Import Changes panel is re-displayed, verify the message that
indicates whether the change was registered successfully. The change is put
in DEFINED status.
6. If you specify TSO for prerequisite checking and batch for change registration,
complete the following steps:
a. Specify a data set name to contain the (delta) change statements and press
Enter.
b. Fill in the fields on the Register panel, and issue the CONTINUE command.
Specify the following information:
v Specify an owner and a name for the change. The default owner is the
current SQL ID.
v Optionally, specify a comment for the change, an ignore for the change,
and a mask for the change.
v Specify an owner and a name for the delta version. The default value is
the same as the owner and name of the change. If you leave these fields
blank and press Enter, the default value is filled in.
The change will be registered as a PROMOTE change.
c. If the changes in the data set affect objects that have pending changes,
specify the action to take on the Import Pending panel and press Enter. The
possible actions are:
Prereq Make the pending changes for the objects prerequisite changes for
the imported change.
Supersede
Make the imported change a prerequisite change for the pending
changes
Cancel
Cancel importing the change
Display
Display the changes that are pending
d. Review the job to register the change and submit the JCL. When the job
completes successfully, the change is registered and put in DEFINED status.

476 User's Guide and Reference


| 7. If you use batch mode for resolving prerequisite changes, you must use batch
| mode for registering the change. If you specify batch for both prerequisite
| checking and change registration, complete the following steps:
| a. Specify the action to take if there are pending prerequisite changes for the
| objects that the imported change affects. The options on the Import a
| Change - Action for Pending Changes panel are:
| Prereq Make the pending changes for the objects prerequisite changes for
| the imported change.
| Supersede
| Make the imported change a prerequisite change for the pending
| changes
| Cancel
| Do not import the changes if there are pending changes

| Recommendation: Specify Cancel to avoid registering the changes if there


| are pending changes. You can review the batch output,
| which will list the pending changes, decide whether to
| keep them as prerequisite changes or supersede them,
| and then import the change again specifying either
| Prereq or Supersede.
| b. Fill in the fields of the register panel, and issue the CONTINUE command.
| Specify the following information:
| v Specify an owner and a name for the change. The default owner is the
| current SQL ID.
| v Optionally, specify a comment for the change, an ignore for the change,
| and a mask for the change.
| v Specify an owner and a name for the delta version. The default value is
| the same as the owner and name of the change. If you leave these fields
| blank and press Enter, the default value is filled in.
| c. Review the job and submit the JCL.

You can now display your imported change on the Changes panel, analyze the
change, and then run it.
Related concepts
“Making changes through Change Management” on page 457
Related tasks
“Promoting changes” on page 472
“Analyzing a change” on page 462
“Running a change” on page 465
“Scenario: Promoting changes from one system to another” on page 456
“Specifying a mask” on page 504

Masks
A mask (also called translation mask) provides the ability to cause context-sensitive
global changes to naming conventions and to overwrite the current values of
certain table space and index space attributes when you use various functions of
DB2 Admin and DB2 Object Comparison Tool.

You can define and manage masks by using the Change Management panels.
Masks that are specified when you import changes through Change Management
must be defined in the Change Management database, where the masks are stored

Chapter 20. Managing changes to DB2 objects 477


in a table. Masks that are specified on panels for reverse engineering the catalog,
cloning WSLs, migrating objects, or explicitly performing comparisons by using
DB2 Object Comparison Tool can be defined in the Change Management database
or in a data set.

Tip: Consider managing all your masks through Change Management. The masks
are easy to track and recover because they are stored in the Change
Management database.

The Manage Masks panel, as shown in the following figure, is the main menu for
working with masks.

DB2 Admin ------------------- CM - Manage Masks ----------------------- 18:03


Option ===>

1 - Display masks DB2 System: DB2X


2 - Create a mask DB2 SQL ID: ISTJE

Enter display selection criteria (Using a LIKE operator, criteria not saved):
Name . . . . . . . > Created by . . >
Owner . . . . . . > Altered by . . >
Created within . . Mask ID . . .
Altered within . .

Figure 345. Manage Masks panel (ADB2C2)

Related concepts
“Mask definitions” on page 505

Displaying the masks


You can display the masks that are stored in the Change Management database.

To display the masks:


1. Select option 2 on the Change Management (CM) panel to display the Manage
Masks panel.
2. Optional: Use the fields at the bottom of the panel to specify the search criteria
to filter or limit the masks that are displayed.
3. Select option 1 on the Manage Masks panel to display the Masks panel, shown
in the following figure:

478 User's Guide and Reference


DB2 Admin ------------------- CM - Masks ------------------- Row 1 to 10 of 10
Command ===> Scroll ===> PAGE

Line commands:
U - Update DEL - Delete INS - Insert ML - Mask lines CH - Changes
E - Edit I - Details on mask

Sel ID Owner Name Comment


* * * *
--- ----------- -------- ------------------ ----------------------------------
14 JOHNSON DEVHRMASK MASK FOR HR APPLICATION
16 JOHNSON TSTBANKMASK MASK FOR BANKING APPLICATION
21 TONELLO MYFIRSTMASK
41 MYID MYMASK MY MASK IN CM
42 MYID MYMASK1 ANOTHER NEW MASK
43 MYID MYMASK2
45 MYID MYMASK3
47 MYID MYMASK4
61 LOSER LOSER MASK FOR LOSERS
******************************* END OF DB2 DATA *******************************

Figure 346. Masks panel (ADB2C31)

You can issue a variety of line commands for each mask that is displayed on the
Masks panel. Commands are available to do the following tasks:
v See the definition of the mask and modify it
v View details about who created the mask and when and who altered it last
v See which changes use the mask
v Insert, delete, or update a mask

| Masks that have been created in an explicitly named data set outside of Change
| Management are not displayed because they are not stored in the Change
| Management database. You might have created masks that you use when
| performing comparisons using DB2 Object Comparison Tool or other functions in
| DB2 Admin (such as reverse engineering, migrating DB2 data, or cloning work
| statement lists) in a data set. When you are prompted to specify the mask to use,
| you have the option of using masks that are either in data sets or in the Change
| Management database.

Creating a mask
You can create a mask that is stored in the Change Management database.

To create a mask:
1. Select option 2 on the Change Management (CM) panel to display the Manage
Masks panel.
2. Select option 2 on the Manage Masks panel to display the Insert Mask panel.
3. Specify an owner and a name for the mask, and optionally enter a comment for
the mask. Press Enter.
4. Press F3 to return to the Manage Masks panel.
5. Select option 1 to display the masks on the Masks Panel.
6. Issue the ML line command for the mask you just created to add the mask line
definitions for the mask. For each mask line that you add, specify:
v The type of object for the mask in the Type field. For example, TBNAME
specifies a mask for tables.
v The input mask (the pattern of the string that you want to translate) in the
From field.
v The output mask (the string to which you want to translate) in the To field.

Chapter 20. Managing changes to DB2 objects 479


For example, to define a mask that translates any table name that starts with
DEV to a name that starts with TST and a column name from CELLNO to
MOBILENO, enter the values that are shown in the following figure:

DB2 Admin ----------------- CM - Mask Lines --------------------- Row 1 from 2


Command ===> Scroll ===> PAGE

Mask lines for mask "MYID"."MYMASK2"


Commands: SAVE
Line commands:
I - Insert D - Delete R - Repeat M - Move A - After B - Before

Sel Sequence Type From To Oper. T


* * * * * *
--- ----------- --------- --------------------> --------------------> ------ -

* 1 TBNAME DEV* TST* UPDATE


* 2 COLNAME CELLNO MOBILENO UPDATE
******************************* END OF DB2 DATA *******************************

Figure 347. Mask Lines panel (ADB2C2L)

The hierarchy of mask types is the same as it is when you define and edit a
mask data set outside of Change Management. See the online help to review
the hierarchy.
You can use the I, D, and R line commands to quickly insert, delete, and repeat
mask lines when you define a mask. You can also use the A and B line
commands with the M line command to quickly move the mask lines around in
the definition. The order of the mask lines in the definition is important
because the first mask that matches is used and the name is translated to the
second value. You should put the most specific translation masks at the
beginning and the more general ones at the end.
7. Issue the SAVE primary command to save the definition of the mask.
8. Press F3 to return to the Manage Masks panel.
Related concepts
“Mask definitions” on page 505
Related tasks
“Specifying a mask” on page 504

Creating and storing a new mask in the Change Management


database
| If you are using DB2 Object Comparison Tool or other functions in DB2 Admin
| (such as reverse engineering, migrating DB2 data, or cloning work statement lists)
| and specify to use masking and you need to define a new mask, you can specify
| that the mask that be created and stored in the Change Management database
| instead of a data set if Change Management is enabled. When you are prompted to
| specify the masks on either the Specify Compare Masks panel or the Specify Masks
| panel, complete the following steps:
1. As shown in the following figure, specify an owner and a name for the mask,
do not specify a data set name, specify YES in the Edit Mask field, and press
Enter.

480 User's Guide and Reference


Compare --------------------- Specify Compare Masks --------------------------
Option ===>

Mask Table Entry:


Owner . . MYID > (? to look up)
Name . . MYMASK > (? to look up)
Data Set:
Mask DSN . .
Options:
Edit Mask . . YES (Yes/No)

Figure 348. Specify Compare Masks panel (GOC3)

2. Verify the owner and name of the mask on the owner. Optionally, enter a
comment for the mask. Press Enter. A message is displayed that indicates that
the mask was inserted.
3. Press F3 to display the Mask Lines panel to define the entries in the mask. For
each mask line that you add, specify:
v The type of object for the mask in the Type field. For example, TBNAME
specifies a mask for tables.
v The input mask (the pattern of the string that you want to translate) in the
From field.
v The output mask (the string to which you want to translate) in the To field.
4. Issue the SAVE primary command to save the definition of the mask.

Editing a mask
You can change the definition of a mask.

To edit a mask that is stored in the Change Management database:


1. Select option 2 on the Change Management (CM) panel to display the Manage
Masks panel.
2. Select option 1 on the Manage Masks panel to display the masks on the Masks
panel.
3. Issue either the ML line command or the E line command for the mask you
want to edit.
v When you use the ML line command, you use the Mask Lines panel to add,
delete, and change the definitions for your mask. Each line in the file defines
a mask type. You can use the I, D, and R line commands to quickly insert,
delete, and repeat mask lines when you edit the mask. You can also use the
A and B line commands with the M line command to quickly move the mask
lines around in the definition. Issue the SAVE primary command to save
your changes. Press PF3 to return to the Masks panel.
v When you use the E line command, you use ISPF edit to edit the mask data
set that contains the mask definition. Press PF3 to save your changes and
return to Masks panel.

Chapter 20. Managing changes to DB2 objects 481


Related concepts
“Mask definitions” on page 505
Related tasks
“Specifying a mask” on page 504

Deleting a mask
You can delete a mask that is stored in the Change Management database.

To delete a mask:
1. Select option 2 on the Change Management (CM) panel to display the Manage
Masks panel.
2. Select option 1 on the Manage Masks panel to display the Masks panel.
3. Issue the DEL line command for the mask that you want to delete.

Ignores
An ignore provides the ability to specify that certain fields in the DB2 catalog
records are to be ignored when objects are compared.

Objects are compared when you analyze a change or you explicitly use DB2 Object
Comparison Tool to generate a compare job.

Overview of ignores
You can define and manage ignores by using the Change Management panels.

Ignores that are specified when analyzing a change must be defined in the Change
Management database, where the ignore is stored in a table. Ignores that you
specify when you explicitly use DB2 Object Comparison Tool to generate a
compare job can be either in the Change Management database or in a data set.

The purpose of ignoring fields is to:


v Avoid comparisons that are meaningless
Timestamps and statistical information are examples of this type of information.
These types of ignore fields are called system ignores and are automatically
included by default.
v Protect specified fields against updates
Examples of fields that you might want to ignore are fields that contain space
information because production tables and indexes are often larger than the
corresponding test tables and indexes. You might also want to ignore fields that
contain buffer pool names because a broader set of pools might be implemented
in the production system.

No field in a DB2 catalog record for which an ignore is specified is compared. If


you must re-create an object because of other changes, values for ignored fields are
taken from the target version. All other fields have values taken from the source
version.

Some catalog fields are automatically ignored, such as statistics, dates, and internal
identifiers. As mentioned previously, these fields are called system ignores.

482 User's Guide and Reference


Use caution when specifying ignore fields. If possible, use the generic
specifications, which provide for some common sets of fields that are often
intentionally different on source and target systems.

Because many fields in the DB2 catalog records are interdependent, when one field
is ignored, the value in another field might be invalid if that field is not ignored
also, for example, the TYPE fields for tables and table spaces. If TYPE is ignored
for table spaces, a table space could keep the LARGE (TYPE) attribute. If the
compare source is a segmented table space, the resulting set of attributes will be
invalid if the SEGSIZE field is not ignored also.

Another type of dependency is between the SQTY and SECQTYI fields on


SYSTABLEPART and SYSINDEXPART that are updated by DB2. If secondary
quantity is to be ignored, specify both fields or use the generic SPACE
specification.

Tip: Consider managing all your ignores through Change Management. The
ignores are easy to track and recover because they are stored in the Change
Management database.

Ignore fields

Only certain fields in certain DB2 catalog tables can be ignored.

The following table shows the DB2 catalog tables and the ignore fields that you
can specify.
Table 22. The DB2 catalog table ignore fields
DB2 catalog table Ignore fields
SYSCHECKS CREATOR, CHECKCONDITION
SYSCOLUMNS COLTYPE, LENGTH, SCALE, NULLS, REMARKS, DEFAULT,
KEYSEQ, FOREIGNKEY, FLDPROC, LABEL, DEFAULTVALUE,
LENGTH2, TYPESCHEMA, TYPENAME, STATS_FORMAT,
PARTKEY_COLSEQ, PARTKEY_ORDERING, ALTEREDTS
SYSDATABASE CREATOR, STGROUP, BPOOL, ROSHARE, TYPE, GROUP_MEMBER,
ENCODING_SCHEME, SBCS_CCSID, DBCS_CCSID, MIXED_CCSID,
INDEXBP
SYSDATATYPES OWNER, SOURCESCHEMA, SOURCETYPE, METATYPE, LENGTH,
SCALE, SUBTYPE, ENCODING_SCHEME, REMARKS
SYSFIELDS FLDPROC, WORKAREA, EXITPARML, PARMLIST, EXITPARM
SYSINDEXES UNIQUERULE, CLUSTERING, BPOOL, PGSIZE, ERASERULE,
DSETPASS, CLOSERULE, INDEXTYPE, PIECESIZE, COPY, SPACEF,
REMARKS, PADDED, VERSION, OLDEST_VERSION,
CURRENT_VERSION, RELCREATED, AVGKEYLEN
SYSINDEXPART PARTITION, PQTY, SQTY, STORTYPE, STORNAME, VCATNAME,
LIMITKEY, FREEPAGE, PCTFREE, INDEXTYPE, GBPCACHE,
SECQTYI, SPACEF, DSNUM, EXTENTS, PSEUDO_DEL_ENTRIES,
LEAFNEAR, LEAFFAR
SYSSYSKEYS COLSEQ, ORDERING
SYSPARMS OWNER, SPECIFICNAME, CAST_FUNCTION, PARMNAME,
ROWTYPE, ORDINAL, TYPESCHEMA, TYPENAME, LOCATOR,
TABLE, TABLE_COLNO, LENGTH, SCALE, SUBTYPE, CCSID,
ENCODING_SCHEME

Chapter 20. Managing changes to DB2 objects 483


Table 22. The DB2 catalog table ignore fields (continued)
DB2 catalog table Ignore fields
SYSRELS RELNAME, DELETERULE, IXOWNER, IXNAME, ENFORCED,
CHECKEXISTINGDATA
SYSROUTINES OWNER, CREATEDBY, SPECIFICNAME, RETURN_TYPE, ORIGIN,
FUNCTION_TYPE, PARM_COUNT, LANGUAGE, COLLID,
SOURCESCHEMA, SOURCESPECIFIC, DETERMINISTIC,
EXTERNAL_ACTION, NULL_CALL, CAST_FUNCTION,
SCRATCHPAD, SCRATCHPAD_LENGTH, FINAL_CALL
SYSSEQUENCES OWNER, SEQTYPE, INCREMENT, START, MAXVALUE, MINVALUE,
CYCLE, CACHE, ORDER, REMARKS, PRECISION, RESTARTWITH
SYSTABLEPART IXNAME, IXCREATOR, PQTY, SQTY, STORTYPE, STORNAME,
VCATNAME, LIMITKEY, FREEPAGE, PCTFREE, COMPRESS,
GBPCACHE, TRACKMOD, SECQTYI, SPACEF, DSNUM, EXTENTS,
LOGICAL_PART
SYSTABLES TYPE, DBNAME, TSNAME, EDPROC, VALPROC, CLUSTERTYPE,
REMARKS, KEYCOLUMNS, STATUS, LABEL, AUDITING,
CREATEDBY, LOCATION, TBCREATOR, TBNAME, DATACAPTURE,
CHECKS, ENCODING_SCHEME
SYSTABLESPACES CREATOR, BPOOL, PARTITIONS, LOCKRULE, PGSIZE,
ERASERULE, STATUS, IMPLICIT, DSETPASS, CLOSERULE, SEGSIZE,
LOCKMAX, TYPE, ENCODING_SCHEME, SBCS_CCSID,
DBCS_CCSID, MIXED_CCSID, MAXROWS
SYSTRIGGER OWNER, TRIGTIME, TRIGEVENT, GRANULARITY, TEXT,
REMARKS, TRIGNAME
SYSVIEWS CHECK, TEXT, PATHSCHEMAS, RELCREATED, TYPE, REFRESH,
ENABLE, MAINTENANCE, REFRESH_TIME, ISOLATION,
SIGNATURE, APP_ENCODING_CCSID

When you specify ignore fields for SYSCOLUMNS, consider the following
information:
v The fields COLTYPE, LENGTH, SCALE, DEFAULT, and DEFAULTVALUE are all
part of the column type definition. The NULLS field is also related because in
some cases it is part of the default specification.
v The DEFAULT field can have a relationship to a SYSSEQUENCES row. Ignoring
the DEFAULT field can cause the SYSSEQUENCES row to be included or
excluded, depending on the value of the DEFAULT field in the target
SYSCOLUMNS row. However, to ignore fields in the SYSSEQUENCES row, you
must explicitly select them.
v The FOREIGNKEY field specifies the subtype of a character type column.
Ignoring the FOREIGNKEY field not only removes the check for SBCS and
MIXED data, but also the FOR BIT DATA specification (that is, CCSID
conversions will occur, if applicable).
v The FLDPROC field can have a relationship to a SYSFIELDS catalog row.
Ignoring the FLDPROC field can cause the SYSFIELDS row to be included or
excluded, depending on the value of FLDPROC in the target SYSCOLUMNS
row. However, to ignore fields in the SYSFIELDS row, you must explicitly select
them.

Important: Be careful when you choose to ignore some, but not all, of the fields
that are part of a column definition. Otherwise, it is possible that
inconsistent attributes and, subsequently, invalid DDL will result.

484 User's Guide and Reference


Generic ignore fields

Generic ignore field specifications provide a shortcut for ignoring all buffer pools,
allocated space information, and information about how data is stored and
partitioned. The generic ignore specifications are:
v BUFFERPOOL
v SPACE
v STORAGE
v PARTITIONING

Specifying a generic ignore specification has the same effect as specifying the
ignore fields individually. The following table shows which catalog fields are
ignored when the generic ignore specification is selected.
Table 23. Generic ignore specifications
Generic ignore
specification DB2 catalog table Ignore fields
BUFFERPOOL SYSDATABASE BPOOL, INDEXBP
SYSINDEXES BPOOL
SYSTABLESPACE BPOOL
SPACE SYSINDEXPART PQTY, SQTY, FREEPAGE, PCTFREE,
SECQTYI
SYSTABLEPART PQTY, SQTY, FREEPAGE, PCTFREE,
SECQTYI
SYSTABLESPACE MAXROWS
STORAGE SYSDATABASE STGROUP
SYSINDEXPART STORTYPE, STORNAME, VCATNAME
SYSTABLEPART STORTYPE, STORNAME, VCATNAME
SYSSTOGROUP VCATNAME
PARTITIONING SYSINDEXPART PARTITION
SYSTABLEPART PARTITION
SYSTABLESPACE PARTITIONS
SYSINDEXPART LIMITKEY
| SYSTABLEPART LIMITKEY
| SYSTABLEPART LIMITKEY_INTERNAL
| SYSTABLEPART LOGICAL_PART
| SYSTABLES PARTKEYCOLNUM
| SYSCOLUMNS PARTKEY_COLSEQ
| SYSCOLUMNS PARTKEY_ORDERING
| SYSAUXRELS PARTITION

The Manage Ignores panel

The Manage Ignores panel is the main menu for working with ignores.

The following figure shows the Manage Ignores panel:

Chapter 20. Managing changes to DB2 objects 485


DB2 Admin ------------------- CM - Manage Ignores ----------------------- 20:10
Option ===>

1 - Display ignores DB2 System: DB2X


2 - Create an ignore DB2 SQL ID: ISTJE

Enter display selection criteria (Using a LIKE operator, criteria not saved):
Name . . . . . . . > Created by . . >
Owner . . . . . . > Altered by . . >
Created within . . Ignore ID . .
Altered within . .

Figure 349. Manage Ignores panel (ADB2C3)

From the Manage Ignores panel, you can display the existing ignores to work with
them or create a new ignore.
Related tasks
“Creating an ignore” on page 487
“Editing an ignore” on page 488

Displaying the ignores


You can display the ignores that are stored in the Change Management database.

To display the ignores:


1. Select option 3 on the Change Management (CM) panel to display the Manage
Ignores panel.
2. Optional: Use the fields at bottom of the panel to enter the search criteria to
filter or limit the ignores that are displayed.
3. Select option 1 on the Manage Ignores panel to display the Ignores panel, as
shown in the following figure:

DB2 Admin ------------------ CM - Ignores -----------------– Row 1 to 8 of 33


Command ===> Scroll ===> PAGE

Line commands:
U - Update DEL - Delete INS - Insert IL - Ignore lines CH - Changes
I - Details on ignore

Sel ID Owner Name Comment


* * * *
--- ----------- -------> -----------------> ----------------------------------
1 J148286 HRIGNORE_BUFFER IGNORE BUFFERPOOL FOR HR
2 JOHNSON EMPIGNORE1 TEST IGNORE1 FOR EMP TABLE
21 JOHNSON EMPIGNORE2 TEST IGNORE2 FOR EMP TABLE
41 J148286 DEVTS IGNORE PARTITIONING
47 J148286 HRIGNORE_VCAT IGNORE VCAT FOR HR
48 J148286 DEVSYS1
49 KINCAID TESTSYS1 IGNORE SPACE
50 KINCAID TESTSYS2 IGNORE SPACE

Figure 350. Ignores panel (ADB2C31)

486 User's Guide and Reference


You can issue a variety of line commands for each ignore that is displayed on the
Ignores panel. Commands are available to:
v See the definition of the ignore and modify it
v View details about who created the ignore and when and who altered it last
v See which changes use the ignore
v Insert, delete, or update a ignore

Ignores that have been created in an explicitly named data set outside of Change
Management on the Specify Ignore Fields panel (GOC4) in DB2 Object Comparison
Tool are not displayed because they are not stored in the Change Management
database.

Creating an ignore
You can create an ignore that is stored in the Change Management database.

To create an ignore:
1. Select option 3 on the Change Management (CM) panel to display the Manage
Ignores panel.
2. Select option 2 on the Manage Ignores panel to display the Insert Ignore panel.
3. Specify an owner and a name for the ignore, and optionally enter a comment
for the ignore.
4. Press F3 to return to the Manage Ignores panel.
5. Select option 1 to display the ignores on the Ignores panel.
6. Issue the IL line command for the ignore that you just created to define the
ignore fields. The Specify Ignore Fields: Objects panel is displayed, as shown in
the following figure. The panel shows the DB2 catalog tables for which you can
define ignore fields.

---------------- Specify Ignore Fields: Objects ----------- Row 1 to 18 of 18


Command ===> Scroll ===> PAGE

Valid line commands are:


U - Update Ignore Fields

Select Object Ignore Fields


* *
------ --------------- --------------------------------------------------------
GENERIC None
SYSCHECKS None
SYSCOLUMNS None
SYSDATABASE None
SYSDATATYPES None
SYSFIELDS None
SYSINDEXES None
SYSINDEXPART None
SYSKEYS None
SYSPARMS None
SYSRELS None
SYSROUTINES None
SYSSEQUENCES None
SYSTABLEPART None
SYSTABLES None
SYSTABLESPACE None
SYSTRIGGERS None
SYSVIEWS None

Figure 351. Specify Ignore Fields: Objects panel (GOCCI)

7. For each table, use the U line command to display the catalog field columns
that can be ignored.

Chapter 20. Managing changes to DB2 objects 487


8. On the Select Ignore Fields panel for the table, use the U and S line commands
to select or de-select a particular field to be ignored.
9. Press F3 to return to the list of DB2 catalog tables (the Specify Ignore Fields:
Objects panel). Pressing F3 repeatedly returns you through the panels to the
main menu.
Related concepts
“Overview of ignores” on page 482

Storing an ignore in the Change Management database


If you are using DB2 Object Comparison Tool and choose option 4 on the DB2
Object Comparison Tool Menu to specify the fields to ignore, you can specify that
the ignore that is created be stored in the Change Management database instead of
a data set. To have the ignore stored in the Change Management database,
complete the following steps:
1. Select option 4 on the DB2 Object Comparison Tool Menu to display the
Specify Compare Ignore Fields panel.
2. As shown in the following figure, specify an owner and a name for the ignore,
do not specify a data set name, and specify YES in the Edit Ignores field.

Compare ----------------- Specify Compare Ignore Fields ----------------------


Option ===>

Ignore Table Entry:

Owner . . MYID > (? to look up)


Name . . MYIGNORE > (? to look up)
Data Set:
Data Set Name . .
Options:
Edit Ignores . . YES (Yes/No)

Figure 352. Specify Compare Ignore Fields panel (GOC4)

3. For each table that is displayed on the Specify Ignore Fields: Objects panel, use
the U line command to display the catalog field columns that can be ignored.
4. On the Select Ignore Fields panel for the table, use the U and S line commands
to select or de-select a particular field to be ignored.
5. Press F3 to return to the list of DB2 catalog tables (the Specify Ignore Fields:
Objects panel). Pressing F3 again returns you to the DB2 Object Comparison
Tool Menu panel.

Editing an ignore
You can add and delete fields from an existing ignore.

To edit an ignore that is stored in the Change Management database:


1. Select option 3 on the Change Management (CM) panel to display the Manage
Ignores panel.
2. Select option 1 on the Manage Ignores panel to display the Ignores panel.
3. Issue the IL line command for the ignore that you want to edit. A list of DB2
catalog tables is displayed, and the columns that are currently selected as
ignore fields are shown on the Specify Ignore Fields: Objects panel. In the
example that is shown in the following figure, the CREATOR, STGROUP,
BPOOL, and INDEXPB fields in SYSDATABASE and BPOOL fields in the

488 User's Guide and Reference


SYSINDEXES and SYSTABLESPACES tables are to be ignored:

---------------- Specify Ignore Fields: Objects ----------- Row 1 to 18 of 18


Command ===> Scroll ===> PAGE

Valid line commands are:


U - Update Ignore Fields

Select Object Ignore Fields


* *
------ --------------- -------------------------------------------------------
GENERIC None
SYSCHECKS None
SYSCOLUMNS None
SYSDATABASE STGROUP,BPOOL,INDEXBP
SYSDATATYPES None
SYSFIELDS None
SYSINDEXES BPOOL
SYSINDEXPART None
SYSKEYS None
SYSPARMS None
SYSRELS None
SYSROUTINES None
SYSSEQUENCES None
SYSTABLEPART None
SYSTABLES None
SYSTABLESPACE BPOOL
SYSTRIGGERS None
SYSVIEWS None

Figure 353. Example of the definition of an ignore

4. Use the U line command to display the ignore fields for a particular DB2
catalog table.
5. On the Select Ignore Fields panel for the table, use the U and S line commands
to select or de-select a particular field to be ignored.
6. Press F3 to return to the list of DB2 catalog tables (the Specify Ignore Fields:
Objects panel). Pressing F3 repeatedly returns you through the panels to the
main menu.
Related concepts
“Overview of ignores” on page 482

Deleting an ignore
You can delete an ignore that is stored in the Change Management database.

To delete an ignore:
1. Select option 3 on the Change Management (CM) panel to display the Manage
Ignores panel.
2. Select option 1 on the Manage Ignores panel to display the Ignores panel.
3. Issue the DEL line command for the ignore that you want to delete.

Versions
| A version is a snapshot of the definitions of a set of objects at a point in time.

The object definitions typically represent an application or application area.

Chapter 20. Managing changes to DB2 objects 489


Versions enable you to track the changes to a set of objects, restore objects to a
previous version if you need to fall back, and promote changes from one system to
another.

| Versions can be created in one of three ways:


| v When using Change Management, you can define a version scope (the objects to
| be included in a version) and then use the GV line command on the Version
| Scopes (ADB2C42) to generate a version based on that scope.
| v When you run a change using Change Management, you can specify to have a
| version of the objects generated after the changes have been applied.
| v When you use DB2 Object Comparison Tool, you can have versions of the source
| and target objects generated. When Change Management is enabled, you have
| the option of storing versions in data sets or in the Change Management
| database.

| Tip: Consider storing all of your versions in the Change Management database,
| which makes them easier to track, access, and recover.

| When you promote a set of changes from one system to another, you need two
| versions. The starting version represents the state of objects before any changes are
| made and the ending version represents the state of objects after the promoted
| changes are made. During the promote process, DB2 Admin compares the ending
| version with the starting version and generates a delta changes data set the
| contains the SQL statements that are required to bring the other system up to the
| same level as the system from which your promoting the changes. You can then
| import the delta changes data set into a new change on the system to which you
| are promoting the changes, analyze the change, and run them.

| When you implement them carefully, you can also use versions as the base version
| for subsequent changes to a set of objects. When you analyze a change, DB2
| Admin needs a base set of definitions for the change for the analyze process. DB2
| Admin either extracts the object definitions from the catalog to use as the base
| version, which can be time consuming, or uses an existing version as the base
| version. You can specify that DB2 Admin uses an existing version when there are
| no prerequisite changes for the objects.

The CM - Manage Versions panel, which is shown in the following figure, is the
main panel for managing versions:

490 User's Guide and Reference


| DB2 Admin ------------------- CM - Manage Versions ---------------------- 16:59
| Option ===>
|
|
| 1 - Display versions DB2 System: DB2X
| 2 - Display version scopes DB2 SQL ID: ISTJE
| 3 - Insert a version scope
| 4 - Import version file
|
|
|
|
|
|
|
|
|
| Enter display selection criteria (Using a LIKE operator, criteria not saved):
| Name . . . . . . . > Created by . . >
| Owner . . . . . . > Altered by . . >
| Created within . . Version ID . .
| Altered within . .
||
| Figure 354. Manage Versions panel (ADB2C4)
|
| Versions that have been generated in explicitly named data sets when you use DB2
| Object Comparison Tool are not displayed because they are not stored in the
| Change Management database. When you use DB2 Object Comparison Tool and
| Change Management is enabled, you have the option of storing versions in data
| sets or in the Change Management database.
Related tasks
“Promoting changes” on page 472

Displaying the versions


You can display the versions that are stored in the Change Management database.

To display the versions:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Optional: Use the fields at bottom of the panel to enter the search criteria to
filter or limit the versions that are displayed.
3. Select option 1 to display the Versions panel. The following figure shows an
example of the Versions panel. Notice that the T column indicates whether the
version is a base or delta version.

Chapter 20. Managing changes to DB2 objects 491


DB2 Admin ------------------ CM - Versions ---------------- Row 1 to 8 of 64
Command ===> Scroll ===> PAGE

Line commands:
CH - Changes PR - Promote VS - Version scope DEL - Delete U - Update
PT - Toggle protected status I - Details on version

Sel ID T Owner Name Comment


* * * * *
--- ----------- - -------- -----------------> -------------------------------
290 B JOHNSON HR_VER1
291 D JOHNSON ALC_ADD_COLUMN_AT_
292 D KINCAID CREATE_TB_TBTC
394 B JOHNSON HR_VER2
295 D JOHNSON ALC_MOD_TBTC
305 B JOHNSON HR_VER3
334 D KINCAID CREATE_TS_TSS1
335 D KINCAID CREATE_TS_TSS2

Figure 355. Versions panel (ADB2C41)

You can issue a variety of line commands on the Versions panel for each version.
Commands are available to:
v See the changes that are associated with the version
v Promote the version
v See which scopes are associated with the version
v Set the protected status for the version
v Delete or update a version
v View details about the version

| Versions that have been generated in explicitly named data sets when you use DB2
| Object Comparison Tool are not displayed because they are not stored in the
| Change Management database. When you use DB2 Object Comparison Tool and
| Change Management is enabled, you have the option of storing versions in data
| sets or in the Change Management database.

Creating a version from a version scope


You can create a version that is stored in the Change Management database from a
version scope.

To create a version from a version scope:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Select option 2 to display the Version Scopes panel, as shown in the following
figure:

492 User's Guide and Reference


DB2 Admin --------------- CM - Version Scopes ---------------- Row 1 to 1 of 1
Command ===> Scroll ===> PAGE

Line commands:
VE - Versions SO - Version scope objects GV - Generate new version file
INS - Insert U - Update DEL - Delete I - Details on version scope

Sel ID Owner Name Comment


* * * *
--- ----------- -------- ------------------ ----------------------------------
1 JOHNSON HR_SCOPE Scope for HR database
2 JOHNSON PAYROLL_SCOPE Scope for payroll application
8 KINCAID MANU_SCOPE Scope for manufacturing database
******************************* END OF DB2 DATA *******************************

Figure 356. Version Scopes panel (ADB2C42)

3. Specify the GV line command for the version scope for which you want to
generate a version.
4. Specify an owner and name for the new version on the pop-up panel that is
displayed. The JCL to create the version is displayed.
5. Review and submit the job to create the new version.

Creating a version when running a change


When you run a change, you can specify to have a version of the objects generated
after the changes have been applied.

To create a version when you run a change:


1. Before you run the change, ensure that an appropriate version scope for the
version to be created exists.
2. When you issue the RN line command to run the change, specify the
appropriate information on the Run a Change panel:
v YES in the Create a new base version field.
v The owner and name of the version scope. (You must identify an existing
version scope.)
v The owner and name of the base version. (If you specify the name of an
existing base version, that base version will be over written.)

| Regenerating Change Management versions containing LOBs


| A new version of the records layout is created if LOB objects are involved in a
| change management job.

| This layout is not compatible with previous versions containing LOBs. Therefore,
| you must regenerate older versions that contain LOB columns. You can identify
| which change management base versions are affected by using this query:
| SELECT OWNER,NAME,TYPE
| FROM ADB.ADBCVERSION V
| WHERE TYPE='B'
| AND EXISTS(
| SELECT VERSIONID
| FROM ADB.ADBCVERLINES VL
| WHERE V.VERSIONID=VL.VERSIONID
| AND VL.PREFIXGROUP=52)

| You can identify the active CM changes that are affected by using this query:

Chapter 20. Managing changes to DB2 objects 493


| SELECT C.OWNER,C.NAME,C.STATUS
| FROM ADB.ADBCVERSION V,ADB.ADBCHG C
| WHERE C.STATUS NOT IN ('COMPLETE','CANCELLED')
| AND V.TYPE='D'
| AND C.DELTAVERID =V.VERSIONID
| AND EXISTS(
| SELECT VERSIONID
| FROM ADB.ADBCVERLINES VL
| WHERE V.VERSIONID=VL.VERSIONID
| AND C.DELTAVERID=VL.VERSIONID
| AND VL.PREFIXGROUP=52)

| To regenerate change management versions:


| 1. Use the RST line command to restart INITIAL changes.
| 2. Make sure that RUNNING changes are completed.
| 3. Use the ST line command for all of the other changes that are listed and edit
| and SAVE one statement (without making any changes). The change is put into
| defined status and the change can be handled as usual.

Deleting a version
You cannot delete delta versions but you can delete base versions.

To delete a base version:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Select option 1 to display the Versions panel.
3. Issue the DEL line command for the version that you want to delete.
4. If you receive a message that indicates that the version is protected, issue the
PT line command to remove the protected status and issue the DEL line
command again. Delete the version only if you know that it is no longer
needed.

Version scopes
A version scope defines the set of objects to include in the processing of a version.

A version scope determines the objects that are included in a version.

A version scope can be any set of objects, such as one or more databases, or a
group of table spaces. Typically, you want to define scopes that identify all of the
objects for an application or application area. For example, the scope for a human
resources application should contain all the human resource databases.

After you create a version scope, you can create a base version for that set of
objects.

A version scope must exist if you plan to create a new base version when you
apply changes. If you have a new base version created when you run a change to
reflect the object definitions after the changes, you must specify the version scope
for the version.

Maintaining a version scope is a manual process, and you should ensure that the
definition of the scope always includes all of the objects that you intend. For
example, assume that you defined version scope SCOPE1 to include databases
DB01 and DB02 and then created version BASE1. Later, you run CHANGE1, which

494 User's Guide and Reference


creates a table in DB01 and creates a new database DB03, specifying to create a
new base version BASE1 using SCOPE1. Database DB03 is not automatically added
to SCOPE1.

The Manage Versions panel, which is shown in the following figure, is the main
panel for working with version scopes:

| DB2 Admin ------------------- CM - Manage Versions ---------------------- 16:59


| Option ===>
|
|
| 1 - Display versions DB2 System: DB2X
| 2 - Display version scopes DB2 SQL ID: ISTJE
| 3 - Insert a version scope
| 4 - Import version file
|
|
|
|
|
|
|
|
|
| Enter display selection criteria (Using a LIKE operator, criteria not saved):
| Name . . . . . . . > Created by . . >
| Owner . . . . . . > Altered by . . >
| Created within . . Version ID . .
| Altered within . .
||
| Figure 357. Manage Versions panel (ADB2C4)
|
From the Manage Versions panel, you can display the existing version scopes to
work with them or create a new version scope.

Displaying the version scopes


You can display the version scopes that are stored in the Change Management
database.

To display the version scopes:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Select option 2 to display the Version Scopes panel. The following figure shows
an example of the Version Scopes panel:

DB2 Admin --------------- CM - Version Scopes ---------------- Row 1 to 1 of 1


Command ===> Scroll ===> PAGE

Line commands:
VE - Versions SO - Version scope objects GV - Generate new version file
INS - Insert U - Update DEL - Delete I - Details on version scope

Sel ID Owner Name Comment


* * * *
--- ----------- -------- ------------------ ----------------------------------
1 DBAUSER1 HR_SCOPE Scope for HR database
2 DBAUSER1 PAYROLL_SCOPE Scope for payroll application
8 DBAUSER3 MANU_SCOPE Scope for manufacturing database
******************************* END OF DB2 DATA *******************************

Figure 358. Versions Scopes panel (ADB2C42)

Chapter 20. Managing changes to DB2 objects 495


You can issue a variety of line commands on the Version Scopes panel for each
version scope. Commands are available to:
v See which versions use the scope
v See which objects are in the scope
v Generate a new base version for the scope
v Insert, delete, or update a scope
v View details about who created the scope and when and who altered it last

Creating a version scope


You can create a version scope.

To create a version scope:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Select option 3 on the Manage Versions panel to display the Insert Version
Scope panel.
3. Specify a name and owner for the version scope, and, optionally, enter a
comment for the version scope.
4. Press F3 to return to the Manage Versions panel.
5. Select option 2 to display the Version Scopes panel.
6. Specify the SO line command for the version scope that you created. The
Version Scope Objects panel is displayed, as shown in the following figure:

DB2 Admin ----------- CM - Version Scope Objects ------------- Row 1 to 1 of 1


Command ===> Scroll ===> PAGE

Version scope objects for scope "DBAUSER2"."NEWSCOPE"


Commands: SAVE
Line commands:
I - Insert D - Delete R - Repeat

Sel T Qual Name Oper.


* * * *
--- -- -------> -----------------> ------

? ? ?
******************************* END OF DB2 DATA *******************************

Figure 359. Version Scope Objects panel (ADB2C4O)

7. Use the I line command to add each object that you want in the version scope,
and specify the type of object, a qualifier, and a name for the object. You can
also use the D line command to delete objects from the scope definition, and
you can use the R line command to repeat a line to make it faster to define the
objects in the scope.
| The values for the qualifier and name can contain zero or more of the following
| wildcard characters:
| v Minus sign (-) represents any single character.
| v Percent sign (%) or asterisk (*) represents one or more characters.
| v Any other character represents a single occurrence of itself.
| The rules for the wildcard characters follow the rules that are used for the LIKE
| predicate.
See the online help for the Version Scope Objects panel for a description of the
input fields, which includes a list of the types of objects that you can add.
| The following figure shows an example of a version scope definition.

496 User's Guide and Reference


DB2 Admin ----------- CM - Version Scope Objects ------------- Row 1 to 6 of 6
Command ===> Scroll ===> PAGE

Version scope objects for scope "DBAUSER2"."NEWSCOPE"


Commands: SAVE
Line commands:
I - Insert D - Delete R - Repeat

Sel T Qual Name Oper.


* * * *
--- -- -------> -----------------> ------

DB DBADB001
TS DBADB002 TSAB%

Figure 360. Example of a version scope definition

8. Issue the SAVE primary command to save the definition of the scope.
Related information
IBM Publications Center

Importing a version file


You can import a version file to the change management database.

To import a version scope:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Select option 4 to display the Import Version File panel.
3. You can specify the following options on the panel:
v Version File DSN: The data set name in which the version file to be
imported is contained. The data set can be a stand-alone data set or a PDS
with a member
v Owner: The owner of the version to be added to the change management
database
v Name: The name of the version to be added to the change management
database.
v Execution Mode: Determines whether to import the version in the
foreground (TSO) or in the background (batch).

ADB2C44 n ---------------- Import Version File --------------- 08:05

Enter/verify the following:


Version File DSN . . . . . . .
Owner. . . . . . . . . . . . . > (? to look up)
Name . . . . . . . . . . . . . > (? to look up)
Execution Mode . . . . . . . . Batch or TSO)

Figure 361. Example of importing a version file

Editing a version scope


You can add or delete objects from an existing scope.

To edit a version scope:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Select option 2 to display the Version Scopes panel.

Chapter 20. Managing changes to DB2 objects 497


3. Specify the SO line command for the version scope that you want to edit. The
Version Scope Object panels, which shows the objects in the current definition,
is displayed:

DB2 Admin ----------- CM - Version Scope Objects ------------- Row 1 to 6 of 6


Command ===> Scroll ===> PAGE

Version scope objects for scope "DBAUSER1"."PAYROLL_SCOPE"


Commands: SAVE
Line commands:
I - Insert D - Delete R - Repeat

Sel T Qual Name Oper.


* * * *
--- -- -------> -----------------> ------

TB DBAUSER1 EMPLOYEE
TB DBAUSER1 TIMECARDS
FU VNDH01 FEDVALUES

Figure 362. Example of editing a version scope definition

4. Use the I and D line commands to insert or delete an object in the definition.
Ensure that a type, a qualifier, and a name are specified for each object. You
can also use the R line command to repeat a line to make it faster to define the
objects in the scope.
See the online help for the Version Scope Objects panel for a description of the
input fields, which includes a list of the types of objects that you can add.
5. Issue the SAVE primary command to save the definition of the scope.

Deleting a version scope


You can delete a version scope.

To delete a version scope:


1. Select option 4 on the Change Management (CM) panel to display the Manage
Versions panel.
2. Select option 2 to display the Version Scopes panel.
3. Issue the DEL line command for the version scope that you want to delete.

Tracking changes and changed objects


You can use the reporting feature in Change Management to display changes and
changed objects and to check the history of changes.

You can use either the Changes panel or the Report Changes panel to display
changes. The Report Changes panel, as shown in the following figure, is the main
panel for displaying changed objects.

498 User's Guide and Reference


DB2 Admin ------------------- CM - Report Changes ----------------------- 20:41
Option ===>

1 - Display changes DB2 System: DB2X


2 - Display changed objects DB2 SQL ID: ISTJE

Enter display selection criteria (Using a LIKE operator, criteria not saved):
Name . . . . . . . > Created by . . . . >
Owner . . . . . . > Altered by . . . . >
Type . . . . . . . Status . . . . . .
Created before . . Altered before . .
Created after . . Altered after . .

Figure 363. Report Changes panel (ADB2C6)

Displaying changes
You can display the changes that are stored in the Change Management database.

To display the Changes panel, which lists the changes:

Select which method you want to use to display the Changes panel.
v Select option 1 on the Change Management (CM) panel to display the Manage
Changes panel, and then select option 1.
v Select option 4 on the Change Management (CM) panel to display the Report
Changes panel, and then select option 1.
When you use either action, you can specify search criteria to filter or limit the
changes that are displayed, such as searching for changes by owner or status or
searching for changes that were created or altered before or after a certain date. For
example, to display all the changes that need to be analyzed, specify DEFINED in
the Status field. See the online help for a description of the search fields.
The following figure shows an example of the Changes panel:

Chapter 20. Managing changes to DB2 objects 499


DB2 Admin ------------------ CM - Changes ----------------- Row 14 to 26 of 44
Command ===> Scroll ===> PAGE

Line commands:
U - Update AN - Analyze RN - Run VE - Versions ST - Statements
PQ - Prerequisites IG - Ignores MA - Masks
? - Show all line commands

Sel ID Owner Name Type Status Comment


* * * * * *
--- -------- -------- ------------------ ------- -------- -------------------->
144 JOHNSON EMP_CH1 CHANGE DEFINED INCREASE THE LENGTH O
145 JOHNSON CRE_TAB CHANGE DEFINED HERE'S A NEW TABLE FO
146 JOHNSON EMP_CH2 FAST FAILED
147 JOHNSON EMP_CH3 FAST COMPLETE
148 JOHNSON APP_CH1 CHANGE COMPLETE ADD NEW TABLE
161 VIJAYAK IMP COMPARE DEFINED
162 VIJAYAK IMP1 COMPARE DEFINED
163 VIJAYAK IMPX COMPARE DEFINED
164 VIJAYAK IMPN COMPARE DEFINED
181 JOHNSON EMP_CH4 CHANGE INITIAL INCREASE LASTNAME TO
201 JOHNSON HRDB1 CHANGE ANALYZED CREATE DATABASE
202 JOHNSON HRTS1 CHANGE DEFINED CREATE TABLESPACE IN
203 JOHNSON SEPTDB CHANGE ANALYZED CREATE DATABASE FOR S

Figure 364. Changes panel (ADB2C11)

You can issue a variety of line commands on the Changes panel for each change.
Enter the ? line command to see a list of the available line commands. For
example, commands are available to:
v See the statements for a change
v See the prerequisites for a change.
v Analyze a change.
v Run a change.
v See the recover change for a change
v Recover a change

Displaying changed objects


You can display a list of objects that have changes.

The changes can be in any status and might not be complete.

To display changed objects:


1. Select option 6 on the Change Management (CM) panel to display the Report
Changes panel.
2. Optional: Use the fields at the bottom of the panel to specify the search criteria
to filter or limit the objects that are displayed. For example, you can specify TB
in the Type field to display only the tables that have changes. See the online
help for a description of the search fields.
3. Select option 2 to display the Changed Objects panel. The following figure
shows an example of the Changed Objects panel:

500 User's Guide and Reference


DB2 Admin -------------- CM - Changed Objects -------------- Row 1 to 13 of 14
Command ===> Scroll ===> PAGE

Line commands:
ST - Statements CH - Change CHA - All Changes CHC - Completed Changes
CHN - Not Completed Changes

Change Change Change Object Object


Sel Sequence Owner Name O QualifierName
* * * * * *
--- ----------- -------- ----------------- -- ---------------------------
1 JOHNSON EMP_CH1 TB DSNDV1DB EMP
1 JOHNSON EMP_CH2 TB DSNDV1DB EMP
1 JOHNSON DEPT_CH1 IX DSNDV1DB DEPTNOIX
1 JOHNSON DEPT_CH2 TB DSNDV1DB DEPT
1 VNDH01 ACT_CH1 TS DSNDB04 ACT
1 VNDH01 CRE_PTDB01 DB PTDB01
1 VNDH01 CRE_PTTS01 TS PTDB01 PTTS01
1 VNDH01 CRE_EMPTB TB TONELLO PTTB01
1 VNDH01 REC_CRE_PTDB01 DB PTDB01
1 VNDH01 REC_CRE_PTTS01 TS PTDB01 PTTS01
1 VIJAYAK EMP_C1 TB DSNDV2DB EMP
1 VNDH01 ACT_CH2 TB DSNDV1DB ACT
1 JOHNSON ACT_CH3 TB DSNDV1DB ACT

Figure 365. Changed Objects panel (ADB2C62)

4. Optional: Use the line commands to perform various actions on a changed


object. For example, you can display all the completed changes for a particular
object or you can get details on a particular change.

Chapter 20. Managing changes to DB2 objects 501


502 User's Guide and Reference
Chapter 21. Using masks
A mask (also called a translation mask) provides the ability to cause context-sensitive
global changes to naming conventions in generated SQL.

| You can also use masks to overwrite the value of certain table space attributes.

For example, in DB2 Admin, you can specify masks to change names and
qualifiers when you:
v Generate SQL to reverse engineer DB2 objects
v Clone a work statement list (WSL)
v Migrate DB2 object definitions, the data in those objects, or catalog statistics to
other DB2 systems
| v Import changes through Change Management.

| You can define a mask either in a data set, or if Change Management is enabled on
| your system, in a table in the Change Management database. Masks that are
| specified on panels for reverse engineering SQL from the DB2 catalog, cloning
| WSLs, or migrating objects can be defined in a data set or in a table in the Change
| Management database. Masks that are specified when you import changes through
| Change Management must be defined in the Change Management database.

| Tip: Consider managing all your masks through Change Management. The masks
| are easy to manage and recover because they are stored in a table in the
| Change Management database.

Topics:
v “Specifying a mask” on page 504
v “Mask definitions” on page 505
Related tasks
“Generating SQL to re-create a DB2 object” on page 172
“Step 1. Specify the objects to migrate information” on page 293

© Copyright IBM Corp. 1995, 2010 503


Specifying a mask
You can specify a mask when you generate SQL to reverse engineer DB2 objects,
clone a work statement list (WSL), or migrate objects, data, or catalog statistics.

To specify a mask when you generate SQL to reverse engineer DB2 objects, clone a
work statement list (WSL), or migrate objects, data, or catalog statistics:
1. Specify Yes in the Use Masking field on the appropriate panel to display the
Specify Mask panel. The following panels have the Use Masking field:
v Generate SQL from DB2 catalog panel (ADB2GEN)
v Clone Work Statement List panel (ADB2W1Q)
v Migrate Parameters panel (ADB28M)
The following figure shows the Specify Mask panel:

| DB2 Admin ----------------------- Specify Mask ----------------------------


| Option ===>
|
|
| Mask Table Entry:
| Owner . . > (? to look up)
| Name . . > (? to look up)
| Data Set:
| Mask DSN . .
| Options:
| Edit Mask . . (Yes/No)
|
|
| Figure 366. Specify Mask panel (ADB2GENM)
|
The Mask Table Entry fields that allow you to specify an owner and name are
displayed only if Change Management is enabled on your system.
| 2. On the Specify Mask panel, specify the mask to use. Complete one of the
| following steps: To specify a mask that is defined in a data set:
| a. Specify the name of the data set that contains the masks to use. The mask
| data set must contain masks, must adhere to TSO naming conventions, and
| be one of the following types:
| v A fixed-block sequential data set
| v A member of a partitioned data set with a record length of 80
| (RECFM=Fx,LRECL=80)
| If the specified data set name exists, it is reused. Otherwise, it is created.
| b. Specify Yes in the Edit Mask field if you want to edit the mask data set by
| using ISPF edit.
| To specify a mask that is defined in a table in the Change Management
| database:
| a. Specify the owner and the name of the mask in Owner and Name fields.
| b. Specify Yes in the Edit Mask field if you want to change the definition of
| the mask. When you specify Yes, the Mask Lines panel (ADB2C2L) is
| displayed.
| If you prefer to use ISPF edit to specify your edit masks, you can navigate
| to the Masks panel (ADB2C31), which lists the masks, and issue the E line
| command to display the mask definition in the Edit Masks panel.
| If you specify a mask that does not exist and you specify Yes in the Edit
| Mask field, the mask will be created for you in the Change Management
| database.

504 User's Guide and Reference


| If you specify both the owner and name of a mask table entry and a data
| set name, a data set is used.
Related tasks
“Creating a mask” on page 479
“Editing a mask” on page 481
“Importing changes” on page 473

Mask definitions
The mask definition describes how names are to be translated for objects.

| The mask definition describes how names are to be translated for objects. The
| mask definition also lets you overwrite the values of certain table space and index
| space attributes, including COMPRESS, DEFINE, DEFER, DSSIZE, PRIQTY,
| SECQTY, and SEGSIZE. The information in this topic about mask names, the mask
| hierarchy, how masks are applied, and performance is also applicable for masks
| that are defined in the Change Management database.

| When you specify masks, they are processed in the order that you list them.
Related concepts
“Masks” on page 477
Related tasks
“Cloning work statement lists” on page 312
“Creating a mask” on page 479
“Editing a mask” on page 481
“Specifying a REXX user exit for the overwrite value” on page 511

Mask definition syntax


You can specify one or more masks. Mask can contain generic specifications, which
are expressed by using an asterisk.

If you are using a mask data set, to view or edit mask definitions, specify Yes in
the Edit Mask field of the Specify Mask panel. When you press Enter, the mask
definitions are displayed in ISPF Edit. The following figure shows mask definitions
in the Edit Masks panel:

Chapter 21. Using masks 505


| EDIT USER1.MASKS Columns 00001 00072
| Command ===> Scroll ===> PAGE
|
| ****** ***************************** Top of Data ******************************
| ==MSG>
| ==MSG> Mask Syntax:
| ==MSG> field:inmask,outmask
| ==MSG> Fields (hierarchy):
| ==MSG> COLNAME
| ==MSG> NAME
| ==MSG> DBNAME,TSNAME,TBNAME,IXNAME,UDFNAME,
| ==MSG> UDTNAME,COLLNAME,PKGNAME,PGMNAME,PLNNAME
| ==MSG> DBRMNAME,STPNAME,SFNAME,TGNAME,GRPNAME,
| ==MSG> VCATNAME,GBPNAME,TCNAME
| ==MSG> BPNAME
| ==MSG> TSBPNAME,IXBPNAME
| ==MSG> SGNAME
| ==MSG> TSSGNAME,IXSGNAME
| ==MSG> AUTHID
| ==MSG> SQLID,
| ==MSG> SCHEMA
| ==MSG> TBSCHEMA,IXSCHEMA
| ==MSG> OWNER
| ==MSG> DBOWNER,TSOWNER,TBOWNER,IXOWNER
| ==MSG> GRANTID
| ==MSG> GRANTOR, GRANTEE
| ==MSG> ROLE
| ==MSG> DBROLE,TSROLE,TBROLE,IXROLE
| ==MSG> Examples:
| ==MSG> OWNER:ABC*,DEF*
| ==MSG> NAME:PRE*,NPRE*
| ==MSG>
| ==MSG> Overwrite Syntax:
| ==MSG> Field:inmask,Overwrite_value
| ==MSG> Fields: Overwrite values:
| ==MSG> COMPRESS YES,NO, REXX exit
| ==MSG> SEGSIZE n (4-64 must be multiple of 4),REXX exit
| ==MSG> DSSIZE nG,REXX exit
| ==MSG> PRIQTY n,n%,REXX exit (table spaces and indexes)
| ==MSG> TSPRIQTY n,n%,REXX exit (table spaces only)
| ==MSG> IXPRIQTY n,n%,REXX exit (indexes only)
| ==MSG> SECQTY n,n%,REXX exit (table spaces and indexes)
| ==MSG> TSSECQTY n,n%,REXX exit (table spaces only)
| ==MSG> IXSECQTY n,n%,REXX exit (indexes only)
| ==MSG> DEFER YES,NO,REXX exit (indexes only)
| ==MSG> DEFINE YES,NO,REXX exit (table spaces and indexes)
| ==MSG> TSDEFINE YES,NO,REXX exit (table spaces only)
| ==MSG> IXDEFINE YES,NO,REXX exit (indexes only)
| ==MSG> Notes:
| ==MSG> - n is a integer value
| ==MSG> - n% is the integer percentage of the current attribute value
| ==MSG> - REXX exit takes format of REXX(myexit,val1,val2...valn) where
| ==MSG> valn is the name of DB2 catalog field (such as PARTITIONS) or
| ==MSG> a variable with numeric/string value (such as BPOOL= 'BP1').
| ==MSG> + in col 72 indicates continuation of REXX exit on next line
| ==MSG> - To Support/migrate DB2V8 masking input, OWNER,TBOWNER and IXOWNER
| ==MSG> will mask both owner and schema fields. SCHEMA,TBSCHEMA and
| ==MSG> IXSCHEMA will be applied to only schema fields.
| ==MSG> Examples:
| ==MSG> COMPRESS:MYDB*.MYTS*,YES
| ==MSG> SEGSIZE:MYDB*.MYTS*,8
| ==MSG> DSSIZE:MYDB*.MYTS*,4G
| ==MSG> PRIQTY:*.*,REXX(MYPRIQTY,DBNAME='MYDBTEST')
| ==MSG> TSPRIQTY:MYDB*.MYTS*,30
| ==MSG> IXPRIQTY:MYCR*.MYIX*,25%
| ==MSG> IXSECQTY:MYCR*.MYIX*,REXX(MYSECQTY,IXNAME,IXCREATOR,PCT=20%)
| ==MSG> DEFER:USER001.*IXNAME,NO
| ==MSG> DEFINE:DBNAME*.*TSPC,REXX(MYDEFINE,DEFINE='YES')
| ==MSG>
| 000001 owner :TEST1*,TEST2*
| 000002 OWNER :TEST*,TEST1*
| ****** **************************** Bottom of Data ****************************
||
| Figure 367. Edit Masks panel
|
506 User's Guide and Reference
| The message lines on the panel and Table 24 on page 508 list the available mask
| names for changing naming conventions and for overwriting table space and index
| space attribute values.

You can specify one or more masks. Masks can contain generic specifications,
which are expressed by using an asterisk.

| When you specify masks, they are processed in the order that you list them.

The syntax for specifying a mask to change naming conventions is shown in the
following figure:

maskname: inputmask,outputmask

Figure 368. Translation mask syntax

| The maximum length allowed for input masks and output masks is 256 bytes each.
| You use a plus sign (+) in column 72 to indicate continuation onto the next line.

| The syntax for overwriting the value of a table space or index space attribute is
| shown in the following figure:
|
| maskname: inputmask, overwrite_value

| Figure 369. Overwrite syntax

| The inputmask identifies the table space name or index space, and overwrite_value
| identifies the new value to use for the attribute. The value that you can specify for
| overwrite_value depends on the attribute, as shown in Figure 2. The value can be a
| direct value such as the YES or NO, an integer value (n), or an integer percentage
| of the current value (n%). The value can also be a REXX user exit that calculates a
| value. The maximum length allowed for input masks and a direct overwrite value
| is 256 bytes each. The maximum length allowed for specifying a REXX user exit
| and its input variables is 256 bytes. You use a plus sign (+) to indicate the
| continuation of a REXX user exit onto the next line. For more information about
| using a REXX user exit, see “Specifying a REXX user exit for the overwrite value”
| on page 511.

Notice that message lines on the panel show that the mask names have a hierarchy.
For example, to change all DBNAMEs in the form of X* to Y*, specify the
following:

DBNAME: X*,Y*

or

NAME: X*,Y*

However, NAME is a grandparent in the hierarchy and, therefore, more general


than DBNAME, which is a child. Therefore, using the higher-level mask changes
all NAME masks.

Example 1: BPNAME has three levels: TSBPNAME, BPNAME and NAME. So, to
translate a table space buffer pool name (TSBPNAME), you can use

Chapter 21. Using masks 507


either TSBPNAME, BPNAME, or NAME. However, if you use
BPNAME, all names that match the mask (table space and index space
buffer pool) are translated.

Example 2: COLNAME has no levels and does not participate in a hierarchy. To


translate a column name, you must use COLNAME.

| Example 3: TSPRIQTY is second in the hierarchy of PRIQTY and TSPRIQTY.


| TSPRIQTY overwrites the PRIQTY for table spaces only; whereas
| PRIQTY overwrites the PRIQTY for both table spaces and index
| spaces.
Table 24. Translation mask names
Name Parent Grandparent Description
COLNAME Column name
NAME All names listed below
COLLNAME NAME Collection name
DBNAME NAME Database name
DBRMNAME NAME DBRM name
GBPNAME NAME Group buffer pool name
GRPNAME NAME Group name
IXNAME NAME Index name
PGMNAME NAME Program name; synonym for DBRM name
PKGNAME NAME Package name
PLNNAME NAME Plan name
SFNAME NAME Structure facility name
STPNAME NAME Stored procedure name
TBNAME NAME Table, alias, synonym, and view names
TGNAME NAME Trigger name
TSNAME NAME Table space name
UDFNAME NAME User-defined function name
UDTNAME NAME User-defined data type name
VCATNAME NAME VCAT name
SGNAME NAME All storage group names
IXSGNAME SGNAME NAME Storage group name for indexes
TSSGNAME SGNAME NAME Storage group name for table spaces
BPNAME NAME All buffer pool names
IXBPNAME BPNAME NAME Buffer pool name for indexes
TSBPNAME BPNAME NAME Buffer pool name for table spaces
AUTHID All authids listed below
GRANTEE GRANTID AUTHID Grantee
GRANTOR GRANTID AUTHID Grantor
| OWNER AUTHID Owner, creator, and so on. Masks both the
OWNER and the SCHEMA fields.
| DBOWNER OWNER AUTHID Owner of the database

508 User's Guide and Reference


Table 24. Translation mask names (continued)
Name Parent Grandparent Description
| IXOWNER OWNER AUTHID Owner of the index. Masks the index creator
| field (which is the OWNER of the index in
| DB2 V8, but is the SCHEMA of the index in
| DB2 V9)
| TBOWNER OWNER AUTHID Masks the table creator field (which is the
| OWNER of the table in DB2 V8, but is the
| SCHEMA of the table in DB2 V9)
| TSOWNER OWNER AUTHID Owner of the table space
| SCHEMA AUTHID Schema. Used to mask qualifiers of UDT,
UDF, stored procedures, tables, views, and
indexes.
| TBSCHEMA SCHEMA AUTHID Masks the table creator field (which is the
| OWNER of table in DB2 V8, but the
| SCHEMA of table in DB2 V9)
| IXSCHEMA SCHEMA AUTHID Masks the index creator field (which is the
| OWNER of index in DB2 V8, but the
| SCHEMA of index in DB2 V9)
SQLID AUTHID Current SQLID
| COMPRESS Whether a table space or table space
| partition is compressed
| SEGSIZE Number of pages in each segment of a
| segmented table space
| DSSIZE Maximum size in gigabytes for each
| partition in a partitioned table space
| PRIQTY Minimum primary space allocation for a
| DB2-managed data set for table spaces and
| index spaces
| IXPRIQTY PRIQTY Minimum primary space allocation for a
| DB2-managed data set for index spaces
| TSPRIQTY PRIQTY Minimum primary space allocation for a
| DB2-managed data set for table spaces
| SECQTY Minimum secondary space allocation for a
| DB2-managed data set for table spaces and
| index spaces
| IXSECQTY SECQTY Minimum secondary space allocation for a
| DB2-managed data set for index spaces
| TSSECQTY SECQTY Minimum secondary space allocation for a
| DB2-managed data set for table spaces
| DEFER Whether to build the index during when the
| CREATE INDEX statement is run
| DEFINE Whether the underlying data sets for the
| table space or index space are created when
| the object is created or when data is inserted
| into the object
| IXDEFINE DEFINE Whether the underlying data sets for the
| index space is created when the index space
| is created or when data is inserted into the
| index space

Chapter 21. Using masks 509


Table 24. Translation mask names (continued)
Name Parent Grandparent Description
| TSDEFINE DEFINE Whether the underlying data sets for the
| table space is created when the table space
| is created or when data is inserted into the
| table space
TCNAME NAME Masks a trusted context name
| ROLE AUTHID Mask a role name
| DBROLE ROLE AUTHID Masks a role associated with a database
| TSROLE ROLE AUTHID Masks a role associated with a table space
| TBROLE ROLE AUTHID Masks a role associated with a table
| IXROLE ROLE AUTHID Masks a role associated with an index

Note: The DBROLE, TSROLE, TBROLE, and IXROLE masks are not currently
used.

| When using or migrating DB2 V8 masking input, OWNER, TBOWNER and


| IXOWNER masks can be applied to both OWNER and SCHEMA. Once DB2
| Admin ends support of DB2 V8, the OWNER mask will mask only OWNER fields
| and SCHEMA will mask only SCHEMA fields.

The following mask names are used only when work statement lists (WSLs) are
cloned. If specified, they have no affect in GEN, migrate, or importing changes.
DBRMNAME
DBRM name. Used for BIND commands.
GBPNAME
Group buffer pool name.
SFNAME
Structure facility name.
SQLID
Needed by cloning for masking already generated SET CURRENT SQLID
statements.
Even if GEN and migrate generate SET CURRENT SQLID = <sqlid>
statements, the SQLID mask is not used to mask the <sqlid>. The <sqlid>
in these statements originates from field values in the DB2 Catalog and
these values are masked before the SET statement is generated.

Example: CREATE SYNONYM requires a SET CURRENT SQLID


statement to set the current sqlid to the synonym owner
(creator). The OWNER mask is used to mask the synonym
owner before the SET statement is generated.

| The following mask names have no affect when WSLs are cloned:
| v DBOWNER
| v TSOWNER
| v COMPRESS
| v SEGSIZE

510 User's Guide and Reference


| Specifying a REXX user exit for the overwrite value
| You can use a REXX user exit to specify the overwrite value for the table space and
| index space attributes for COMPRESS, SEGSIZE, DEFER, DEFINE, DSSIZE,
| PRIQTY, and SECQTY.

| Using a REXX user exit to calculate the value enables you to define and write your
| own overwrite rules to provide for additional flexibility and customization.

| To specify a REXX user exit as the overwrite value in your mask definition:
| 1. Ensure that DB2 Admin was customized with the :uexelib. tag to define the
| data set names for the REXX user exit libraries.
| 2. Ensure that a REXX user exit to calculate and return a valid value for the
| overwrite value has been defined and stored in the appropriate REXX user exit
| library. An example of a REXX user exit is shipped in SAMP library
| ADBDSIZE. The name of the REXX user exit in this sample is defined as
| MYDSSIZE, and the user exit calculates and returns a value that is to be used
| as the overwrite value for DSSIZE.
| 3. Define the mask definition with the correct syntax for calling the REXX user
| exit, which includes specifying the name of the REXX user exit and the input
| variables to pass as arguments to the user exit:
| REXX(execname,val1,val2,...valn).Each input variable must be the name of a
| DB2 catalog column or a variable name with a numeric or string value, where
| the variable name is the name of a DB2 catalog column. The following list
| shows some examples of the syntax that can be used on the Edit Mask panel to
| define overwrite values that are calculated by a REXX user exit:
| DSSIZE: MYDB*. MYTS*, DSSIZE(MYDSSIZE, PARTITIONS, BPOOL)
| DSSIZE: MYDB*. MYTS*, DSSIZE(MYDSSIZE, PARTITIONS=30, BPOOL='BP1')
| PRIQTY: MYDB*. MYTS*, REXX(MYPQTY, DBNAME, TSNAME, PCT= 20%)
| DEFINE: MYDB*. MYTS*, REXX(MYDEFINE, DEFINE='YES')
| DEFER: MYDB*. MYTS*, REXX(MYDEFER, DEFER='NO')
| COMPRESS: MYDB*. MYTS*, REXX(MYCOMP,TSNAME,DBAME,COMPRESS)
| SEGSIZE: MYDB*. MYTS*, REXX(MYSEG, NAME,DBNAME,SEGSIZE)

| The input values are passed to the REXX user exit in an argument list where
| the REXX user exit uses the arguments to perform the calculations and return
| the value that is to be used as the overwrite value. If one of the input variables
| is not provided in the proper context, a minus sign (-) is passed to the REXX
| user exit as the argument.

| Restriction: When you specify the input values for a REXX user exit in the
| mask definition that is to be used for WSL cloning or the import
| function in Change Management, specify the input variables as
| DB2 catalog names that are set to numeric or string variables. If
| you specify a catalog name only, the variable is passed as a minus
| sign (-), and the REXX user exit will return a value of a minus sign
| (-), which indicates that masking was not applied.
| If the REXX user exit does not return a valid value for the overwrite value,
| masking is not applied, and DB2 Admin processes the next definition in the
| mask file.

Chapter 21. Using masks 511


| Related concepts
| “Mask definitions” on page 505

DB2 catalog records that have default masks


The table in this topic shows the catalog columns in DB2 catalog records that have
masks applied before the SQL is created.
| Table 25. Mask application details
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSAUXRELS TBNAME TBNAME
| TBOWNER OWNER
| TBOWNER
| COLNAME COLNAME
| AUXTBNAME TBNAME
| AUXTBOWNER OWNER
| TBOWNER
| SYSCHECKS TBOWNER OWNER
| TBOWNER
| CREATOR OWNER
| TBNAME TBNAME
| CHECKCONDITION COLNAME Mask column names
| SYSCOLAUTH GRANTOR GRANTOR If grantor is an authid
| ROLE If grantor is a role
| TNAME TBNAME
| CREATOR OWNER
| TBOWNER
| GRANTEE PKGNAME If grantee is package
| PLNNAME If grantee is plan
| GRANTEE If grantee is an authid
| ROLE If grantee is a role
| COLNAME COLNAME
| COLLID COLLNAME If grantee is package
| SYSCOLUMNS NAME COLNAME
| TBNAME TBNAME
| TBCREATOR OWNER If schema not SYSIBM
| TBOWNER If schema not SYSIBM
| TYPENAME UDTNAME If schema not SYSIBM
| TYPESCHEMA SCHEMA
| SYSCONTEXT NAME TCNAME
| DEFINER AUTHID If definer is an authid
| ROLE If definer is a role
| DEFAULTROLE ROLE
| SYSCONTEXTAUTHIDS AUTHID AUTHID
| ROLE ROLE

512 User's Guide and Reference


| Table 25. Mask application details (continued)
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSDATABASE NAME DBNAME
| CREATOR DBOWNER If creator is an authid
| DBROLE If creator is a role
| STGROUP TSSGNAME
| BPOOL TSBPNAME
| GROUP_MEMBER GRPNAME
| INDEXBP IXBPNAME
| SYSDATATYPES SCHEMA SCHEMA
| OWNER OWNER If owner is an authid
| ROLE If owner is a role
| NAME UDTNAME
| SYSDBAUTH GRANTOR GRANTOR If grantor is an authid
| ROLE If grantor is a role
| GRANTEE GRANTEE If grantee is an authid
| ROLE If grantee is a role
| NAME DBNAME
| SYSFIELDS TBCREATOR OWNER
| TBOWNER
| TBNAME TBNAME
| NAME COLNAME
| FLDPROC PGMNAME
| SYSFOREIGNKEYS CREATOR OWNER
| TBOWNER
| TBNAME TBNAME
| RELNAME NAME
| COLNAME COLNAME
| SYSINDEXES NAME IXNAME
| CREATOR OWNER
| IXOWNER
| OWNER IXOWNER If owner is an authid
| IXROLE If owner is a role
| TBCREATOR OWNER
| TBOWNER
| DBNAME DBNAME
| BPOOL IXBPNAME
| SYSINDEXPART IXNAME IXNAME
| IXCREATOR OWNER
| IXOWNER
| PQTY PRIQTY
| IXPRIQTY
| SQTY SECQTY
| IXSECQTY
| STORNAME IXSGNAME
| VCATNAME VCATNAME

Chapter 21. Using masks 513


| Table 25. Mask application details (continued)
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSKEYCOLUSE TBCREATOR OWNER
| TBOWNER
| TBNAME TBNAME
| COLNAME COLNAME
| SYSKEYS IXNAME IXNAME
| IXCREATOR OWNER
| IXOWNER
| COLNAME COLNAME
| SYSPACKAGE COLLID SCHEMA Trigger package
| NAME TGNAME Trigger package
| COLLID COLLNAME Normal package
| NAME PKGNAME Normal package
| OWNER OWNER If owner is an authid
| ROLE If owner is a role
| CREATOR OWNER
| QUALIFIER OWNER
| PATHSCHEMAS SCHEMA Applied to each schema
| SYSPACKDEP BNAME TBNAME btype 'T','V','A','S','G'
| IXNAME btype ‘I'
| TSNAME btype 'R','P'
| UDFNAME btype 'F'
| STPNAME btype 'O'
| NAME btype none of the above
| BCREATOR DBNAME btype 'R','P'
| SCHEMA btype 'F','O'
| TBOWNER btype 'T','V','A','S','G'
| IXOWNER btype ‘I'
| DNAME TGNAME Trigger package
| DCOLLID SCHEMA Trigger package
| DNAME PKGNAME Normal package
| DCOLLID COLLNAME Normal package
| DOWNER OWNER If downer is an authid
| ROLE If downer is a role
| SYSPARMS SCHEMA SCHEMA
| OWNER OWNER If owner is an authid
| ROLE If owner is a role
| NAME UDFNAME UDF
| SPECIFICNAME UDFNAME UDF
| NAME STPNAME Stored procedure
| SPECIFICNAME STPNAME Stored procedure
| TYPESCHEMA SCHEMA If schema not SYSIBM
| TYPENAME UDTNAME If schema not SYSIBM

514 User's Guide and Reference


| Table 25. Mask application details (continued)
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSPLAN NAME PLNNA
| CREATOR OWNER If creator is an authid
| ROLE If creator is a role
| QUALIFIER OWNER
| PATHSCHEMAS SCHEMA Applied to each schema
| SYSPLANDEP BNAME TBNAME btype 'T','V','A','S','G'
| IXNAME btype ‘I'
| TSNAME btype 'R','P'
| UDFNAME btype 'F'
| STPNAME btype 'O'
| NAME btype none of the above
| BCREATOR DBNAME btype 'R','P'
| SCHEMA btype 'F','O'
| TBOWNER btype 'T','V','A','S','G'
| IXOWNER btype ‘I'
| DNAME PLNNAME
| SYSRELS CREATOR OWNER
| TBOWNER
| TBNAME TBNAME
| RELNAME NAME
| REFTBNAME TBNAME
| REFTBCREATOR OWNER
| TBOWNER
| IXOWNER OWNER If non-blank
| IXOWNER If non-blank
| IXNAME IXNAME If non-blank
| SYSRESAUTH GRANTOR GRANTOR If grantor is an authid
| ROLE If grantor is a role
| GRANTEE GRANTEE If grantee is an authid
| ROLE If grantee is a role
| NAME TSBPNAME obtype 'B'
| COLLNAME obtype 'C'
| QUALIFIER SCHEMA obtype 'D'
| NAME UDTNAME obtype 'D'
| QUALIFIER DBNAME obtype 'R'
| NAME TSNAME obtype 'R'
| TSSGNAME obtype 'S'
| IXSGNAME obtype 'S' for index
| NAME obtype 'J'
| SYSROLES NAME ROLE
| DEFINER AUTHID If definer is an authid
| ROLE If definer is a role

Chapter 21. Using masks 515


| Table 25. Mask application details (continued)
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSROUTINEAUTH GRANTOR GRANTOR If grantor is an authid
| ROLE If grantor is a role
| GRANTEE PKGNAME If package
| GRANTEE If grantee is an authid
| ROLE If grantee is a role
| COLLID COLLNAME If package
| GRANTEE PLNNAME If plan
| GRANTEE If authid grantee
| SCHEMA SCHEMA
| SYSROUTINES SCHEMA SCHEMA
| OWNER OWNER If owner is an authid
| ROLE If owner is a role
| NAME UDFNAME UDF
| SPECIFICNAME UDFNAME UDF
| NAME STPNAME stored procedure
| SPECIFICNAME STPNAME stored procedure
| COLLID COLLNAME
| SOURCESCHEMA SCHEMA
| EXTERNAL_NAME DBRMNAME
| JARSCHEMA SCHEMA
| JAR_ID NAME
| SYSSCHEMAAUTH GRANTOR GRANTOR If grantor is an authid
| ROLE If grantor is a role
| GRANTEE GRANTEE If grantee is an authid
| ROLE If grantee is a role
| SCHEMANAME SCHEMA
| SYSSEQUENCEAUTH GRANTOR GRANTOR If grantor is an authid
| ROLE If grantor is a role
| GRANTEE GRANTEE If grantee is an authid
| ROLE If grantee is a role
| SCHEMA SCHEMA
| NAME NAME
| SYSSEQUENCES SCHEMA SCHEMA
| OWNER OWNER If owner is an authid
| ROLE If owner is a role
| NAME NAME
| SYSSTOGROUP NAME TSSGNAME
| IXSGNAME rowtype 'Sx'
| CREATOR CREATOR
| OWNER If creator is an authid
| ROLE If creator is a role
| VCATNAME VCATNAME

516 User's Guide and Reference


| Table 25. Mask application details (continued)
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSSYNONYMS NAME TBNAME
| CREATOR OWNER If creator is an authid
| ROLE If creator is a role
| TBNAME TBNAME
| TBCREATOR OWNER
| TBOWNER
| SYSTABAUTH GRANTOR GRANTOR If grantor is an authid
| ROLE If grantor is a role
| GRANTEE PKGNAME If package
| GRANTEE If grantee is an authid
| ROLE If grantee is a role
| COLLID COLLNAME If package
| GRANTEE PLNNAME If plan
| GRANTEE If authid grantee
| BNAME DBNAME
| SCREATOR OWNER
| TBOWNER
| STNAME TBNAME
| TCREATOR OWNER
| TBOWNER
| TTNAME TBNAME
| SYSTABCONST TBCREATOR OWNER
| TBOWNER
| TBNAME TBNAME
| CREATOR OWNER If creator is an authid
| ROLE If creator is a role
| IXOWNER OWNER
| IXOWNER
| IXNAME IXNAME
| SYSTABLEPART TSNAME TSNAME
| DBNAME DBNAME
| IXNAME IXNAME
| IXCREATOR OWNER
| IXOWNER
| PQTY PRIQTY
| TSPRIQTY
| SQTY SECQTY
| TSSECQTY
| STORNAME TSSGNAME
| VCATNAME VCATNAME
| COMPRESS COMPRESS

Chapter 21. Using masks 517


| Table 25. Mask application details (continued)
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSTABLES NAME TBNAME
| CREATOR OWNER
| TBOWNER
| DBNAME DBNAME
| OWNER TBOWNER If owner is an authid
| TBROLE If owner is a role
| TSNAME TSNAME
| EDPROC PGMNAME
| VALPROC PGMNAME
| TBCREATOR OWNER
| TBOWNER
| TBNAME TBNAME
| SYSTABLESPACE NAME TSNAME
| CREATOR OWNER
| TSOWNER If owner is an authid
| TSROLE If owner is a role
| DBNAME DBNAME
| BPOOL TSBPNAME
| SEGSIZE SEGSIZE
| DSSIZE DSSIZE
| SYSTRIGGERS NAME TGNAME
| SCHEMA SCHEMA
| OWNER OWNER If owner is an authid
| ROLE If owner is a role
| TBNAME TBNAME
| TBOWNER OWNER
| TBOWNER
| TEXT SCHEMA Mask trigger name
| TGNAME Mask tab/view/synonym
| OWNER Mask UDT/UDF/STP
| TBNAME
| SCHEMA
| UDTNAME
| UDFNAME
| STPNAME
| COLNAME Mask column name

518 User's Guide and Reference


| Table 25. Mask application details (continued)
| Most specific mask
| DB2 Catalog record Catalog column names Comments
| SYSVIEWS NAME TBNAME
| CREATOR OWNER
| TBOWNER
| OWNER TBOWNER If owner is an authid
| TBROLE If owner is a role
| PATHSCHEMAS SCHEMA Applied to each schema
| TEXT SCHEMA Mask trigger name
| TGNAME Mask tab/view/synonym
| OWNER Mask UDT/UDF/STP
| TBNAME
| SCHEMA
| UDTNAME
| UDFNAME
| STPNAME
| COLNAME Mask column name
| SYSVOLUMES SGNAME TSSGNAME
| IXSGNAME rowtype 'Vx'
| SGCREATOR OWNER
|

Mask definition examples


Several examples of mask specifications are shown in the figure in this topic.

Note that some of the examples contain generic specifications, which are expressed
| by using an asterisk. The first mask that matches is used. The name is translated to
| the second value, or in the case where an attribute value is overwritten, the value
| of the attribute is overwritten to the new value.

Chapter 21. Using masks 519


Example 1:
NAME: ABC*,DEF*

In this example, any name that starts with ABC is changed to a name that starts with
DEF in the generated SQL.

Example 2:
AUTHID: SYSIBM, COPY

In this example, all authids that have the value SYSIBM are translated to COPY.

Example 3:
TBNAME: *01*, *02*

In this example, a table that is named EMPLOYEE01 is translated to EMPLOYEE02.

Example 4:
COLNAME: COL*, NEWCOL*

In this example, any column name in any table that starts COL is changed to a column
name that starts with NEWCOL. The column names that are changed include column
names in triggers, views, and indexes. You cannot selectively change column names in
specific tables.tart with TESTHRTS will be compressed.

| Example 5:
| COMPRESS: TESTDB.TESTTS*, YES

| In this example, the table spaces in the TESTDB database that start with TESTTS will be
| compressed.

| Example 6:
| PRIQTY: TESTDB.*, 75%

| In this example, the PRIQTY for all of the table spaces and index spaces in TESTDB
| database will changed to 75% of the current value of PRIQTY.

| Example 7:
| DSSIZE: TESTDB.TESTTS*, REXX(PDDSSIZE,PARTITIONS,BPOOL)

| In this example, the table spaces that start with TESTTS in the TESTDB database are
| changed to use the value that the REXX user exit PDDSSIZE returns as the DSSIZE.

Figure 370. Examples of translation masks

You can specify as many translation masks as you want. When a value is
translated (for example, a name), the masks are processed one by one until a match
is detected. A match means that the mask name is applicable to the value (for
example, for a table name, mask names TBNAME and NAME are applicable) and
the value conforms to the inputmask (for example, PRODTAB1 conforms to mask
| PROD*1). The value is translated based on the outputmask, or in the case where
| an attribute value is overwritten, the value of the attribute is overwritten to the
| new value. Only the first matching mask is used for a given value. If no matching
mask is found, the value is not translated. Generally, you should put the most
specific translation masks at the top of the mask file and the more general ones at
the end.

520 User's Guide and Reference


Performance tip: Using many masks might increase processing time. If a match is
not found early in the process, the program must search through
the list of translation masks until a match is found.

Chapter 21. Using masks 521


522 User's Guide and Reference
Part 4. Advanced topics
The following topics provide information on DB2 Admin advanced functionality.

© Copyright IBM Corp. 1995, 2010 523


524 User's Guide and Reference
Chapter 22. Writing and modifying DB2 Admin applications
You can useDB2 Admin to create your own applications and tools using DB2
Admin, and you can extend existing applications.

The tasks are the same for both creating and extending applications.

Topics:
v “The application development process” on page 526
v “Sample application” on page 526
v “Types of panels” on page 527
v “Controlling DB2 Admin processing” on page 527
v “DB2 Admin processing flow” on page 528
v “Panel naming conventions” on page 529
v “Using the DB2 Admin CLIST to invoke new applications” on page 530
v “Updating rows using SQL” on page 530
v “Using variables in your application” on page 531
Related concepts
“Finding the source code for panels” on page 87
“DB2 Administration Menu panel” on page 97

© Copyright IBM Corp. 1995, 2010 525


The application development process
DB2 Admin allows you to add new line commands to existing panels, and to
develop new applications by using DB2 Admin as the dialog driver and interface
to DB2.

Specifically:
v You can add new DB2 Admin functions to a copy of one or more of the panels
supplied with the product.

Tip: Use the existing code in the panel that you are modifying as a template,
and make the necessary changes for the new function. When you complete
your modifications, change the DB2 Admin source by creating an SMP/E
usermod to ensure that changes are not lost if maintenance is applied to the
product.
v You can develop new, independent applications by using the sample application
panels included with DB2 Admin as templates.

Regardless of whether you are creating or extending DB2 Admin applications, the
process involves creating ISPF panels that specify how DB2 Admin should perform
SQL processing and dialog control.
Related concepts
“Sample application”
“Step 21. Define your own line commands” on page 70

Sample application
DB2 Admin includes a sample application that you can use to help you create your
own applications.

The sample application consists of three ISPF panel source members located in
library SADBPLIB. Their names are ADB2S, ADB2S1, and ADB2SU. Use these
sample panels as templates to create your own application.

Recommendation: To better understand the concepts in this chapter, examine these


ISPF panel source members.

The sample application shows how to maintain a small DB2 table called USER. The
columns in the USER table are:
USERID CHAR(08) NOT NULL
EMPNAME CHAR(30) NOT NULL
EMPLNO CHAR(05) NOT NULL
COMMENTS CHAR(30) NOT NULL

Access the sample application from the DB2 Administration Menu panel by
specifying option S (it is not included in the list of options). The DB2 Admin
Sample Update Application panel, as shown in the following figure, is displayed.

526 User's Guide and Reference


DB2 Admin ------------- DB2 Admin Sample Update Application ------------- 01:14
Option ===>

1 - Display/update the USER table DB2 System: DB2X


C - Create a USER table DB2 SQL ID: ISTJE
I - Insert dummy entry into USER table
D - Drop USER table

Figure 371. DB2 Admin Sample Update Application panel (ADB2S)

v Select option C on the Sample Update Application panel to create the sqlid.USER
table (in default database DSNDB04).
v Select option I to insert a dummy row into the table so it is possible to display
or update the table using option 1.
v Select option 1 to display the USER table. From this display, you can use line
commands I, U, and D to insert, update, and delete rows.
v Select option D to drop the table.
Related concepts
“The application development process” on page 526

Types of panels
You can create different types of panels with DB2 Admin.

The types of panels that you can create are:


Menu panels
These panels are typically at the top of a hierarchy of other panels. Menu
panels specify the options that are available to the user.
Table display panels
These are ISPF table display panels on which data from DB2 or ISPF tables
are displayed.
Data entry panels
On these panels, a user enters data that is input to a DB2 SQL statement,
DB2 command, or DB2 Admin CLIST.
Help panels
These are standard ISPF help panels to guide the user in performing a
task.

For a new application, you typically create a menu panel and a number of data
entry and table display panels.

Controlling DB2 Admin processing


You control DB2 Admin processing by setting variables on the panels.

During processing, DB2 Admin looks at the variables and then processes the
related commands or statements accordingly. If no variables are set, DB2 Admin
redisplays the panel unchanged.

You can set the following variables on the panels:


PANEL
The name of the next panel DB2 Admin should display. If this variable is
used with an SQL SELECT statement, the next panel should be an ISPF

Chapter 22. Writing and modifying DB2 Admin applications 527


table display panel that shows the rows returned by DB2. On a menu
panel, set the PANEL variable to the panel name DB2 Admin should
display for a particular choice.
SQLSTMT
Any SQL statement that DB2 can execute. If the statement is an SQL
SELECT, DB2 Admin creates an intermediate ISPF table, fetches the rows,
adds the rows to the ISPF table, and shows the result on the specified
panel. If no panel is specified, the default table display panel is shown.
Multiple SQL statements can be specified; they must be separated by a
semicolon (;).
ISPFSTMT
Any ISPF statement that can be executed by the ISPEXEC ISPF API. This
variable is useful for invoking your own CLISTs, EXECs, or other
TSO/ISPF applications. Multiple statements can be specified; they must be
separated by a semicolon (;).
DB2ACMD
Any DB2 Admin primary command, which includes DB2 commands, ISPF
statements, and SQL statements.
Related concepts
“Primary commands” on page 88
Related information
Chapter 26, “DB2 Admin commands,” on page 611

DB2 Admin processing flow


After a panel is displayed, DB2 Admin examines the variables and processes the
instructions.

DB2 Admin examines the variables and processes the instructions according to the
following rules:
v If the user presses END, the previous panel is displayed.
v If variable ISPFSTMT is set, all ISPF statements are processed first.
v If variable SQLSTMT is set, the SQL statements are processed one by one. If DB2
returns rows, the result on the panel named in the variable PANEL is displayed.
If the variable PANEL is not set, the default panel is displayed.
v If the variable PANEL is set, the specified panel is displayed.
v If the variable DB2ACMD is set, the DB2 Admin commands are processed.

The process flow that DB2 Admin follows is shown in the following figure.

528 User's Guide and Reference


Start

Display
current
PANEL

User Y Return
pressed to previous
END display

Any ISPF Y Execute N


More ISPF
statements? first ISPF statements?
statement

N Y

Y Execute Any Y PANEL Y Display rows


Any SQL first SQL rows in on specified
statements? specified?
statement result? PANEL

N N
N
Display rows
on default
PANEL

Y More SQL
statements?

Y Display
Any PANEL All displays cause DB2 Admin
specified? PANEL
specified to start from top

Any Y Execute
DB2ACMDS? command

End

Figure 372. DB2 Admin logic diagram

Panel naming conventions


You can use DB2 Admin panels as a model to create your own panels.

However, you must use a different prefix in your panel names.

DB2 Admin panels have the prefix ADB2. The suffix normally identifies the option
that you selected to display the panel. For example, ADB21T is the panel for
option 1 on the DB2 Administration Menu and option T on the following panel.

The corresponding help panels have the same name but use the prefix ADBH.

Chapter 22. Writing and modifying DB2 Admin applications 529


Using the DB2 Admin CLIST to invoke new applications
If you have created a new, independent application, you can use the DB2 Admin
CLIST (ADBL) to invoke it.

Use the following parameters to invoke your application:


PANEL(panel)
Name of the first panel to be shown
SYSTEM(name)
DB2 subsystem that is to be used

Example: To start a DB2 Admin with your own customized panel, invoke the
CLIST by issuing the following command:
%ADBL PANEL(yourpanel)

Updating rows using SQL


If your DB2 Admin application will use SQL to update rows, perform the updates
on a separate panel.

Updating rows on the same panel will result in a copy of the data on the table
display panel, but updated data in DB2. When you use a separate panel for
updates, DB2 Admin refreshes the data in the table display panel automatically
when DB2 data changes.

Also, DB2 Admin issues an SQL COMMIT before each display, so if you have
concurrent users of your application, you probably should have a time stamp for
the latest updates to rows.

If you are updating rows using SQL, consider using the structure shown in the
following figure for your DB2 Admin application.

530 User's Guide and Reference


Application
main menu X=your prefix for panels

PANEL=X1 PANEL=X2
Selection Selection
panel for panel for
application1 application 2
X1 X2
SQL=SELECT
PANEL=X11
Table display
of result Return to previous panel
X11 using, for example:
ISPF=CONTROL NONDISPL END
PANEL=X12
or
Entry panel
with selected Stay on current panel
row displayed
X12
SQL=UPDATE

Figure 373. An example application structure

Using variables in your application


You can use two types of variables in your DB2 Admin application.
v General DB2 Admin variables
v Variables that contain column values, set as a result of an SQL SELECT and a
line command that selected the row

All variables are located in the ISPF function pool.

General DB2 Admin variables


There are four general DB2 Admin variables: DB2SYS, DB2AUTH, MAXROWS,
and DLEVEL.

The general DB2 Admin variables are:


DB2SYS
Indicates the DB2 system ID. The DB2SYS variable is set by the DB2
Admin CLIST.
DB2AUTH
Indicates the current DB2 authorization ID.

Chapter 22. Writing and modifying DB2 Admin applications 531


MAXROWS
Indicates the maximum number of rows to fetch. The default is 1000.
DLEVEL
Indicates the display level. The display level is increased by one for each
nested display.

Variables that contain column values


After an SQL SELECT statement is executed, DB2 Admin defines a variable for
each column of the result by using the ISPF VDEFINE service.

Therefore, these variables are available to your application. When you select a row,
the content of the column variables have the values for that row.

The names of column variables are the same as DB2 column names except for the
following differences:
v ISPF variable names have a maximum of eight characters. If the DB2 column
name exceeds eight characters, it is truncated to eight characters. For example,
the DB2 column name CLUSTERTYPE has the ISPF name CLUSTERT.
v Special characters, such as underscores in DB2 column names, are replaced by
the at sign (@). For example, DB2 column name EMPL_NAME has the ISPF
name EMPL@NAM.
v If duplicate column names exist in the result, all but the first duplicate column
name are given ISPF name DUP0001, DUP0002, and so on. For example,
SELECT CREATEDBAAUTH,CREATEDBCAUTH FROM
SYSIBM.SYSUSERAUTH is given ISPF names CREATEDB and DUP0001.
v All DB2 SELECT expressions are given ISPF names COL0001, COL0002, and so
on. For example, SELECT CURRENT DATE is given ISPF name COL0001.
v Table search argument variables are named in the same way as ISPF names, but
they are truncated to seven characters and given the prefix @. Duplicates are
named @DUP0001, @DUP0002, and so on.

532 User's Guide and Reference


Chapter 23. Using copies of the DB2 catalog
You can define copies of the DB2 catalog to DB2 Admin and create and maintain
entries in the catalog copy version table, ADBCATVT.

One entry is required for each copy of the catalog being used.

Prerequisite: The catalog copy version table must already be created.

Topics:
v “Adding entries to the catalog copy version table” on page 534
v “Catalog copies at remote sites” on page 537
v “Using previously defined multiple copies of the DB2 catalog” on page
537

DB2 Admin enables you to use copies of the DB2 system catalog when selecting
any of the options on the System Catalog panel. In addition, you can use the
system catalog of a remote DB2 system.

For example, you can choose to use a different copy of the catalog for each
weekday, and create a backup associated with each weekday. This strategy allows
examination of previous definitions in the backup copies of the DB2 system
catalog. Or you can allow only the system administrator to examine the active DB2
system catalog, and allow developers access to a copy of the DB2 system catalog.
This strategy can result in decreased contention on the catalog caused by the
developers' queries, while still allowing the system administrator to maintain the
active DB2 system catalog.

Recommendation: When using multiple copies of the catalog, do not issue


requests that involve data for which the definition of the objects
has been changed since the catalog copy was refreshed.

DB2 Admin uses the catalog copy version table, ADBCATVT, to keep track of
which DB2 copies are available to its users.

After the table is created, create an entry for each catalog copy to be used.
Related concepts
“DB2 Administration Menu panel” on page 97
Related tasks
“Step 14. Create a catalog copy version table” on page 68

© Copyright IBM Corp. 1995, 2010 533


Adding entries to the catalog copy version table
You can add an entry to the catalog copy versions table (ADBCATVT).

To add an entry to the catalog copy version table:


1. Select the CC option on the Administration Menu panel to display the Display
Catalog Copy panel, as shown in the following figure. If no rows exist in the
catalog copy versions table, the Insert an Entry panel is displayed instead, as
shown in Figure 375 on page 535.

DB2 Admin ------------ DB2X Display Catalog Copy Versions --------- Row 1 of 6
Command ===> Scroll ===> CSR

DB2 System: DB2X


Line commands: DB2 SQL ID: ISTJE

D - Delete I - Insert J - Create Copy, Bind Jobs

Copy Planname
Select Owner Suffix Timestamp Type Location
* * * * *
------ -------- -------- ------------------------ ------ ----------------
V6ALI0 A6 ? A STPLEX4A_DSN6
V7COPY2 02 2001-07-16-13.57.16.2180 C
V7COPY3 03 2001-07-16-16.34.55.7003 C
V7COPY4 04 2002-04-04-16.56.19.5425 C
V7COPY7 07 2003-04-11-16.33.37.6884 C
V7NEW11 11 2003-04-14-17.21.05.2860 C
******************************* END OF DB2 DATA ****************************

Figure 374. Display Catalog Copy Versions panel (ADB2CCD)

The fields on this panel are:


Select Input field where you enter one of the line commands listed on the
panel. The supported line commands are:
D Delete a catalog copy entry from the table.
I Insert a new catalog copy entry into the table.
J Generate Create/Bind and Copy jobs to have DB2 Admin
generate a job to create either the like tables or the aliases and
bind the plans for that entry, and a job to copy the catalog.
When you specify J, the Create Catalog Copy and Bind Batch
Jobs panel (Figure 376 on page 536) is displayed so that you
can enter additional information.
Highlevel qualifier
Enter a valid DB2 authorization id. This field must be unique within
the table.
Planname Suffix
This can be any two characters. This field must be unique within the
table.
Timestamp
The time when the copy of the catalog was last refreshed. When
inserting an entry, leave this field blank.
Type The type of catalog:
A Indicates the entry is for a catalog at a remote site. When

534 User's Guide and Reference


creating an entry for a remote catalog, enter the high-level
qualifier, plan name suffix, type, and location of the remote
catalog.
C Indicates the entry is for a copy of a local catalog. When
creating an entry for a copy of a local catalog, enter the
high-level qualifier, plan name suffix, and type.
V Indicates the entry is for views of a local catalog. When
creating an entry for views of a local catalog, enter the
high-level qualifier, plan name suffix, and type.
Location Name
Indicates the location of a remote catalog.
2. Issue the Insert line command to add an entry for each copy of the DB2 catalog
that you want to use. The panel is shown in the following figure.

| ADB2CCI n ----------------------- Insert an Entry ----------------------- 16:56


| Command ===>
|
| DB2 System: DSN9
| Insert an entry into DB2 Catalog Copy Version Table DB2 SQL ID: VNDMPM2
|
| Enter/Verify:
| Copy Owner . . . VNDMPMG
| Plan Name Suffix . . . MF
| Timestamp . . . 2009-07-29-11.20.45.586601
| Type . . . C (C=copy, A=Alias, V=View)
| Location Name . . . > (Blank for types C and V)
|
| Press ENTER to insert an entry, or press PF3 to cancel insert.
|
|
| Figure 375. Insert an Entry panel (ADB2CCI)
|
Enter or verify the information in each field.
3. Press Enter to add the entry to ADVCATVT.
4. Issue the J command to generate create, bind, and copy jobs. The Create
Catalog Copy and Bind Batch Jobs panel is displayed, as shown in the
following figure.
For Type A (aliases of a distributed DB2 system catalog), one job is created.
ALIBNDxx (where xx is plan name suffix) creates aliases for the DB2 system
catalog tables of the distributed subsystem at the given location. This job also
binds the plans which DB2 Admin needs to access the aliases.
For Type C (copies of a local DB2 system catalog), two jobs are created:
v DDLBNDxx is the create and bind job. It creates the like tables for the copy
and binds the plans. Run this job once to create all the tables for the copy of
the catalog and to bind the plans that DB2 Admin is to use when this copy is
selected.
Up to four table spaces are created to contain the tables. The names of the
table spaces are CCnnKxx, where nn is the necessary page size (4, 8, 16 or 32)
and xx is the plan name suffix for that catalog copy.
v CPYRUNxx is used to refresh the copy. Run it to create the initial copy of the
tables; rerun it whenever the copy needs to be refreshed. The CPYRUNxx job
also runs the RUNSTATS job against the table space that contains the copy
and updates the timestamp field of the catalog copy version record.
For Type V (views of a local DB2 system catalog), one job is created.
VIEBNDxx (where xx is the plan name suffix) creates views for the local
catalog tables. You can modify VIEBNDxx to add predicates to the views to

Chapter 23. Using copies of the DB2 catalog 535


limit which rows are accessible to users. However, restricting which rows are
accessible can effect the ability of DB2 Admin to retrieve information, resulting
in incomplete information being returned.

| ADB2CCJ n ---------DB2X Create Catalog Copy and Bind Batch Jobs -------- 16:56
| Command ===>
|
|
| Specify the following for DB2 Admin CATALOG COPY: DB2 System: DSN9
| DB2 SQL ID: VNDMPM2
|
| Catalog Copy Owner . . : VNDMPMG Type . . : C (C=copy, A=Alias, V=View)
|
| Data set information:
| PDS for jobs . . . . . . . .'VNDMPM2.TEST.JCL1'
| Prefix for work data sets . . VNDMPM2
|
| Catalog Copy options (for type C only):
| Database Name . . . . . . . VNDMPM2 (? to look up existing database)
| Storage Group Name . . . . . VNDMPM2 > (? to look up existing stogroup)
| Run SQLID . . . . . . . . . . VNDMPM2 >
| Catalog Copy Method . . . . . L (L=LOAD from Cursor, U=UNLOAD/LOAD)
|
| Miscellaneous options:
| Batch job PDS unit type . . . SYSDA
| Work data set unit type . . . SYSDA
|
| Enter command BP to change batch job parameters
|
|
| Figure 376. Create Catalog Copy and Bind Batch Jobs panel (ADB2CCJ)
|
5. Specify the name of an existing PDS where the generated jobs are to be stored.
For type C (copies of a local DB2 system catalog), also specify:
v The database and the storage group name to be used for the table space that
will contain the like tables of the DB2 catalog tables. The name of the table
space created to contain the like tables is the same as the qualifier of the
copy.
v The method to be used to copy the DB2 catalog to the like tables. The default
is the LOAD from cursor method. The other method, UNLOAD/LOAD,
allows you to unload into data sets as one process and to load as a second
process. For the UNLOAD/LOAD method, the CPYRUNxx job will use
TEMPLATE statements to define output and work data sets. Modify those
TEMPLATE statements as necessary. (This function does not use any
user-specified templates.)

Recommendation: Use the LOAD from cursor method if the catalog data is
not needed outside of the process, for example, for the
movement or modification of data. The LOAD from
cursor method reduces the I/O load of the entire process
and requires no work data sets.
6. Press Enter to generate the jobs.
7. Run the appropriate job or jobs. The job only needs to be run once.
8. DB2 Admin renames any duplicate indexes that are created during CC
processing. For the new names of the duplicate indexes, see step ISPFBAT.

| Recommendation: DB2 Admin performs space calculation of the catalog copy


| table space to build a reasonable CREATE TABLESPACE and
| CREATE INDEX statement. Run the RUNSTATS utility on the
| catalog table spaces before issuing the J line command on panel
| ADB2CJ. Verify that the space requirements are adequate.

536 User's Guide and Reference


Tip: The catalog copy process includes building tables that match the names of the
system catalog tables. Also, indexes are built for those tables that match the
names of the current set of indexes on the system catalog tables. Tables and
indexes with the same qualifier and name might already exist as objects other
than the intended catalog copy objects. If a duplicate object exists, SQLCODE
-601 is issued when the DDL to create the new catalog copy is run. If you
receive this error, you need to modify the DDL and restart the step. DB2
Admin detects certain duplicate index errors when creating the DDL for the
index and attempts to avoid the error by creating a new name for the index
that is based on the old name. However, DB2 Admin cannot detect and
handle all cases.
Related tasks
“Step 14. Create a catalog copy version table” on page 68

Catalog copies at remote sites


Using multiple copies provides a method for using a remote site catalog that is
different from the method provided by the DD (Distributed DB2 systems) option
on the Admin main menu.

The GEN request is supported with the multiple copies method by using a catalog
alias (Catalog Copy type 'A') and the alias' location for routing to the remote site.

Using previously defined multiple copies of the DB2 catalog


If your installation defined multiple copies of the DB2 catalog before you installed
DB2 Admin, you need to perform an additional step after installing DB2 Admin.
1. Reissue the J line command for each entry in the Display Catalog Copy
Versions panel. Reissuing the J line command regenerates the jobs for the new
release of DB2 Admin.
2. After the jobs are regenerated, run the BIND step of all DDLBNDxx and
ALIBNDxx jobs.
3. Change the second line of the job from:
//* RESTART=stepname, <=== For restart, remove * and enter step
name
to
// RESTART=BIND
Related tasks
“Step 14. Create a catalog copy version table” on page 68

Chapter 23. Using copies of the DB2 catalog 537


538 User's Guide and Reference
Chapter 24. Running DB2 Admin across distributed systems
You can use DB2 Admin on remote DB2 systems.

This functionality is called distributed support. By using this support, you can:
v Build utility jobs and submit them to run on remote systems.
v Perform alter and migrate functions for remote systems.
v Issue SQL statements against remote systems.
v Issue distributed GRANT and REVOKE commands.
v Issue other commands on remote systems.

Topics:
v “Enabling DB2 Admin distributed support” on page 540
v “Using DB2 Admin distributed support” on page 540

When you issue a RESET command, you are returned to the local subsystem.
Related concepts
“Step 8. Customize the ISPF environment” on page 44
“DB2 Administration Menu panel” on page 97
Related tasks
“Step 3. Run the batch jobs” on page 298

© Copyright IBM Corp. 1995, 2010 539


Enabling DB2 Admin distributed support
You must complete customization steps before you can issue DB2 Admin
commands on a remote subsystem.

Complete the following customization steps:


1. Run the ADB2RCPC job (in the SADBSAMP library) on the remote subsystem.
Running the ADB2RCPC job creates the stored procedure ADB2RCP, which
processes DB2 commands that are run from another subsystem. ADB2RCPC
also binds the ADBL.ADB2RCM package.
2. Copy the distributed load module ADB2RCP to the load data set for the default
stored procedure address space on the DB2 subsystem.
3. Change the qualifier (schema) of the stored procedure in all three locations:
v in the CREATE statement
v in the GRANT statement
v in the PATH of the BIND PACKAGE statement
4. If you update the ADB2RCM load module, you must re-run the BIND job step
of ADB2RCPC on the remote subsystem.

After connecting to a remote subsystem, you can use option Z on the DB2
Administration Menu to issue commands against the remote subsystem.

Using DB2 Admin distributed support


You can use DB2 Admin distributed support.

To use DB2 Admin distributed support, select option DD from the DB2
Administration Menu panel to display the Distributed DB2 Systems panel, as
shown in the following figure.

DB2 Admin ----------------- Distributed DB2 Systems ------- ROW 1 TO 19 OF 19


Command ===> Scroll ===> PAGE

Select the location you wish to use: DB2 System: DB2X


DB2 SQL ID: ISTJE
Line commands:
S - Use DDF to access the remote catalog CO - Connect to the remote subsystem

Select Location
*
------ -----------------
DENMARK_DB2M
DENMARK_DB2X
DENMARK_DB2D
DENMARK_DB2T
DENMARK_DB2W
DENMARK_DB2P
STOCKHLM_DB2B
BELGHOLL_DB2
OSLOMVSA_DB2T
STOCKHLM_DB2C
GER2_DSNS
FINLAND_DB2
LUBDB2
NORDIC_DB2T

Figure 377. Distributed DB2 Systems panel (ADB2DDF)

540 User's Guide and Reference


This panel displays the remote DB2 subsystems that are available from the DB2
subsystem you are currently on (referred to as the local subsystem). Choose the DB2
subsystem for which you want the system catalog displayed. Press END to get
back to the panel from which you came.

On the Distributed DB2 Systems panel, you can issue the following line
commands:
DIS
Displays the active threads for the location or system you select.
S Selects the remote subsystem for which you want to access the remote system
catalog.
CO
Connects you directly to a remote subsystem for issuing remote requests.
You can also use the CONNECT location_name primary command to connect
to a remote subsystem.

Restrictions for connecting to a remote subsystem


v When using the distributed DB2 systems function to access a remote DB2 system
catalog, some functions in the DB2 Admin system catalog dialog are disabled.
For example, you cannot issue DB2 DISPLAY or GEN commands, and unless
prompting is on, you also cannot issue DB2 BIND, REBIND, or FREE
commands.
v If you connect to a remote subsystem that does not have an entry in the
ADB2DB2D customization table, alter, migrate, and utility jobs are not allowed,
and an error message is displayed.
v To use copies of the system catalog of a remote subsystem, the local subsystem
customization must specify the owner of the catalog copy version table.
v You cannot use option 1 of the Space Management function (display page set
space by database).
v You cannot issue SM line commands on the database and table space panels.
v You cannot interface to other DB2 products from a remote subsystem.

Example: Accessing a remote subsystem


The following example shows you how to access a remote subsystem.

To access a remote subsystem:


1. Enter S in front of the remote DB2 subsystem you want to access, as shown in
the following figure.

Chapter 24. Running DB2 Admin across distributed systems 541


DB2 Admin ----------------- Distributed DB2 Systems ------- ROW 1 TO 19 OF 19
Command ===> Scroll ===> PAGE

Select the location you wish to use: DB2 System: DB2X


DB2 SQL ID: ISTJE
Line commands:
S - Use DDF to access the remote catalog CO - Connect to the remote subsystem

Select Location
*
------ -----------------
DENMARK_DB2M
DENMARK_DB2X
DENMARK_DB2D
S DENMARK_DB2T
DENMARK_DB2W
DENMARK_DB2P
STOCKHLM_DB2B
BELGHOLL_DB2
OSLOMVSA_DB2T
STOCKHLM_DB2C
GER2_DSNS
FINLAND_DB2
LUBDB2
NORDIC_DB2T

Figure 378. Example of using distributed DB2 systems function (Part 1 of 2)

2. Issue the CO line command. DB2 Admin displays the System Catalog panel, as
shown in the following figure, and indicates at the top of the panel which
location you are accessing. All generated batch utility jobs, ALTER commands,
and MIGRATE commands are sent to the remote subsystem (or the target
system for the migrate jobs) for execution after the jobs have been submitted on
the local subsystem.

DB2 Admin --------------------- DB2X System Catalog --------------------- 15:47


Option ===>

At location: DENMARK_DB2T DB2 System: DB2X


AO - Authorization options DB2 SQL ID: ISTJE
G - Storage groups P - Plans
D - Databases L - Collections
S - Table spaces K - Packages
T - Tables, views, and aliases M - DBRMs
V - Views H - Schemas
A - Aliases E - User defined data types
Y - Synonyms F - Functions
X - Indexes O - Stored procedures
C - Columns J - Triggers
N - Constraints Q - Sequences
DS - Database structures DSP - DS with plans and packages

Enter standard selection criteria (Using a LIKE operator, criteria not saved):
Name ===> > Grantor ===> >
Owner ===> > Grantee ===> >
In D/L/H ===> >
And/or other selection criteria (option xC shows you columns for option x)
Column ===> > Operator ===> Value ===>

Figure 379. Example of using distributed DB2 systems function (Part 2 of 2)

3. Issue a BP command after connecting to the remote subsystem to set up JOB


cards for the remote subsystem. The last JOB card that is used remains active
until another BP command is issued. If you have not set up a JOB card for the
remote subsystem, the JOB cards for the local subsystem are used on the
remote subsystem.

542 User's Guide and Reference


Part 5. Reference
The following topics provide DB2 Admin reference information.

© Copyright IBM Corp. 1995, 2010 543


544 User's Guide and Reference
Chapter 25. System catalog panels
The main system catalog panels are described in this reference information.

Topics:
v “The System Catalog panel” on page 546
v “Option A. Aliases” on page 551
v “Option C. Columns” on page 552
v “Option D. Databases” on page 555
v “Option DS. Database Structures” on page 557
v “Option DSP. Database Structures with Plans and Packages” on page 559
v “Option E. User-Defined Data Types” on page 560
v “Option F. Functions” on page 562
v “Option G. Storage Groups” on page 564
v “Option H. Schemas” on page 565
v “Option J. Triggers” on page 566
v “Option K. Packages” on page 567
v “Option L. Collections” on page 576
v “Option M. DBRMs” on page 577
v “Option N. Constraints” on page 579
v “Option O. Stored Procedures” on page 580
v “Option P. Plans” on page 582
v “Option Q. Sequences” on page 590
v “Option S. Table Spaces” on page 591
v “Option T. Tables, Views, and Aliases” on page 594
v “Option V. Views” on page 600
v “Option X. Indexes” on page 600
v “Option Y. Synonyms” on page 603
v “Authorizations for objects” on page 605
Related concepts
“DB2 Administration Menu panel” on page 97
“Overview of reports” on page 134
“Selecting a copy of the DB2 catalog” on page 133
Related information
Chapter 7, “Querying the system catalog,” on page 131

© Copyright IBM Corp. 1995, 2010 545


The System Catalog panel
The System Catalog panel displays objects in the DB2 catalog, database structures,
and options for authorizations for objects in the catalog.

Select option 1 on the DB2 Administration Menu to display the System Catalog
panel (see Figure 380).

Enter one of the object codes on the command line (for example, D for databases).
You can limit the information that is returned by entering one or more selection
criteria at the bottom of the panel. For example, specifying D402 in the Name field
limits the search to databases whose names begin with D402. In response to your
choices, DB2 Admin creates and executes an SQL statement that searches the DB2
catalog for the object or authorization you have requested.

Recommendation: For optimum performance, specify selection criteria for the


following:
v For option T, enter a value for “Owner” or “In D/L/H”
(database, collection, or schema).
v Option M can be time-consuming, depending on how many
plans and DBRMs you maintain.

When you specify selection criteria, you can change from a LIKE search (a "fuzzy"
search) to an exact search, by using an equal sign (=). You can use the LIKE ON
and LIKE OFF primary commands to toggle between a "fuzzy" search (LIKE ON)
and an exact search (LIKE OFF).

You can save (or not save) your search criteria between DB2 Admin sessions using
the SAVE ON and SAVE OFF primary commands. When the SAVE ON command
is active, the text "criteria saved" appears on the System Catalog panel. With
SAVE ON, the search criteria is restored when you re-enter a DB2 Admin session.

The following figure shows the object options on the System Catalog panel.

DB2 Admin --------------------- DB2X System Catalog --------------------- 17:34


Option ===>

More: +
Object options: DB2 System: DB2X
AO - Authorization options DB2 SQL ID: ISTJE
G - Storage groups P - Plans
D - Databases L - Collections
S - Table spaces K - Packages
T - Tables, views, and aliases M - DBRMs
V - Views H - Schemas
A - Aliases E - User defined data types
Y - Synonyms F - Functions
X - Indexes O - Stored procedures
C - Columns J - Triggers
N - Constraints Q - Sequences
DS - Database structures DSP - DS with plans and packages

Enter standard selection criteria (Using a LIKE operator, criteria not saved):
Name ===> > Grantor ===> >
Owner ===> > Grantee ===> >
In D/L/H ===> > Switch Catalog Copy ===> N (N/S/C)
And/or other selection criteria (option xC shows you columns for option x)
Column ===> > Operator ===> Value ===>

Figure 380. System Catalog panel (ADB21) – object options

546 User's Guide and Reference


To view the authorization options, choose the AO option. The authorization
options are shown in Figure 381.

For optimum performance, specify selection criteria for all authorization options
(xA) and enter a value for Grantor or Grantee.

The following figure shows authorization options for the System Catalog panel.

DB2 Admin --------------------- DB2X System Catalog --------------------- 17:35


Option ===>

More: +
Authorization options: DB2 System: DB2X
OO - Object options DB2 SQL ID: ISTJE
GA - Storage group auths PA - Plan authorizations
DA - Database authorizations LA - Collection authorizations
SA - Table space authorizations KA - Package authorizations
TA - Table authorizations HA - Schema authorizations
VA - View authorizations EA - User defined data type authorizations
CA - Column authorizations FA - Function authorizations
ZA - System authorizations OA - Stored procedure authorizations
UA - User authorizations QA - Sequence authorizations
RA - Resource authorizations

Enter standard selection criteria (Using a LIKE operator, criteria not saved):
Name ===> > Grantor ===> >
Owner ===> > Grantee ===> >
In D/L/H ===> > Switch Catalog Copy ===> N (N/S/C)
And/or other selection criteria (option xC shows you columns for option x)
Column ===> > Operator ===> Value ===>

Figure 381. System Catalog panel (ADB21) – authorization options

DB2 Admin will report authorizations based solely on the DB2 catalog except:
v Installation authorities specified using DSNZPARM.
v Any external security system, such as RACF.
v Any security product from any other software provider.
v Any impact of the security user exits, even those supplied by IBM.

Chapter 25. System catalog panels 547


Related concepts
“Using search arguments to filter data on DB2 Admin panels” on page 93
Related tasks
“Step 14. Create a catalog copy version table” on page 68
Related reference
“Option A. Aliases” on page 551
“Option C. Columns” on page 552
“Option D. Databases” on page 555
“Option DS. Database Structures” on page 557
“Option DSP. Database Structures with Plans and Packages” on page 559
“Option E. User-Defined Data Types” on page 560
“Option F. Functions” on page 562
“Option G. Storage Groups” on page 564
“Option H. Schemas” on page 565
“Option J. Triggers” on page 566
“Option K. Packages” on page 567
“Option L. Collections” on page 576
“Option M. DBRMs” on page 577
“Option N. Constraints” on page 579
“Option O. Stored Procedures” on page 580
“Option P. Plans” on page 582
“Option Q. Sequences” on page 590
“Option S. Table Spaces” on page 591
“Option T. Tables, Views, and Aliases” on page 594
“Option V. Views” on page 600
“Option X. Indexes” on page 600
“Option Y. Synonyms” on page 603

| The trusted contexts panel


| To display trusted contexts choose the TR option on the System Catalog panel.

| Trusted contexts panel

| The trusted contexts are shown in the following figure.

| Note: The only selection criteria allowed for RO and TR options is Name and
| Column/Operator/Value.
|

548 User's Guide and Reference


| ADB2AN in ---------------- DSN9 Trusted Contexts ----------- Row 1 to 10 of 10
| Command ===> Scroll ===> PAGE
|
| Line commands:
| RO - Roles ID - Authids ATTR - Attributes DR - Definer role DROP - Drop
| I - Interpretation COM - Comment DDL - Generate DDL GEN - Generate SQL
|
| D System Default O E A A Created
| Sel Name Definer T Authid Role T N L U Timestamp
| * * * * * * * * * *
| ---- -------> -------> - -------- -------> - - - - --------------------------
| PJCTXROW SMITHAJ SMITHAJ PJROLEOW L Y N N 2008-11-12-10.34.32.643009
| PJTCN PJROLEOW L PJRN N N N 2008-10-20-14.42.28.663668
| PJTCX PJROLEOW L MARLINX PJRX Y N N 2008-10-20-10.16.29.124017
| PJTCY PJROLEOW L MARLINY PJRY Y N N 2008-10-20-10.22.17.092977
| PJTCZ PJROLEOW L MARLINZ PJRZ Y N N 2008-10-20-10.55.09.611261
| PJTRCXT2 SMITHAJ MARLINP PJROLE2 Y N N 2008-09-26-16.54.37.743776
| PJTRCXT7 PJROLEOW L FAKENAME N N N 2008-10-17-10.28.52.037965
| PJTSTAT1 PJROLEOW L PJTSTAT1 N N N 2008-10-21-16.15.58.731579
| PJTSTAT2 PJROLEOW L PJTSTAT2 N N N 2008-10-21-16.18.36.182001
| PJTSTATJ PJROLEOW L MARTSTJ Y N N 2008-10-21-16.46.00.787353
| ******************************* END OF DB2 DATA *******************************
||
| Figure 382. Trusted Contexts panel (ADB2AN)
|
| Use the following line commands from this panel to display trusted contexts
| information:
| RO Displays the default role, if any, and any roles from associated
| authorization IDs (panel ADB2ARL)
| ID Displays authorization IDs associated with a trusted context (panel
| ADB2ANID)
| ATTR Displays trusted context attributes (panel ADB2ANAT)
| DR Displays the role which defined the trusted context,if any (panel
| ADB2ARL)
| I Displays interpretation of an object in SYSCONTEXT (panel ADB2ANI)
| DROP Use to DROP a trusted context or attribute (panel ADB26DR)
| COM Allows you to create a comment for the trusted context (panel ADB26RT)
| CRE Use to create a trusted context (panel ADB26CN)
| AL Use to alter a trusted context (panel ADB26CN)
| ADDA
| Use to add an attribute to a trusted context (panel ADB26CN)
| ADDI Use to add an AuthID to a trusted context (panel ADB26CN)
| DDL Use to generate DDL
| GEN Use to generate SQL from DB2 catalog

| Creating or altering a trusted context

| To create a trusted context, enter the CRE line command on panel ADB2AN. To
| alter a trusted context, enter the AL line command on panel ADB2AN. Fill in the
| required information in the series of panels that appear (shown below). An
| example is given for the CRE command.
|

Chapter 25. System catalog panels 549


| ADB26CN n -----------------DB2X Create Trusted Context ----------------- 05:30
| Command ===> __________________________________________________________________
|
| CREATE TRUSTED CONTEXT
| Name . . . . . . . __________________ > (? to look up existing)
|
| BASED UPON CONNECTION USING SYSTEM AUTHID
| Authid . . . . . . __________________ > (primary authid)
|
| DEFAULT ROLE
| Role . . . . . . . __________________ > (role name)
|
| WITH ROLE AS OBJECT OWNER AND QUALIFIER
| With owner/qual. . ___ (Yes/No)
|
| ENABLE/DISABLE
| Initial state . . ___ (Enable/Disable)
|
| DEFAULT SECURITY LABEL
| Label . . . . . . ________ (security label name)
| (continued...)
|
| Press ENTER to continue with attributes or PF3 to cancel
|
|
| Figure 383. Create Trusted Contexts panel (ADB26CN)
|
|
| ADB26CNA ------------DB2X Create Trusted Context Attributes ----------- 05:30
| Command ===> __________________________________________________________________
|
| CREATE TRUSTED CONTEXT "TEST"
|
|
| ATTRIBUTES(
|
| Choose one::
|
| ADDRESS . . . _______________________________________ (IP address)
|
| ENCRYPTION . ____ (None, Low, or High)
|
| SERVERAUTH . ________________________________________________________________
| (network security zone)
| JOBNAME . . . ________ (jobname or job prefix*)
|
| _ Add more attributes
| )
|
| Press ENTER to continue with IDs or PF3 to restart attribute definition
||
| Figure 384. Create Trusted Context Attribues (ADB26CNA)
|

550 User's Guide and Reference


| ADB26CNA ------------DB2X Create Trusted Context Attributes ----------- 05:30
| Command ===> __________________________________________________________________
|
| CREATE TRUSTED CONTEXT "TEST"
|
|
| ATTRIBUTES(
|
| Choose one::
|
| ADDRESS . . . _______________________________________ (IP address)
|
| ENCRYPTION . ____ (None, Low, or High)
|
| SERVERAUTH . ________________________________________________________________
| (network security zone)
| JOBNAME . . . ________ (jobname or job prefix*)
|
| _ Add more attributes
| )
|
| Press ENTER to continue with IDs or PF3 to restart attribute definition
||
| Figure 385. Create Trusted Context IDs (ADB26CNU)
||
Option A. Aliases
Use the Aliases panel to display information about the aliases in the DB2 catalog.

Select option A on the System Catalog panel to display the Aliases panel, as shown
in the following figure.

On this panel, you can reverse engineer DB2 objects by using the GEN line
command.

| DB2 Admin ------------------------ DB8A Aliases ----------- Row 23 to 28 of 28


| Command ===> Scroll ===> PAGE
|
| Line commands:
| L - List BR - Browse DC - Describe columns Drop - Drop Alias I - Details
| T - Tables SEL - Select prototyping DDL - Generate DDL GEN - Generate SQL
| ? - Show all line commands
|
| Sel Name Schema RefObject RefObj Location
| Name Schema
| * * * * *
| ----- -----------------> -------- -----------------> -------> ----------------
| SYSCHECKDEP CFSDSN8 SYSCHECKDEP SYSIBM DNS8
| SYSCHECKS CFSDSN8 SYSCHECKS SYSIBM DNS8
| SYSCHECKS2 CFSDSN8 SYSCHECKS2 SYSIBM DNS8
| SYSCOLAUTH CFSDSN8 SYSCOLAUTH SYSIBM DNS8
| SYSCOLDIST CFSDSN8 SYSCOLDIST SYSIBM DNS8
| SYSCOLDISTSTATS CFSDSN8 SYSCOLDISTSTATS SYSIBM DNS8
| ******************************* END OF DB2 DATA *******************************
||
| Figure 386. The Aliases panel (ADB21A) – displaying aliases
|
The fields on this panel are:
Sel
Input field where you enter one of the line commands listed on the panel.
Name
Name of the alias.

Chapter 25. System catalog panels 551


Owner
Authorization ID of the owner of the alias.
| RefObject Name
Name of the table or view to which the alias refers.
| RefObj Schema
The schema of the table or view to which the alias refers.
Location
Location name of the object of the alias. The field is blank for an alias that was
not defined with a three-part object name.
Related reference
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Option C. Columns
The Columns panel displays the columns in the DB2 catalog.

Select option C on the System Catalog panel (see Figure 380 on page 546) to
display the Columns panel (see Figure 387 on page 553).

The following figure shows the Columns panel.

552 User's Guide and Reference


| DB2 Admin --------------------- DB2X Columns -------------------- Row 1 of 319
| Command ===> Scroll ===> PAGE
|
| Line commands:
| T - Tables ST - Specific table A - Auth GR - Grant SEQ -Identity column
| H - Homonyms I - Interpret UR - Update runstats LAB - Label COM - Comment
| DI - Distribution stats PST - Partition stats E - Source data type
| X - Indexes SX - Specific indexes RH - Runstats history CON - Constraints
|
| Sel Schema Name Column Name Col No Col Type Length N D F
| * * * * * * * * *
| --- -------- ------------------ ------------------ ------ -------- ------ - - -
| DSN8 DSN8ES1_RS_TBL RS_SEQUENCE 1 INTEGER 4 N N N
| DSN8 DSN8ES1_RS_TBL RS_EMPNO 2 CHAR 6 N N N
| DSN8 DSN8ES1_RS_TBL RS_FIRSTNME 3 CHAR 12 N N N
| DSN8 DSN8ES1_RS_TBL RS_LASTNAME 4 CHAR 15 N N N
| DSN8 DSN8ES1_RS_TBL RS_SALARY 5 DECIMAL 9 N N N
| DSN8 DSN8ES1_RS_TBL RS_BONUS 6 DECIMAL 9 N N N
| DSN881SA STAFF EMPNUM 1 CHAR 3 N N N
| DSN881SA STAFF EMPNAME 2 CHAR 20 Y Y N
| DSN881SA STAFF GRADE 3 DECIMAL 4 Y Y N
| DSN881SA STAFF CITY 4 CHAR 15 Y Y N
| DSN881SA STAFFV1 EMPNUM 1 CHAR 3 N N N
| DSN881SA STAFFV1 EMPNAME 2 CHAR 20 Y Y N
| DSN881SA STAFFV1 GRADE 3 DECIMAL 4 Y Y N
| DSN881SA STAFFV1 CITY 4 CHAR 15 Y Y N
| DSN881SA TESTSTUFF TESTNO 1 CHAR 4 Y Y N
| DSN881SA TESTSTUFF RESULT 2 CHAR 4 Y Y N
| DSN881SA TESTSTUFF TESTTYPE 3 CHAR 3 Y Y N
| DSN8810 ACT ACTNO 1 SMALLINT 2 N N N
| DSN8810 ACT ACTKWD 2 CHAR 6 N N N
| DSN8810 ACT ACTDESC 3 VARCHAR 20 N N N
| DSN8810 DEMO_UNICODE LOWER_A_TO_Z 1 CHAR 26 Y Y N
| DSN8810 DEMO_UNICODE UPPER_A_TO_Z 2 CHAR 26 Y Y N
| DSN8810 DEMO_UNICODE ZERO_TO_NINE 3 CHAR 10 Y Y N
| DSN8810 DEMO_UNICODE X00_TO_XFF 4 VARCHAR 256 Y Y N
| DSN8810 DEPT DEPTNO 1 CHAR 3 N N N
| DSN8810 DEPT DEPTNAME 2 VARCHAR 36 N N N
| DSN8810 DEPT MGRNO 3 CHAR 6 Y Y N
| DSN8810 DEPT ADMRDEPT 4 CHAR 3 N N N
| DSN8810 DEPT LOCATION 5 CHAR 16 Y Y N
| DSN8810 EACT ACTNO 1 SMALLINT 2 N N N

Figure 387. Columns panel (ADB21C)

The fields on this panel are:


SEL
Input field where you enter one of the line commands listed on the panel.
| SCHEMA
Schema of the table or view that contains the column
NAME
Name of the table or view that contains the column.
COLUMN NAME
Name of the column.
COL NO
Numerical position of the column in the table or view.
COL TYPE
Type of column, which is one of the following data types:
INTEGER
Large integer
SMALLINT
Small integer

Chapter 25. System catalog panels 553


FLOAT
Floating-point
CHAR
Fixed-length character string
VARCHAR
Varying-length character string
LONGVAR
Varying-length character string
DECIMAL
Decimal
GRAPHIC
Fixed-length graphic string
VARG Varying-length graphic string
LONGVARG
Varying-length graphic string
DATE Date
TIME Time
TIMESTMP
Time stamp
BLOB Binary large object
CLOB Character large object
DBCLOB
Double-byte character large object
ROWID
Row ID data type
DISTINCT
distinct type
LENGTH
Length attribute of the column or, in the case of a decimal column, its
precision. The number does not include internal prefixes to record actual
length and null state (where these are applicable).
N This field indicates whether the column can contain null values. This field
contains one of the following values:
Y Yes
N No
D Default value for the column. This field contains one of the following values:
N None
Y Yes
B Yes
1–6 User-defined defaults
S SQLID
U USER
A Generated always
D Generated by default
I As identity and generated always
J As identity and generated as default
F This field indicates whether the column has a field procedure. This field
contains one of the following values:
Y Yes
N No

554 User's Guide and Reference


Related reference
“The System Catalog panel” on page 546

Option D. Databases
The Databases panel displays the databases in the DB2 catalog.

Select option D on the System Catalog panel to display the Databases panel, as
shown in the following figure.

The following figure shows the Databases panel.

DB2 Admin ------------------- DB2X Databases --------------------- Row 1 of 25


Command ===> Scroll ===> PAGE

Commands: GRANT MIG DIS STA STO UTIL


Line commands:
T - Tables S - Table spaces X - Indexes G - Storage group ICS - IC status
DIS - Display database STA - Start database STO - Stop database A - Auth
? - Show all line commands
Storage Buffer Created Index
Select Name Owner Group Pool DBID By T E Buffer Pool I
* * * * * * * * * *
------ -------- -------- -------- -------- ------ -------- - - ----------- -
ADBDCH ADB ADBGCH BP1 271 ISTFL2 E BP2 N
DBEDB1 DPGROTH SYSDEFLT BP1 272 DPGROTH E BP2 N
DBEDB2 DPGROTH SYSDEFLT BP1 273 DPGROTH E BP2 N
DSNDB04 SYSIBM SYSDEFLT BP1 4 SYSIBM BP2 N
DSNDB06 SYSIBM 6 SYSIBM E BP0 N
DSNDB07 DSCGDB2 SYSDEFLT BP1 7 ISTJE W BP2 N
DSNRGFDB DSCGDB2 SYSDEFLT BP1 257 ISTJE E BP2 N
DSNRLST DSCGDB2 SYSDEFLT BP1 256 ISTJE E BP2 N
DSN8D81A DSCGDB2 DSN8G810 BP0 258 ISTJE E BP2 N
DSN8D81E DSCGDB2 DSN8G810 BP1 260 ISTJE U BP2 N
DSN8D81P DSCGDB2 DSN8G810 BP0 259 ISTJE E BP2 N
DSN8D81U DSCGDB2 DSN8G81U BP1 261 ISTJE E BP2 N
DSQDBCTL DPGROTH SYSDEFLT BP1 266 DPGROTH E BP2 N
DSQDBDEF DPGROTH SYSDEFLT BP1 267 DPGROTH E BP2 N
DSQ1STBB DPGROTH SYSDEFLT BP1 265 DPGROTH E BP2 N
ISTJED ISTJE ISTJEG BP1 269 ISTJE E BP2 N
MAPD1 ISTJE ISTJEG BP1 276 ISTJE E BP2 N
MAPD2 ISTJE ISTJEG BP1 277 ISTJE E BP2 N
RAADB DPGROTH SYSDEFLT BP1 268 DPGROTH E BP2 N
RDBIDB1 DPGROTH SYSDEFLT BP1 262 DPGROTH E BP2 N
RDBIDB2 DPGROTH SYSDEFLT BP1 263 DPGROTH E BP2 N
RDBIDB3 DPGROTH SYSDEFLT BP1 264 DPGROTH E BP2 N
TFLDB ISTFL2 TFLSG BP1 270 ISTFL2 E BP2 N
XXXXX ISTJE ISTJEG BP1 274 ISTJE E BP2 N
YYYYY ISTJE ISTJEG BP1 275 ISTJE E BP2 N
******************************* END OF DB2 DATA *******************************

Figure 388. Databases panel (ADB21D)

The following primary commands are valid on this panel:


GRANT
Issues a GRANT command on multiple databases.
MIG
Issues a MIG command on multiple databases.
DIS
Issues a DB2 DISPLAY command on multiple databases.
STA
Issues a DB2 START command on multiple databases.

Chapter 25. System catalog panels 555


STO
Issues a DB2 STOP command on multiple databases.
UTIL
Selects the table spaces for multiple databases for which to generate utility JCL.

If the size of the statements generated by the GRANT, DIS, STA, or STO primary
command exceeds 32K (an ISPF limit), you will be prompted to send the
statements to a batch job or a work statement list (WSL).

If the number of statements generated by the DIS, STA, or STO primary command
exceeds 10, you will be prompted to send the statements to a batch job or a WSL.

Recommendation: Primary commands operate on each row that is displayed in


the table. If you want to omit some of the rows before you
issue the primary command, use the minus (-) line command to
remove rows from the display. The primary commands operate
only on rows that are listed.

The fields on this panel are:


SELECT
Input field where you enter one of the line commands listed on the panel.
NAME
Name of the database.
OWNER
Authorization ID of the owner of the database.
STORAGE GROUP
Name of the default storage group for the database. For system databases, this
field is blank.
BUFFER POOL
Name of the default buffer pool for the database. For system databases, this
field is blank.
DBID
Internal ID for the database.
CREATED BY
Primary authorization ID of the user who created the database.
T Type of database, which is one of the following values:
W Work file
T Temporary database
blank Not a work file database or a temporary database
E Type of encoding, which is one of the following values:
E EBCDIC
A ASCII
U Unicode
blank Work file or temporary database
INDEX BUFFER POOL
Name of the default buffer pool for indexes.
| I Implicitly-created database: Y-YES N-NO

| Note: The DDL reader does not communicate with DB2. Therefore, the
| DDL reader is unable to acquire defaults established by the

556 User's Guide and Reference


| customer for table space buffer pool, compression and index
| buffer pool, and pad index. The defaults used are those used
| prior to DB2 Version 9.
Related tasks
“Creating a database” on page 154
“Creating a table space” on page 155
Related reference
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Option DS. Database Structures


When you select option DS, the Database Structures panel displays a structured list
of objects in the database that you have selected but does not display plans and
packages.

Select option DS on the System Catalog panel to display the Database Structures
panel, as shown in the following figure. You must enter a value in the Name field
prior to selecting the DS option. Otherwise, you will receive the following
message: Invalid for this option.

The following object types are displayed on the Database Structures panel:
v Databases
v Table spaces
v Tables
v Materialized query tables
v Indexes
v Aliases
v Views on a table
v Synonyms on a table
v Triggers
v Check conditions
v Unique constraints
v Referential constraints (parents)
v Referential constraints (children)

Views on a view and authorizations are not included in this display.

The following figure shows the Database Structures panel without plans and
packages displayed.

Chapter 25. System catalog panels 557


DB2 Admin --------------- DB2X Database Structures --------- Row 1 to 35 of 35
Command ===> Scroll ===> PAGE

Line commands: S - Show object DSN - Data sets


PSID/
Sel Type Object Name Qualifier DBID ISOBID OBID Note
* * * * * * *
--- ------ -----------------------> -------- ------ ------ ------ -------------
D----- PJMDBPLN---------------- 375 0 0
S PJS1 PJMDBPLN 375 2 1
T PJS1T1 MARINO 375 0 3
Y PJS1T1Y1 MARINO 0 0 0
Y PJS1T1Y2 MARINO 0 0 0
CHK PJCHK1 375 0 20
T PJS1T2 MARINO 375 0 7
ALI PJS1T2A1 MARINO 0 0 0
X PJS1T2X1 MARINO 375 14 13
MQT PJMMQT1 MARINO 0 0 0
V PJS1T2V1 MARINO 0 0 0
V PJS1T2V2 MARINO 0 0 0
T X.F WONG 375 0 17
S PJS2 PJMDBPLN 375 5 4
T PJS2T1 MARINO 375 0 6
ALI PJS2T1A1 MARINO 0 0 0
Y PJS2T1Y1 MARINO 0 0 0
Y PJS2T1YY MARINO 0 0 0
UC PJUCC5 0 0 0 Unique key
X PJS2T1X MARINO 375 21 19
S PJS3 PJMDBPLN 375 9 8
T PJS3T1 MARINO 375 0 10
Y PJS3T1Y1 MARINO 0 0 0
PAR PJS3T1FK 0 0 29
CHK PJCHKX 375 0 18
X PJS3T1X MARINO 375 26 25
X PJS3T1X1 MARINO 375 12 11
V PJS3T1V1 MARINO 0 0 0
V PJS3T1V2 MARINO 0 0 0
S PJS4 PJMDBPLN 375 16 15
S PJS5 PJMDBPLN 375 23 22 Partitioned
T PJS5T1 MARINO 375 0 24
CHR PJS3T1FK 0 0 29
UC C1 0 0 0 Primary key
X PJS5T1X MARINO 375 28 27
******************************* END OF DB2 DATA *******************************

Figure 389. Database Structures panel (ADB21DS) without plans and packages displayed

The fields on this panel are:


SELECT
Input field where you enter line command S to show an object.
TYPE
Type of object, which is one of the following:
ALI Alias
CHK Check Constraint
CHR Referential constraint: parent to child
D Database
J Trigger
K View (shown only for the DSP command)
MQT Materialized query table (treated as a table when preceded by two
blanks in the Type field and as a view when preceded by three blanks)
P Plan (shown only for the DSP command)
PAR Referential constraint: child to parent
S Table Space
T Table
UC Unique Constraint
V View
558 User's Guide and Reference
X Index
Y Synonym
OBJECT NAME
Name of the object.
QUALIFIER
DB2 qualifier for the object, if relevant.
DBID
Internal identifier of the database.
PSID/ISOBID
Internal identifier of the table space page set descriptor or index page set
descriptor.
OBID
Identifier for the object's internal descriptor.
Related reference
“The System Catalog panel” on page 546
“Option DSP. Database Structures with Plans and Packages”

Option DSP. Database Structures with Plans and Packages


When you select option DSP, the Database Structures panel shows plans and
packages that are dependent on the table spaces, tables, views, indexes, aliases,
and synonyms.

Select option DSP on the System Catalog panel to display the Database Structures
panel, as shown in the following figure, that includes showing the plans and
packages that are dependent on the table spaces, tables, views, indexes, aliases,
and synonyms.

In the Database Structures panel, plans (P) and packages (K) are indented under
the object upon which they are dependent. To eliminate repetitiveness in the
display, a dependency on a table is not shown if it is already reported under a
view, alias, synonym, or index for the table. Likewise, a dependency for a table
space is not shown if it is already reported under a table.

You must enter a value in the Name field prior to selecting the DSP option.
Otherwise, you will receive the message, Invalid for this option.

The following figure shows the Database Structures panel with plans and packages
displayed.

Chapter 25. System catalog panels 559


DB2 Admin --------------- DB2X Database Structures --------- Row 1 to 35 of 72
Command ===> Scroll ===> PAGE

Line commands: S - Show object DSN - Data sets


PSID/
Sel Type Object Name Qualifier DBID ISOBID OBID Note
* * * * * * *
--- ------ -----------------------> -------- ------ ------ ------ -------------
D----- PJMDBPLN---------------- 375 0 0
S PJS1 PJMDBPLN 375 2 1
T PJS1T1 MARINO 375 0 3
Y PJS1T1Y1 MARINO 0 0 0
K PLISQL PLISQL 0 0 0
K PLISQL PLISQL3 0 0 0
K PLISQL3 PLISQL3 0 0 0
P PLISQLP2 0 0 0
Y PJS1T1Y2 MARINO 0 0 0
K PLISQL PLISQL 0 0 0
K PLISQL PLISQL3 0 0 0
K PLISQL3 PLISQL3 0 0 0
P PLISQLP2 0 0 0
CHK PJCHK1 375 0 20
P PLISQLPL 0 0 0
T PJS1T2 MARINO 375 0 7
ALI PJS1T2A1 MARINO 0 0 0
K PLISQL PLISQL 0 0 0
K PLISQL PLISQL3 0 0 0
K PLISQL3 PLISQL3 0 0 0
P PLISQLP2 0 0 0
X PJS1T2X1 MARINO 375 14 13
MQT PJMMQT1 MARINO 0 0 0
K PLISQL PLISQL 0 0 0
K PLISQL PLISQL3 0 0 0
K PLISQL3 PLISQL3 0 0 0
P PLISQLPM 0 0 0
V PJS1T2V1 MARINO 0 0 0
K PLISQL PLISQL 0 0 0
K PLISQL PLISQL3 0 0 0
K PLISQL3 PLISQL3 0 0 0
P PLISQLP2 0 0 0
P PLISQLP3 0 0 0
V PJS1T2V2 MARINO 0 0 0
T X.F WONG 375 0 17

Figure 390. Database Structures panel (ADB21DS) with plans and packages displayed

Related reference
“Option DS. Database Structures” on page 557
“The System Catalog panel” on page 546

Option E. User-Defined Data Types


Use the Data Types panel to display information about the data types in the DB2
catalog.

Select option E on the System Catalog panel to display the Data Types panel, as
shown in the following figure.

On the Data Types panel, you can reverse engineer DB2 objects.

560 User's Guide and Reference


DB2 Admin ------------------- DB2X Data Types -------------------- Row 1 of 17
Command ===> Scroll ===> PAGE

Commands: GRANT
Line commands:
T - Tables A - Auth AH - Schema auth GR - Grant DROP - Drop COM - Comment
I - Interpret CRE - Create data type GEN - Generate DDL DDL - Object DDL
| REP - Report RO - Role

Source
S Schema Data Type Name Schema Source Data Type Length Scale
* * * * * *
---- -------> -----------------> -------- ------------------ ----------- ------
ISTJE250 KR SYSIBM DECIMAL 15 2
ISTJE T-INT2 SYSIBM INTEGER 4 0
ISTJE T-SMI SYSIBM SMALLINT 2 0
ISTJE T-INT SYSIBM INTEGER 4 0
ISTJE T-REAL SYSIBM REAL 4 0
ISTJE T-DOUBLE SYSIBM DOUBLE 8 0
ISTJE T-FLOAT7-OVERTESTM SYSIBM DOUBLE 8 0
ISTJE T-CHAR SYSIBM CHAR 100 0
ISTJE T-VARCHAR SYSIBM VARCHAR 100 0
ISTJE T-CLOB SYSIBM CLOB 1024 0
ISTJE T-BLOB SYSIBM BLOB 1024 0

Figure 391. Data Types panel (ADB21E)

The following primary command is valid on this panel:


GRANT
Issues a GRANT command on multiple user-defined data types.

Recommendation: The GRANT command operates on each row that is


displayed in the table. If you want to omit some of the
rows before you issue the command, you can use the minus
(-) line command to remove rows from the display. The
GRANT command operates only on rows that are listed.

The fields on this panel are:


S Input field where you enter one of the line commands listed on the panel.
SCHEMA
Schema of the data type.
DATA TYPE NAME
Name of the data type.
SOURCE SCHEMA
Schema of the source data type.
SOURCE DATA TYPE
Name of the source data type for this distinct data type.
LENGTH
Maximum length for the data type, or precision for distinct types.
SCALE
Scale for distinct data types, based on the built in decimal type.

Chapter 25. System catalog panels 561


Related reference
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Option F. Functions
Use the Functions panel to display information about the functions in the DB2
catalog.

Select option F on the System Catalog panel to display the Functions panel, as
shown in the following figure.

On the Functions panel, you can reverse engineer DB2 objects.

| DB2 Admin -------------------- DB2X Functions -------------------- Row 1 of 26


| Command ===> Scroll ===> PAGE
|
| Commands: GRANT
| Line commands:
| AH - Schema auth A - Auth DROP - Drop AL - Alter K - Package PA - Parms
| RT - Return type DIS - Display STO - Stop STA - Start GEN - Generate DDL
| COM - Comment I - Interpret CRE - Create func GR - Grant JAR - JAVA detail
| DDL - Object DDL REP - Report ENV - Environment RO - Role
| D S
| F E E C P Q S P E External
| Sel Schema Name Specific Name O T Parms T A F S F L R T S Name
| * * * * * * * * * * * * * * * *
| ---- -------> -------> -----------------> - - ------ - - - - - - - - - --------
| DSN8 ALTDATE DSN8DUADV E S 1 Y N N D Y N N S D DSN8DUAD
| DSN8 DAYNAME DSN8EUDND U S 1 N
| DSN8 MONTHNAM DSN8EUMNV E S 1 Y N N D Y N N S D DSN8EUMN
| DSN8 ALTDATE DSN8DUCDVVV E S 3 Y N N D Y N N S D DSN8DUCD
| DSN8 ALTDATE DSN8DUCDDVV U S 3 N
| DSN8 ALTTIME DSN8DUATV E S 1 Y N N D Y N N S D DSN8DUAT
| DSN8 ALTTIME DSN8DUCTVVV E S 3 Y N N D Y N N S D DSN8DUCT
| DSN8 ALTTIME DSN8DUCTTVV U S 3 N
| DSN8 CURRENCY DSN8DUCYFV E S 2 Y N N D Y N N M D DSN8DUCY
| DSN8 CURRENCY DSN8DUCYFVV E S 3 Y N N D Y N N M D DSN8DUCY
| DSN8 DAYNAME DSN8EUDNV E S 1 Y N N D Y N N S D DSN8EUDN
| DSN8 MONTHNAM DSN8EUMND U S 1 N
| DSN8 TABLE_NA DSN8DUTINV E S 1 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_NA DSN8DUTINVV E S 2 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_NA DSN8DUTINVVV E S 3 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_SC DSN8DUTISV E S 1 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_SC DSN8DUTISVV E S 2 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_SC DSN8DUTISVVV E S 3 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_LO DSN8DUTILV E S 1 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_LO DSN8DUTILVV E S 2 Y N N D Y R N M D DSN8DUTI
| DSN8 TABLE_LO DSN8DUTILVVV002260 E S 3 Y N N D Y R N M D DSN8DUTI
| DSN8 WEATHER DSN8DUWFV E T 1 Y N N D Y N N S D DSN8DUWF
| ISTFL20D FFF2 FFF2 E S 4 N E N D Y R N S D OLSEN
| ISTJE CD CD S S 1 Y
| ISTJE INTEGER INTEGER S S 1 Y
| ISTJE CD2 CD2 E S 1 N E N D Y R N S D CD2
| ******************************* END OF DB2 DATA *******************************

Figure 392. Functions panel (ADB21F)

The following primary command is valid on this panel:


GRANT
Issues a GRANT command on multiple functions.

562 User's Guide and Reference


Recommendation: The GRANT command operates on each row that is
displayed in the table. If you want to omit some of the
rows before you issue the command, you can use the minus
(-) line command to remove rows from the display. The
GRANT command operates only on rows that are listed.

The fields on this panel are:


SEL
Input field where you enter one of the line commands listed on the panel.
SCHEMA
Schema of the function.
NAME
Name of the function.
SPECIFIC NAME
Specific name of the function.
O Origin of the function, which is one of the following values:
E External
U Sourced
S System generated
Q SQL
FT Function type, which is one of the following types:
C Column
S Scaler
T Table
PARMS
Number of parameters for the function.
DET
This field indicates whether the external function is deterministic (that is,
returns the same result when called using the same parameters). This field
contains one of the following values:
Y Yes
N No
blank The routine is a function, but not an external function.
EA
This field indicates whether the external function changes the state of an object
that DB2 does not manage. This field contains one of the following values:
E Yes
N No
blank The routine is a stored procedure.
CF
Cast function, which is one of the following values:
Y Yes
N No
PS Parameter style, which is one of the following values:
D DB2SQL
G General
N General with nulls
J Java
blank Not external or user-defined function.

Chapter 25. System catalog panels 563


F Fenced (applies if it is run separately from DB2). This field contains one of the
following values:
Y Runs separately from DB2.
blank Does not run separately from DB2.
SQL
This field indicates whether SQL statements are allowed, which is one of the
following values:
N Contains no SQL statements
C Contains SQL statements
R Reads SQL data
M Modifies SQL data
blank Not applicable.
SR
This field indicates whether the program should remain resident when it ends.
This field contains one of the following values:
Y Program remains resident
N Program does not remain resident
blank Not external or user-defined function.
PT
Program type, which is one of the following types:
M Main
S Subroutine
blank Not external or user-defined function.
ES External security, which is one of the following values:
D DB2 address space user
U User
C Definer
blank Not external or user-defined function.
EXTERNAL NAME
Load module name for the stored procedure. This field is blank if it is not an
external or user-defined function.
Related reference
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Option G. Storage Groups


The Storage Groups panel displays the storage groups in the DB2 catalog.

Select option G on the System Catalog panel to display the Storage Groups panel,
as shown in the following figure.

564 User's Guide and Reference


| DB2 Admin ----------------- DB2X Storage Groups ------------------- Row 1 of 6
| Command ===> Scroll ===> PAGE
|
| Line commands:
| D - Databases S - Table spaces X - Indexes VOL - Volumes I - Interpret
| GR - Grant DROP - Drop CRE - Create AL - Alter UT - Utility A - Auth
| DDL - Generate DDL GEN - Generate SQL REP - Report RO - Role
|
| SP
| Select Name Owner VCAT Space Date
| * * * * *
| ------ -------> -------- -------- ----------- -----
| ADBGCH ADB DB2X 0
| DSN8G81U DSCGDB2 DB2X 0
| DSN8G810 DSCGDB2 DB2X 0
| ISTJEG ISTJE DB2X 0
| SYSDEFLT DSCGDB2 DB2X 0
| TFLSG ISTFL2 DB2X 0
| ******************************* END OF DB2 DATA *******************************

Figure 393. Storage Groups panel (ADB21G)

The fields on this panel are:


SELECT
Input field where you enter one of the line commands listed on the panel.
NAME
Name of the storage group.
OWNER
Authorization ID of the owner of the storage group.
VCAT
Name of the VSAM or ICF catalog.
SPACE
Kilobytes (KB) of storage allocated for the storage group as determined by the
STOSPACE utility the last time it was run. A value of -1 indicates that the
utility has never been run.
SP DATE
Date when the Space field was last updated, in the form YYDDD.
Related reference
“The System Catalog panel” on page 546

Option H. Schemas
Use the Schemas panel to display the schemas in the DB2 catalog.

Select option H on the System Catalog panel to display the Schemas panel, as
shown in the following figure.

On the Schemas panel, you can reverse engineer DB2 objects.

Chapter 25. System catalog panels 565


DB2 Admin --------------------- DB2X Schemas ---------------------- Row 1 of 7
Command ===> Scroll ===> PAGE

Line commands:
E - Data type F - Function J - Trigger O - Stored procedure A - Auth
| GR - Grant GEN - Generate DDL REP - Report Q - Sequence

Number of Number of Number of Number of Number of


S Schema Data Types Functions Procedures Triggers Sequences
* * * * * *
--- -------> ----------- ----------- ----------- ----------- -----------
ADB 0 0 1 0 0
DSN8 0 22 1 0 0
ISTFL 0 0 0 4 0
ISTFL2 0 1 1 6 2
ISTJE 1 4 1 1 0
SQLJ 0 0 3 0 0
SYSPROC 0 0 4 0 0
******************************* END OF DB2 DATA *******************************

Figure 394. Schemas panel (ADB21H)

The fields on this panel are:


S Input field where you enter one of the line commands listed on the panel.
Schema
Schema of the data type.
Number of Data Types
Number of distinct data types defined in this schema.
Number of Functions
The number of user-defined functions and implicitly-defined functions in this
schema.
Number of Procedures
Number of stored procedures defined in this schema.
Number of Triggers
Number of table triggers defined in this schema.
Number of Sequences
Number of sequences defined in this schema. To view the sequences, issue the
Q line command against a schema that contains a number of sequences in the
Number of Sequences column. The Sequence Objects panel is displayed (see
Figure 413 on page 590).
Related reference
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Option J. Triggers
Use the Triggers panel to display information about the triggers in the DB2 catalog.

Select option J on the System Catalog pane to display the Triggers panel, as shown
in the following figure.

566 User's Guide and Reference


| DB2 Admin -------------------- DB2X Triggers --------------------- Row 1 of 11
| Command ===> Scroll ===> PAGE
|
| Line commands:
| T - Table A - Schema auth I - Interpretation DROP - Drop K - Package
| SQ - SQL COM - Comment GEN - Generate DDL DDL - Object DDL REP - Report
| D - Database ENV - Environment V - View RO - Role
| Table/ Table/
| View View Created
| S Schema Name Schema Name T E G By
| * * * * * * * *
| ---- -------- -------- -------- ------------------ - - - --------
| ISTFL2 TTT ISTFL2 WWW A U S ISTFL2
| ISTFL2 TRIG1 ISTFL2 TRI2 A U R ISTFL2
| ISTFL2 TRIG2 ISTFL2 TRI2 A U R ISTFL2
| ISTFL2 TRIG5 ISTFL2 TRI2 A U R ISTFL2
| ISTFL2 TRIG3 ISTFL2 TRI2 A U R ISTFL2
| ISTFL TRIG1 ISTFL TRI2 A U R ISTFL
| ISTJE TESTRR ISTJE TDECP B I R ISTJE
| ISTFL2 TRIG4 ISTFL2 TRI2 A U R ISTFL2
| ISTFL TRIG2 ISTFL TRI2 A U R ISTFL
| ISTFL TRIG3 ISTFL TRI2 A U R ISTFL
| ISTFL TRIG4 ISTFL TRI2 A U R ISTFL
| ***********************END OF DB2 DATA *******************************

Figure 395. Triggers panel (ADB21J)

The fields on this panel are:


S Input field where you enter one of the line commands listed on the panel.
SCHEMA
Name of the schema.
NAME
Name of the trigger.
| TABLE/VIEW SCHEMA
Schema of the table or view to which this trigger applies.
| TABLE/VIEW NAME
Name of the table or view to which this trigger applies.
T Trigger time, which is one of the following values:
A After
B Before
| I Instead of
E Trigger event, which is one of the following values:
I Insert
U Update
D Delete
G Granularity of the trigger, which is one of the following values:
R For each row
S For each statement
CREATED BY
Primary authorization ID of the user who created the trigger.
Related reference
“The System Catalog panel” on page 546

Option K. Packages
The Packages panel displays the packages in the DB2 catalog.

Chapter 25. System catalog panels 567


Select option K on the System Catalog panel to display the Packages panel, as
shown in the following figure.

| ADB21K in ------------------- DB2X Packages --------------- Row 1 to 30 of 104


| Command ===> ________________________________________________ Scroll ===> PAGE
|
| Commands: BIND REBIND FREE VERSIONS GRANT ALL PLANMGMT
| Line commands:
| DP - Depend A - Auth T - Tables V - Views X - Indexes S - Table spaces
| Y - Synonyms RB - Rebind F - Free B - Bind BC - Bind copy GR - Grant
| EN -Enab/disab con PL - Package lists P - Local plans LP - List PLAN_TABLE
| I - Interpret SQ - SQL in package VE - Versions D - Databases RO - Role
| V I V O Quali- R E D
| S Collection Name Owner Version (trunc) D S A P fier L X R
| * * * * * * * * * * * *
| -- ------------------ -------- -------- ---------------- - - - - -------- - - -
| __ DSNTIAD DSNTIAD LLEGARD R S Y Y LLEGARD N
| __ DSNREXX DSNREXX LLEGARD V10R1 B S Y Y LLEGARD N
| __ DSNREXUR DSNREXX LLEGARD V10R1 B U Y Y LLEGARD N
| __ DSNREXCS DSNREXX LLEGARD V10R1 B S Y Y LLEGARD N
| __ DSNREXRS DSNREXX LLEGARD V10R1 B T Y Y LLEGARD N
| __ DSNREXRR DSNREXX LLEGARD V10R1 B R Y Y LLEGARD N
| __ DSNTIAP DSNTIAP DB2ADM R Y Y DB2ADM N
| __ DSNESPCS DSNESM68 DB2ADM R S Y Y DB2ADM N
| __ DSNESPRR DSNESM68 DB2ADM R R Y Y DB2ADM N
| __ DSNESPUR DSNESM68 DB2ADM R U Y Y DB2ADM N
| __ DSNEDCL DSNECP68 DB2ADM V10R1 R S Y Y DB2ADM N
| __ DSNUTIL DSNUGSQL DB2ADM V10R1 B S Y Y DB2ADM N
| __ DSNUT101 DSNUGSQL DB2ADM V10R1 B S Y Y DB2ADM N
| __ DSNADM DSNADMJF LLEGARD V10R1 R S Y Y LLEGARD N
| __ DSNADM DSNADMTA LLEGARD V10R1 R S Y Y LLEGARD C N
| __ DSNADM DSNADMTR LLEGARD V10R1 R S Y Y LLEGARD C N
| __ DSNADM DSNADMTU LLEGARD V10R1 R S N Y LLEGARD C N

Figure 396. Packages panel (ADB21K)

The following primary commands are valid on this panel:


BIND
Issues a BIND command on multiple packages. When you attempt to bind
more than 20 packages, DB2 Admin prompts you to specify either a work
statement list or a batch job to complete the processing.
FREE
Issues a FREE command on multiple packages. When you attempt to free more
than 20 packages, DB2 Admin prompts you to specify either a work statement
list or a batch job to complete the processing.
REBIND
Issues a REBIND command on multiple packages. When you attempt to rebind
more than 20 packages, DB2 Admin prompts you to specify either a work
statement list or a batch job to complete the processing.
When you specify REBIND, the resulting BIND command contains only the
package name. Specify REBIND FULL. If you want the resulting BIND
command to contain the package name and all of the parameters.
VERSIONS
Displays versions of the packages. You can issue one of the following
variations of the VERSIONS command:
VER ON
Displays versions on an additional line.
VER SHORT
Displays versions in the fifth column of the display, in a truncated format.
568 User's Guide and Reference
VER OFF
Removes versions from display.
VER
Cycles between the VER ON, VER SHORT, and VER OFF commands.
GRANT
Issues a GRANT command on multiple application packages.
| ALL
| Lists all objects of a specified type for each object in a list of objects. Supported
| values for this panel are:
| ALL T Shows all tables for the listed packages.
| ALL X Shows all indexes for the listed packages.
| PLANMGMT
| Displays the plan management attributes for the package. When the
| PLANMGMT command is used, the panel layout will then include the
| QUALIFIER command.
| QUALIFIER
| Displays the qualifier for the package.

You can also issue the SQ line command to show the SQL statements. These
functions are shown at the end of this subsection.

| Tip: The BIND, REBIND, FREE, GRANT, PLANMGMT, and QUALIFIER


| commands operate on each row that is displayed in the table. If you want to
| omit some of the rows before you issue one of these commands, you can use
| the minus (-) line command to remove rows from the display. The BIND,
| REBIND, FREE, GRANT, PLANMGMT, and QUALIFIER commands operate
| only on rows that are listed.

The fields on this panel are:


S Input field where you enter one of the line commands listed on the panel.
COLLECTION
Name of the package collection.
NAME
Name of the package.
OWNER
Authorization ID of the package owner.
BIND TIMESTAMP
Time stamp that indicates when the package was last bound.
VD
This field indicates whether validity checking can be deferred until run time.
This field contains one of the following values:
B All validity checking must be done during the bind.
R Validity checking is done at run time for tables, views, and privileges
that do not exist at bind time.
IS Isolation level, which is one of the following values:
R Repeatable read
S Cursor stability
T Read stability
U Uncommitted read

Chapter 25. System catalog panels 569


Blank Not specified; therefore, at the level specified for the plan
VA
This field indicates whether the package is valid, that is, whether it can be run
without being rebound. This field contains one of the following values:
Y Yes
N No
OP
This field indicates whether the package can be allocated. This field contains
one of the following values:
Y Yes
N No. Explicit BIND or REBIND is required before the package can be
allocated.
QUALIFIER
Qualifier that was specified at bind time to resolve names.
| Plan Mgmt
| Plan management attribute of the package.
RL
When resources for the package are released. This field contains one of the
following values:
C Resources for the package are released at commit time.
D Resources for the package are released at deallocation time.
Blank The value specified for the package is used.
EX
This field indicates whether the package was bound using EXPLAIN. This field
contains one of the following values:
Y The package was bound using EXPLAIN.
N The package was not bound using EXPLAIN.
DR
Dynamic SQL rules. This field contains one of the following values:
B Use binder's authid and authorizations.
D DEFINEBIND. When the package is run under an active stored
procedure or user-defined function, dynamic SQL statements in the
package are executed with DYNAMICRULES define behavior.
Otherwise, they are executed with DYNAMICRULES bind behavior.
E DEFINERUN. When the package is run under an active stored
procedure or user-defined function, dynamic SQL statements in the
package are executed with DYNAMICRULES define behavior.
Otherwise, they are executed with DYNAMICRULES run behavior.
H INVOKEBIND. When the package is run under an active stored
procedure or user-defined function, dynamic SQL statements in the
package are executed with DYNAMICRULES invoke behavior.
Otherwise, they are executed with DYNAMICRULES bind behavior.
I INVOKERUN. When the package is run under an active stored
procedure or user-defined function, dynamic SQL statements in the
package are executed with DYNAMICRULES invoke behavior.
Otherwise, they are executed with DYNAMICRULES run behavior.
R Use executor's authid and authorizations.
Blank Not specified. Use the dynamic rules of the plan.

570 User's Guide and Reference


Binding packages

Use the B line command (bind package) on the Packages panel to display the Bind
Package panel, as shown in the following figure.

Use the Bind Package panel to build an application package.

Enter your input on the panel.

The following figure shows the Bind Package panel.

Chapter 25. System catalog panels 571


| ADB21KB n ---------------------- DB2X Bind Package ---------------------- 04:57
| Command ===> __________________________________________________________________
|
| More: +
| Verify BIND parameters:
|
| BIND PACKAGE(
| Location . . . . . . ________________ >
| Collection . . . . . ADBLTJ >
| ) OWNER(
| Package owner . . . DSCGBD2 >
| ) QUALIFIER(
| Qualifier . . . . . DSCGBD2 >
| ) LIBRARY(
| DBRM library . . . . 'DMTOOL.ADB72PAR.SADBDBRM'
| ______________________________________________________
| ) MEMBER(
| Name . . . . . . . . ADB2REP
| _______
| ) SQLERROR(
| SQL error action . . C (Continue or Nopackage)
| ) VALIDATE(
| Validation time . . B (Run or Bind, Bind preferred)
| ) ISOLATION(
| Isolation level . . CS (CS, RR, RS, or UR)
| ) RELEASE(
| Release at . . . . . C (Commit, Deallocate, or blank)
| ) EXPLAIN(
| Explain plan . . . . NO (Yes/No)
| ) CURRENTDATA(
| Inhibit blocking . . NO (Yes/No)
| ) ACTION(
| Action on BIND . . . REPLACE (Add or Replace)
| ) REPLVER(
| Replace version . . _________________________________________________________
| _______________________________________________________________________________
| ) ENABLE( (use ? to get current values from the catalog)
| Enable connects . . _________________________________________________________
| ) DISABLE( (use ? to get current values from the catalog)
| Disable connects . . _________________________________________________________
| ) (use ? to get current values from the catalog)
| En/disable names . . _________________________________________________________
| _______________________________________________________________________________
| DEGREE(
| Parallelism . . . . 1 (1 or ANY)
| ) DYNAMICRULES(
| Dynamicirules . . . _ (R, B, D, I, E, H or blank)
| ) KEEPDYNAMIC(
| Keep dynamic SQL . . NO (Yes/No)
| ) DEFER(PREPARE)/NODEFER(PREPARE)
| Defer prepare . . . ___ (Yes/No)
| ) REOPT(NONE!ALWAYS!ONCE!AUTO)
| Re-opt at exec . . . NONE (N-None/Y-Always/1-Once/A-Auto)
| ) DBPROTOCOL(
| 3 part protocol . . D (Drda or Private)
| ) OPTHINT(
| Access path hint . . ________ > (hint id)
| ) PATH(
| UDT/UDF/STP path . . _________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| ) ENCODING(
| Scheme or CCSID . . 37 (ASCII, EBCDIC, UNICODE or ccsid)
| ) IMMEDWRITE(
| Immedwrite . . . . . NO (Yes, No, PH1)
| ) ROUNDING(
| Decimal rounding . . _______ (CEILING,DOWN,FLOOR,HALFDOWN,HALFEVEN,HALUP,UP)
| )
||
| Figure 397. Bind Package panel (ADB21KB)
|

572 User's Guide and Reference


Rebinding packages

Use the RB line command (rebind package) on the Packages panel to display the
Rebind Package panel, as shown in the following figure.

Use the Rebind Package panel to rebind an application package when changes
have been made that affect the package, but the SQL statements in the program
have not changed.

| The PLANMGMT option should be OFF or BLANK when a REBIND of a package


| is changed to a different OWNER or QUALIFIER. For example, when the OWNER
| is changed from SYSADM to ADMF001.

Chapter 25. System catalog panels 573


| ADB21KR n --------------------- DB2X Rebind Package --------------------- 03:12
| Command ===> __________________________________________________________________
|
| More: +
| Verify REBIND parameters:
|
| REBIND PACKAGE(
| Location . . . . . . ______________ >
| Collection . . . . . ADBLTJ >
| Package . . . . . . ADB2REM >
| (
| Version . . . . . . _________________________________________________________
| _______
| )) OWNER(
| Package Owner . . . DSCGBD2 >
| ) QUALIFIER(
| Qualifier . . . . . QUALIFIE
| ) VALIDATE(
| Validation time . . B (Run or Bind, Bind preferred)
| ) ISOLATION(
| Isolation level . . CS (CS, RR, RS, or UR)
| ) RELEASE(
| Release at . . . . . C (Commit, Deallocate, or blank)
| ) EXPLAIN(
| Explain plan . . . . YES (Yes/No)
| ) CURRENTDATA(
| Inhibit blocking . . NO (Yes/No)
| ) ENABLE( (use ? to get current values from the catalog)
| Enable connects . . _________________________________________________________
| ) DISABLE( (use ? to get current values from the catalog)
| Disable connects . . _________________________________________________________
| ) (use ? to get current values from the catalog)
| En/disable names . . _________________________________________________________
| _______________________________________________________________________________
| DEGREE(
| Parallelism . . . . 1 (1 or ANY)
| ) DYNAMICRULES(
| Dynamic rules . . . _ (R, B, D, I, E, H or blank)
| ) KEEPDYNAMIC(
| Keep dynamic SQL . . NO (Yes/No)
| ) DEFER(PREPARE)/NODEFER(PREPARE)
| Defer prepare . . . ___ (Yes/No)
| ) REOPT(NONE!ALWAYS!ONCE!AUTO)
| Re-opt at exec . . NONE (N-None/Y-Always/1-Once/A-Auto)
| ) DBPROTOCOL(
| 3 part protocol . . D (Drda or Private)
| ) OPTHINT(
| Access path hint . . ________ > (hint id)
| ) PATH(
| UDT/UDF/STP path . . _________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| ) ENCODING(
| Scheme or CCSID . . 37 (ASCII, EBCDIC, UNICODE or ccsid)
| ) IMMEDWRITE(
| Immedwrite . . . . . NO (Yes, No, PH1)
| ) PLANMGMT(
| PLAN management . . ________ (Off, Basic, Extended)
| ) SWITCH(
| Restore copy . . . . ________ (Original, Previous)
| ) ROUNDING(
| Rounding mode . . . ________ (CEILING,DOWN,FLOOR,HALFDOWN,HALFEVEN,HALUP,UP) )
| )
||
| Figure 398. Rebind Package panel (ADB21KR)
|
Freeing packages

Use the F line command (free package) on the Packages panel to display the Free
Package panel, as shown in the following figure.
574 User's Guide and Reference
Use the Free Package panel to delete a specific version of a package, all versions of
a package, or whole collections of packages.

Enter your input on the panel.

| B21KF n ---------------------- DB2X Free Package ---------------------- 03:28


| Command ===> __________________________________________________________________
|
|
| FREE PACKAGE (
|
| Location . . . ________________ > (Blank for local)
|
| Collection . . ADBLTJ >
|
| Name . . . . . ADB2REP >
|
| (
| Version . . . . ______________________________________________________________
| __
| )) PLANMGMTSCOPE(
| Scope . . . . . ________ (All, Inactive)
| )
|
|
| Figure 399. Free Package panel (ADB21KF)
|
CAUTION:
If you specify an asterisk (*) for collection, all packages with the specified name
and version number are freed. If you specify a collection name and an * for both
Name and Version, all packages in that collection are freed. Thus, the use of
asterisks can be very powerful, and should be used carefully.

Viewing extracted SQL for a package

Use the SQ line command (show SQL) on the Packages panel to display the
Extracted SQL panel, as shown in the following figure.

The Extracted SQL panel displays the SQL statements in a package.

DB2 Admin ----------------- Extracted SQL ---------------- Columns 00001 00072


Command ===> Scroll ===> PAGE

****** ***************************** Top of Data ******************************


000001 -- SQL statements in PACKAGE : DSN8DU81.DSN8DUTI.()
000002 -- SQL in stmt: 427
000003 SET :H = CURRENT SQLID
000004 -- SQL in stmt: 438
000005 SELECT TBNAME, TBCREATOR, LOCATION INTO :H, :H, :H FROM
000006 SYSIBM.SYSTABLES WHERE NAME = :H AND CREATOR = :H AND LOCATION LIKE :H
000007 AND TYPE = 'A'
****** **************************** Bottom of Data ****************************

Figure 400. Extracted SQL panel (ADB21KSE)

Chapter 25. System catalog panels 575


Related reference
“The System Catalog panel” on page 546
Related information
IBM Publications Center

Option L. Collections
The Collections panel displays the collections in the DB2 catalog.

A collection is a group of associated packages. Binding packages into package


collections allows you to add packages to an existing application plan without
having to bind the entire plan again.

Displaying collections

Select option L on the System Catalog panel to display the Collections panel, as
shown in the following figure.

On the Collections panel, you can issue the SQ line command to show the SQL
statements. This function is shown in “Viewing extracted SQL for a package in a
collection” on page 577.

The following figure shows the Collections panel.

DB2 Admin ------------------ DB2X Collections -------------------- Row 1 of 27


Command ===> Scroll ===> PAGE

Line commands:
K - Packages in collection PL - Package lists P - Local plans
A - Authorizations GR - Grant SQ - SQL in packages in collection

Number of
S Collection Packages
* *
---- -----------------> -----------
ADBL 6
ADBL21 11
ADBL31 7
ADBV3 3
ADB21 1
DSNEDCL 1
DSNESPCS 1
DSNESPRR 1
DSNHYCRDRDRDABRAGG 1
DSNREXCS 1
DSNREXRR 1
DSNREXRS 1
DSNREXUR 1
DSNREXX 1
DSNTEP2 1
******************************* END OF DB2 DATA *******************************

Figure 401. Collections panel (ADB21L)

The fields on this panel are:


S Input field where you enter one of the line commands listed on the panel.
Collection
Name of the package collection.
Number of Packages
Number of packages in the collection.

576 User's Guide and Reference


Viewing extracted SQL for a package in a collection

The Extracted SQL panel, as shown in the following figure, is displayed when you
issue line command SQ (show SQL) on the Collections panel.

This panel displays the SQL statements in a package shown on the Collections
panel.

The following figure shows the Extracted SQL panel.

DB2 Admin ----------------- Extracted SQL ---------------- Columns 00001 00072


Command ===> Scroll ===> PAGE
Max no of rows reached
****** ***************************** Top of Data ******************************
000001 -- SQL statements in PACKAGE : ADBL31.ADBMAIN.()
000002 -- SQL in stmt: 605
000003 COMMIT WORK
000004 -- SQL in stmt: 2601
000005 DECLARE S1 STATEMENT
000006 -- SQL in stmt: 2643
000007 PREPARE S1 FROM :H
000008 -- SQL in stmt: 2747
000009 DESCRIBE S1 INTO :H
000010 -- SQL in stmt: 2759
000011 EXECUTE S1
000012 -- SQL in stmt: 2884
000013 DECLARE C1 CURSOR FOR S1
000014 -- SQL in stmt: 2890
000015 OPEN C1
000016 -- SQL in stmt: 2902
000017 FETCH C1 USING DESCRIPTOR :H
000018 -- SQL in stmt: 2973
000019 CLOSE C1
000020 -- SQL in stmt: 5754
000021 COMMIT WORK
000022 -- SQL in stmt: 5781
000023 ROLLBACK WORK
000024 -- SQL in stmt: 5786
000025 COMMIT WORK
000026 -- SQL statements in PACKAGE : ADBL31.ADB2CON.()
000027 -- SQL in stmt: 123
000028 CONNECT RESET
000029 -- SQL in stmt: 128
000030 CONNECT
000031 -- SQL in stmt: 134
000032 CONNECT TO :H
000033 -- SQL statements in PACKAGE : ADBL31.ADB2GEN.()
000034 -- SQL in stmt: 1917
000035 DECLARE C_SYSDAUTH CURSOR FOR SELECT * FROM SYSDBAUTH WHERE NAME = :H
000036 AND GRANTOR <> GRANTEE ORDER BY DATEGRANTED, TIMEGRANTED
000037 -- SQL in stmt: 1931
000038 OPEN C_SYSDAUTH

Figure 402. Extracted SQL panel (ADB21KSE)

Related reference
“The System Catalog panel” on page 546

Option M. DBRMs
Use the DBRMs panel to display the DBRMs in the DB2 catalog.

A DBRM (database request module) is a package list that specifies packages or


collections of packages.

Chapter 25. System catalog panels 577


Displaying DBRMs

Select option M on the System Catalog panel to display the DBRMs panel, as
shown in the following figure.

On the DBRMs panel, you can issue the S line command to show the SQL
statements. This function is shown at the end of this subsection.

DB2 Admin ---------------------- DB2X DBRMs ----------------------- Row 1 of 9


Command ===> Scroll ===> PAGE

Line commands:
P - Plans B - Browse DBRM S - SQL statements I - Interpretation
R - Role
S Name Owner PL Name Q C H P Date P Time PDS Name
* * * * * * * * *
- -------- -------> -------- - - - ------ -------- --------------------------->
DSNTIAD DSCGDB21 DSNTIA81 N N B 010524 02410439 DB2.DSN810.DBRMLIB.DATA
DSNTIAD DSCGDB2 DSNTIAD N N B 010524 02410439 DB2.DSN810.DBRMLIB.DATA
DSNHSPMN ISTJE DSNHSP81 N N B 000831 01445504 DB2.DSN810.SDSNDBRM
DSNTIAUL DSCGDB2 DSNTIB81 N N B 010525 03343066 DB2.DSN810.DBRMLIB.DATA
DSNTIAUL DSCGDB2 DSNTIAUL N N B 010525 03343066 DB2.DSN810.DBRMLIB.DATA
E61PLAN DPGROTH DB2E81 N N P 000706 09255886 DPGROTH.EEE.DBRM
E71TABS DPGROTH DB2E81 N N P 010615 15024195 DPGROTH.EEE.DBRM
E71MAIN DPGROTH DB2E81 N N P 010622 12563103 DPGROTH.EEE.DBRM
E61SERV DPGROTH DB2E81 N N P 000706 13303477 DPGROTH.EEE.DBRM
******************************* END OF DB2 DATA *******************************

Figure 403. DBRMs panel (ADB21M)

The fields on this panel are:


S Input field where you enter one of the line commands listed on the panel.
NAME
Name of the database request module (DBRM).
OWNER
Authorization ID of the owner of the application plan.
PL NAME
Name of the application plan that contains the DBRM.
Q SQL escape character, which is one of the following values:
Y Quotation mark (")
N Apostrophe (')
C Decimal point, which is one of the following values:
Y Comma (,)
N Period (.)
H Host language used, which is one of the following values:
B Assembler
C OS/VS COBOL
D C
F FORTRAN
P PL/I
2 IBM COBOL II or IBM COBOL Release 1
3 IBM COBOL (Release 2 or subsequent releases)
4 C++
P DATE
Date of precompilation of DBRM, in the form YYMMDD.

578 User's Guide and Reference


P TIME
Time of precompilation of DBRM, in the form HHMMSSTH.
PDS NAME
Name of the partitioned data set of which the DBRM is a member.

Viewing extracted SQL for a DBRM

Use the S line command (show SQL) on the DBRMs panel to display the Extracted
SQL panel, as shown in the following figure.

Use the Extracted SQL panel to display the SQL statements in a DBRM.

DB2 Admin ----------------- Extracted SQL ---------------- Columns 00001 00072


Command ===> Scroll ===> PAGE

****** ***************************** Top of Data ******************************


000001 -- SQL statements in DBRM: DSNTIA81.DSNTIAD
000002 -- SQL in stmt: 982
000003 WHENEVER SQLERROR GO TO EXECERR
000004 -- SQL in stmt: 983
000005 WHENEVER SQLWARNING GO TO EXECWRN
000006 -- SQL in stmt: 984
000007 WHENEVER NOT FOUND GO TO EXECWRN
000008 -- SQL in stmt: 1226
000009 CONNECT
000010 -- SQL in stmt: 1278
000011 CONNECT RESET
000012 -- SQL in stmt: 1405
000013 CONNECT TO :H
000014 -- SQL in stmt: 1528
000015 SET CONNECTION :H
000016 -- SQL in stmt: 1649
000017 RELEASE CURRENT
000018 -- SQL in stmt: 1700
000019 RELEASE ALL
000020 -- SQL in stmt: 1780
000021 RELEASE ALL PRIVATE
000022 -- SQL in stmt: 1829
000023 RELEASE ALL SQL
000024 -- SQL in stmt: 1938
000025 RELEASE :H
000026 -- SQL in stmt: 1993
000027 EXECUTE IMMEDIATE :H
****** **************************** Bottom of Data ****************************

Figure 404. Extracted SQL panel (ADB21KSE)

Related reference
“The System Catalog panel” on page 546

Option N. Constraints
The Constraints panel displays the constraints on a table in the DB2 catalog.

Select option N on the System Catalog panel to display the Constraints panel, as
shown in the following figure.

Chapter 25. System catalog panels 579


DB2 Admin ------------------- DB2X Constraints ---------- Row 1 to 12 of 1,000
Command ===> Scroll ===> PAGE
Max no of rows reached
Line commands:
S - Show T - Table

Table
Sel Schema Table Name Constraint Name Type
* * * *
---- -------- ------------------ ----------------------------------------> ----
SYSIBM SYSINDEXPART IXCREATOR U
SYSIBM SYSINDEXSTATS OWNER U
SYSIBM SYSJAROBJECTS JARSCHEMA P
SYSIBM SYSLOBSTATS DBNAME P
SYSIBM SYSTABCONST TBCREATOR P
SYSIBM SYSTABLEPART DBNAME U
SYSIBM SYSTABLESPACE DBNAME P
SYSIBM SYSTABSTATS OWNER U
VNDX01 EMP_PHOTO_RESUME EMPNO P
I2MADMIN ICMUT00302001 COMPKEY P
VNDOXL2 DEPT DEPTNO P
I2MADMIN ICMSTITEMSTODELETE ITEMID P

Figure 405. Constraints panel (ADB21N) – partial display

The fields on this panel are:


Sel
Enter one of the line commands listed on the panel.
| Table Schema
The schema of the table on which the constraint is defined.
Table Name
The name of the table.
Constraint Name
The name of the constraint.
Type
The type of constraint. Possible values are:
P Primary key
U Unique
F Foreign key
Related reference
“The System Catalog panel” on page 546
“Option T. Tables, Views, and Aliases” on page 594

Option O. Stored Procedures


Use the Stored Procedures panel to display information about the stored
procedures in the DB2 catalog.

Select option O on the System Catalog panel to display the Stored Procedures
panel, as shown in the following figure.

580 User's Guide and Reference


| DB2 Admin ---------------- DB2X Stored Procedures ---------------- Row 1 of 11
| Command ===> Scroll ===> PAGE
|
| Commands: GRANT
| Line commands:
| AH - Schema Auth A - Auth DROP - Drop AL - Alter K - Package PA - Parms
| DIS - Display STO - Stop STA - Start GR - Grant COM - Comment
| ? - Show all line commands
| S
| Res Q S P C External
| Sel Schema Name Version A Lang Parms Set O L R T R Name
| * * * * * * * * * * * * *
| ---- -------- ------------------ -------- - ---- ------ --- - - - - - -------->
| SMITHJC PSTYLED C 2 0 E M Y S N PSTYLED
| SMITHJC PSTYLES C 2 0 E M Y S N PSTYLES
| SMITHJC SQLJOLD2 JAVA 0 0 E M Y S N PKG402110
| ACT SMITHJC PJNSP VER1 N SQL 1 0 N M N Y
| SMITHJC PJNSP VER2 Y SQL 1 0 N M N N
| SMITHJC PJNSP VER3 N SQL 1 0 N M N N
| ******************************* END OF DB2 DATA *******************************
||
| Figure 406. Stored Procedures panel (ADB21O)
|
The following primary command is valid on this panel:
GRANT
Issues a GRANT command on multiple stored procedures.

Tip: The GRANT command operates on each row that is displayed in the
table. If you want to omit some of the rows before you issue the
command, you can use the minus (-) line command to remove rows from
the display. The GRANT command operates only on rows that are listed.

The fields on this panel are:


| SEL
| Input field where you enter one of the line commands listed on the panel.
| SCHEMA
| Schema of the stored procedure.
| NAME
| Name of the stored procedure.
| VERSION
| The version identifier for a native SQL procedure.
| A Identifies the active version of a routine.
| LANG
| Implementation language.
| PARMS
| Number of parameters for the stored procedure.
| RES SET
| Maximum number of result sets that can be returned.
| O Origin of the routine:
| E External.
| Q SQL.
| S System generated.
| U User-defined or built-in function.

Chapter 25. System catalog panels 581


| N Native SQL procedure.
| SQL
| This field indicates whether SQL statements are allowed, which is one of the
| following values:
| N No SQL statement, SQL is not allowed.
| C Contains SQL statements.
| R Reads SQL data.
| M Modifies SQL data.
| blank Not applicable.
| SR
| This field indicates whether the program should remain resident when it ends.
| This field contains one of the following values:
| Y Program remains resident.
| N Program does not remain resident.
| blank Not external or user-defined function.
| PT
| Program type, which is one of the following values:
| M Main.
| S Subroutine.
| blank Not applicable.
| CR
| Commit on return. This field contains one of the following values:
| Y Unit of work is committed immediately.
| N Unit of work continues.
| blank User defined function or cast function
| EXTERNAL NAME
| Load module name for the stored procedure.
Related reference
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Option P. Plans
The Plans panel displays the application plans in the DB2 catalog.

Select option P on the System Catalog panel to display the Application Plans panel,
as shown in the following figure.

By using the Application Plans panel, you can issue line commands to bind,
rebind, and free an application plan. These functions are shown at the end of this
subsection. You can also issue the SQ line command to show the SQL statements.

The following figure shows the Application Plans panel.

582 User's Guide and Reference


DB2 Admin ---------------- DB2X Application Plans ---------------- Row 1 of 25
Command ===> Scroll ===> PAGE

Commands: BIND REBIND FREE GRANT


Line commands:
DP - Depend A - Auth T - Tables V - Views X - Indexes S - Table spaces
Y - Synonyms M - DBRMs RB - Rebind F - Free B - Bind GR - Grant
PL - Package list LP - List PLAN_TABLE I - Interpret ENDI - Enab/disab con
K - Local packages SQ - SQL D - Databases RO - role
Bind Bind V I V O Bound Quali- Pack A R E D
Select Name Owner Date Time D S A P By fier Lists Q L X R
* * * * * * * * * * * * * * *
------ -------- -------> ------ ------ - - - - -------- -------- ------ - - - -
ADBTEP2 DSCGDB2 010828 100153 B S Y Y ISTFL2 DSCGDB2 1 U C N
ADBV3 DSCGDB2 010912 024459 B S Y Y ISTFL DSCGDB2 2 U C Y
ADB2GEN DSCGDB2 010623 005531 B S Y Y ISTJE DSCGDB2 1 U C Y
ADB2GE2 DSCGDB2 010526 003803 B S Y Y ISTFL DSCGDB2 1 U C Y
ADB21 DSCGDB2 010623 004026 B S Y Y ISTJE DSCGDB2 1 U C N
ADB31 DSCGDB2 011030 170150 B S Y Y ISTJE DSCGDB2 1 U C N
DB2E71 DPGROTH 011029 145636 R S Y Y DPGROTH DPGROTH 0 U C Y
DSNEDCL DSCGDB2 010524 190326 R S Y Y ISTJE DSCGDB2 1 U C N
DSNESPCS DSCGDB2 010524 190324 R S Y Y ISTJE DSCGDB2 1 U C N
DSNESPRR DSCGDB2 010524 190325 R R Y Y ISTJE DSCGDB2 1 U C N
DSNHSP81 ISTJE001 010524 202509 R S Y Y ISTJE ISTJE 0 U C N
DSNHYCRD DSCGDB2 010524 190331 R S Y Y ISTJE DSCGDB2 1 U C N
DSNREXX DSCGDB2 010524 190846 R S Y Y ISTJE DSCGDB2 5 U C N
DSNTEP2 DSCGDB2 010524 202123 R S Y Y ISTJE DSCGDB2 1 U C N
DSNTEP81 DSCGDB2 010524 202123 R S Y Y ISTJE DSCGDB2 1 U C N
DSNTIAD DSCGDB2 010524 024119 R S Y Y ISTJE DSCGDB2 0 U C N
DSNTIAUL DSCGDB2 010525 033554 R S Y Y ISTJE DSCGDB2 0 U C N
DSNTIA81 DSCGDB2 010524 024119 R S Y Y ISTJE DSCGDB2 0 U C N
DSNTIB81 DSCGDB2 010525 033553 R S Y Y ISTJE DSCGDB2 0 U C N
DSNWZP DSCGDB2 010524 190331 R S Y Y ISTJE DSCGDB2 1 U C N
DSN8EPU DSCGDB2 010601 204822 R S Y Y ISTJE DSCGDB2 2 U C N
GOC2GEN DSCGDB2 010829 100859 B S Y Y ISTFL DSCGDB2 1 U C Y
SKALBERG DPCHR 010622 143748 R U Y Y DPCHR DPCHR 3 U D Y
TADB2RE DSCGDB2 011022 162840 R R Y Y ISTFL DSCGDB2 2 U C N
TESTPRP ISTFL 010526 004951 B S Y Y ISTFL ISTFL 1 U C N
******************************* END OF DB2 DATA *******************************

Figure 407. Application Plans panel (ADB21P)

The following primary commands are valid on this panel:


BIND
Issues a BIND command on multiple application plans. When you attempt to
bind more than 20 application plans, DB2 Admin prompts you to specify either
a work statement list or a batch job to complete the processing.
FREE
Issues a FREE command on multiple application plans. When you attempt to
free more than 20 application plans, DB2 Admin prompts you to specify either
a work statement list or a batch job to complete the processing.
REBIND
Issues a REBIND command on multiple application plans. When you attempt
to rebind more than 20 application plans, DB2 Admin prompts you to specify
either a work statement list or a batch job to complete the processing.
When you specify REBIND, the resulting BIND command contains only the
plan name. Specify REBIND FULL. If you want the resulting BIND command
to contain the plan name and all of the parameters.
GRANT
Issues a GRANT command on multiple application plans.

Tip: The BIND, REBIND, FREE, and GRANT commands operate on each row that
is displayed in the table. If you want to omit some of the rows before you

Chapter 25. System catalog panels 583


issue one of these commands, you can use the minus (-) line command to
remove rows from the display. The BIND, REBIND, FREE, and GRANT
commands operate only on rows that are listed.

The fields on this panel are:


Select
Input field where you enter one of the line commands listed on the panel.
Name
Name of the application plan.
Owner
Authorization ID of the owner of the application plan.
Bind Date
Date of the most recent bind on the application plan. The date is in the form
YYMMDD.
Bind Time
Time of the most recent bind on the application plan. The time is in the form
HHMMSS.
VD
This field indicates whether validity checking can be deferred until run time.
This field contains one of the following values:
B All validity checking must be done during the bind.
R Validity checking is done at run time for tables, views, and privileges
that do not exist at bind time.
IS Isolation level, which is one of the following values:
R Repeatable read
S Cursor stability
T Read stability
U Uncommitted read
VA
This field indicates whether the application plan is valid; that is, whether it can
be run without being rebound. This field contains one of the following values:
Y A valid application plan.
N Not a valid application plan.
A The description changed. The application plan is still valid.
H The description changed. The application plan is valid for DB2 Version
5 or higher; otherwise, the plan is invalid.
OP
This field indicates whether the application plan can be allocated. This field
contains one of the following values:
Y Yes
N No. Explicit BIND or REBIND is required before the plan can be
allocated.
Bound By
Primary authorization ID of the binder of the plan.
Qualifier
Qualifier that was specified at bind time to resolve names.
Pack Lists
Number of packages in the package list at bind time.

584 User's Guide and Reference


AQ
When resources for the application plan are acquired. This field contains one of
the following values:
A At allocation time
U At first use
RL
When resources for the application plan are released. This field contains one of
the following values:
C Resources for the application plan are released at commit time.
D Resources for the application plan are released at deallocation time.
EX
This field indicates whether the application plan was bound using EXPLAIN.
This field contains one of the following values:
Y Yes
N No
DR
Dynamic SQL rules. This field contains one of the following values:
B Use binder's authid and authorizations.
Blank Use executor's authid and authorizations.

Binding application plans

Use the B line command (bind plan) on the Application Plans panel to display the
Bind Application Plan panel, as shown in the following figure.

Use the Bind Application Plan panel to build an application plan.

Enter your input on the panel.

The following figure shows the Bind Application Plan panel.

Chapter 25. System catalog panels 585


| ADB21PB n ------------------ DSN9 Bind Application Plan ----------------- 05:22
| Command ===> __________________________________________________________________
|
| More: +
| Verify BIND parameters:
|
| BIND PLAN(
| Plan name . . . . . ADB27ATJ
| ) OWNER(
| Plan owner . . . . . DSCGDB2 >
| ) QUALIFIER(
| Qualifier . . . . . DSCGDB2 > (qualifier to resolve unqualified SQL)
| ) MEMBER( (use ? to get current values from the catalog)
| DBRM members . . . . _________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
|
|
| ) LIBRARY (use ? to get current values from the catalog)
| DBRM data sets . . . _________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| ) PKLIST( (use ? to get current values from the catalog)
| Package lists . . . ?
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
||
| Figure 408. Bind Application Plan panel (ADB21PB) (1 of 2)
|

586 User's Guide and Reference


| ) DEFER(PREPARE)
| Defer prepare . . . NO (Yes/No, used for distributed dynamic SQL)
| ) VALIDATE(
| Validation time . . B (Run or Bind, Bind preferred)
| ) ISOLATION(
| Isolation level . . CS (CS, RR, RS, or UR)
| ) CACHE(
| Cache size . . . . . 3072 (cache size in bytes for authorization IDs)
| ) ACQUIRE(
| Acquire at . . . . . U (Use or Allocate, Use preferred)
| ) RELEASE(
| Release at . . . . . C (Commit or Deallocate, Commit preferred)
| ) EXPLAIN(
| Explain plan . . . . NO (Yes/No, to explain access path)
| ) CURRENTDATA(
| Inhibit blocking . . NO (Yes/No)
| ) CURRENT SERVER(
| Server name . . . . ________________ > (blank=local, else first location)
| ) ACTION(
| Bind action . . . . REPLACE (Add or Replace)
| ) RETAIN
| Retain auth list . . YES (Yes/No)
| ) ENABLE( (use ? to get current values from the catalog)
| Enable connects . . _________________________________________________________
| ) DISABLE( (use ? to get current values from the catalog)
| Disable connects . . _________________________________________________________
| ) (use ? to get current values from the catalog)
| En/disable names . . _________________________________________________________
| _______________________________________________________________________________
| DEGREE(
| Parallelism . . . . 1 (1 or ANY)
| ) SQLRULES(
| Connect2 rules . . . D (DB2 or STD)
| ) DISCONNECT(
| Disconnect . . . . . E (Explicit, Automatic, or Conditional)
| ) DYNAMICRULES(
| Dynamic rules . . . _ (Run or Bind)
| ) KEEPDYNAMIC(
| Keep dynamic SQL . . NO (Yes/No)
| ) DEFER(PREPARE)/NODEFER(PREPARE)
| Defer prepare . . . ___ (Yes/No)
| ) REOPT(NONE!ALWAYS!ONCE!AUTO)
| Re-opt at exec . . . NONE (N-None/Y-Always/1-Once/A-Auto)
| ) DBPROTOCOL(
| 3 part protocol . . D (Drda or Private)
| ) OPTHINT(
| Access path hint . . ________ > (hint id)
| ) PATH(
| UDT/UDF/STP path . . _________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
|
|
| ) ENCODING(
| Scheme or CCSID . . 37 (ASCII, EBCDIC, UNICODE or ccsid)
| ) IMMEDWRITE(
| Immedwrite . . . . . NO (Yes, No, PH1)
| ) ROUNDING(
| Rounding mode . . . _______ (CEILING,DOWN,FLOOR,HALFDOWN,HALFEVEN,HALUP,UP)
| )
||
| Figure 409. Bind Application Plan panel (ADB21PB), (2 of 2)
|
Rebinding application plans

Use the RB line command (rebind plan) on the Application Plans panel to display
the Rebind Application Plan panel, as shown in the following figure.

Chapter 25. System catalog panels 587


Use the Rebind Application Plan panel to rebind an application plan when changes
have been made that affect the plan, but the SQL statements in the program have
not changed.

Enter your input on the panel.

| ADB21PR n ----------------- DSN9 Rebind Application Plan ---------------- 05:37


| Command ===> __________________________________________________________________
|
| More: +
| Verify REBIND parameters:
|
| REBIND PLAN(
| Plan name . . . . . ADB27ATJ
| ) OWNER(
| Plan owner . . . . . DSCGDB2 >
| ) QUALIFIER(
| Qualifier . . . . . DSCGDB2 > (qualifier to resolve unqualified SQL)
| ) PKLIST( (use ? to get current values from the catalog)
| Package lists . . . _________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
|
|
| Figure 410. Rebind Application Plan panel (ADB21PR), part 1 of 2
|

588 User's Guide and Reference


| ) NOPKLIST
| No package list . . ___ (Yes/No, to remove current package list)
| DEFER(PREPARE)
| Defer prepare . . . NO (Yes/No, used for distributed dynamic SQL)
| ) VALIDATE(
| Validation time . . B (Run or Bind, Bind preferred)
| ) ISOLATION(
| Isolation level . . CS (CS, RR, RS, or UR)
| ) CACHE(
| Cache size . . . . . 3072 (cache size in bytes for authorization IDs)
| ) ACQUIRE(
| Acquire at . . . . . U (Use or Allocate, Use preferred)
| ) RELEASE(
| Release at . . . . . C (Commit or Deallocate, Commit preferred)
| ) EXPLAIN(
| Explain plan . . . . NO (Yes/No, to explain access path)
| ) CURRENTDATA(
| Inhibit blocking . . NO (Yes/No)
| ) CURRENT SERVER(
| Server name . . . . ________________ > (blank=local, else first location)
| ) ENABLE( (use ? to get current values from the catalog)
| Enable connects . . _________________________________________________________
| ) DISABLE( (use ? to get current values from the catalog)
| Disable connects . . _________________________________________________________
| ) (use ? to get current values from the catalog)
| En/disable names . . _________________________________________________________
| _______________________________________________________________________________
| DEGREE(
| Parallelism . . . . 1 (1 or ANY)
| ) SQLRULES(
| Connect2 rules . . . D (DB2 or STD)
| ) DISCONNECT(
| Disconnect . . . . . E (Explicit, Automatic, or Conditional)
| ) DYNAMICRULES(
| Dynamic rules . . . _ (Run or Bind)
| ) KEEPDYNAMIC(
| Keep dynamic SQL . . NO (Yes/No)
| ) DEFER(PREPARE)/NODEFER(PREPARE)
| Defer prepare . . . ___ (Yes/No)
| ) REOPT(NONE!ALWAYS!ONCE!AUTO)
| Re-opt at exec . . . NONE (N-None/Y-Always/1-Once/A-Auto)
| ) DBPROTOCOL(
| 3 part protocol . . D (Drda or Private)
| ) OPTHINT(
| Access path hint . . ________ > (hint id)
| ) PATH(
| UDT/UDF/STP path . . _________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| _______________________________________________________________________________
| ) ENCODING(
| Scheme or CCSID . . 37 (ASCII, EBCDIC, UNICODE or ccsid)
| ) IMMEDWRITE(
| Immedwrite . . . . . NO (Yes,No,PH1)
| ) ROUNDING(
| Rounding mode . . . _______ (CEILING,DOWN,FLOOR,HALFDOWN,HALFEVEN,HALUP,UP)
| )
||
| Figure 411. Rebind Application Plan panel (ADB21PR), part 2 of 2
|
Freeing application plans

Use the F line command (free plan) on the Application Plans panel (see Figure 407
on page 583) to display the Free Application Plan panel, as shown in the following
figure.

Use the Free Application Plan panel to delete application plans from DB2.

Chapter 25. System catalog panels 589


DB2 Admin ------------------ DB2X Free Application Plan ----------------- 01:12
Command ===>

FREE PLAN

Plan name ===> DSNTIA81

Figure 412. Free Application Plan panel (ADB21PF)

Related reference
“The System Catalog panel” on page 546
Related information
IBM Publications Center

Option Q. Sequences
The Sequence Objects panel displays the sequences in the DB2 catalog.

A sequence is a user-defined object that generates a sequence of numeric values


according to the specification with which the sequence was created. It efficiently
provides recoverable, guaranteed-unique, sequential numbers to DB2 applications.

Select option Q on the System Catalog panel to display the Sequence Objects panel,
as shown in the following figure.

On the Sequence Objects panel, you can issue the GEN primary command to
generate SQL from DB2 catalog for all displayed sequences. You can also issue the
GRANT primary command to change authorizations for all displayed sequences.

| DB2 Admin ---------------- DB2X Sequence Objects ---------- Row 1 to 13 of 148


| Command ===> Scroll ===> PAGE
|
| Commands: GRANT
| Line commands:
| A - Auth CRE - Create AL - Alter GR - Grant DROP - Drop DDL - Object DDL
| COM - Comment I - Interpret GEN - Generate DDL F - Functions REP - Report
| J - Triggers IDC - Identity columns RO - Role
|
| Sel Schema Name Owner T C Start value
| * * * * * *
| ---- -------- ------------------ -------- - - --------------------------------
| ISTJE12 SEQCXM2PPZSOTH8 ISTJE12 I N 500
| K351156 SEQCXM276GG9TUE K351156 I Y 1
| ISTJE10 SEQCXN7K6P3NXDR ISTJE10 I N 1
| VNDSHL2 SEQ13 ISTJE12 S N 1
| ISTJE12 SEQ4XY ISTJE12 S Y 99999
| ISTJE12 SEQ4X1 ISTJE12 S N 99999
| ISTJE12 SEQ12 ISTJE12 S Y 500
| ISTJE11 SEQZX ISTJE11 S N 33
| ISTJE12 SEQZV ISTJE12 S N 33

Figure 413. Sequence Objects panel (ADB21Q)

The following primary command is valid on this panel:


GRANT
Issues a GRANT command on multiple sequences.

590 User's Guide and Reference


Tip: The GRANT command operates on each row that is displayed in the
table. If you want to omit some of the rows before you issue the
command, you can use the minus (-) line command to remove rows from
the display. The GRANT command operates only on rows that are listed.

The fields on this panel are:


Sel
Input field in which you can enter a line command.
Schema
The schema of the sequence.
Name
Name of the sequence.
Owner
Owner of the sequence.
T (type)
| The sequence type. Possible values are: S (a user-defined sequence), I (an
| identity column), and X (DOCID column for base table containing XML data).
C (cycle)
Specifies whether to wrap values after reaching the maximum value
(maxvalue) or minimum value (minvalue). Y indicates Yes and N indicates No.
Start value
Indicates the first value for the sequence.
Related reference
“The System Catalog panel” on page 546

Option S. Table Spaces


The Table Spaces panel displays the table spaces in the DB2 catalog.

Select option S on the System Catalog panel to display the Table Spaces panel, as
shown in the following figure.

The following figure shows the Table Spaces panel.

| DB2 Admin ------------------ DB2X Table Spaces -------------------- Row 1 of 5


| Command ===> Scroll ===> PAGE
|
| Commands: GRANT MIG DIS STA STO ALL
| Line commands:
| T - Tables D - Database A - Auth G - Storage group ICS - Image copy status
| DIS - Display table space STA - Start table space STO - Stop table space
| ? - Show all line commands
|
| Select Name DB Name Parts Bpool L E S I C Tables Act. pages Segsz T L
| * * * * * * * * * * * * * *
| ------ -------- -------- ------ ------ - - - - - ------ ----------- ------ - -
| DIS DSN8S81D DSN8D81A 0 BP0 P N A N N 1 12 0 Y
| DSN8S81E DSN8D81A 4 BP0 P N A N N 1 120 0 Y
| DSN8S81R DSN8D81A 0 BP0 P N A N N 6 0 0 Y
| DSN8S81P DSN8D81A 0 BP0 R N A N N 4 24 4 Y
| DSN8S81S DSN8D81A 0 BP0 P N A N N 1 0 0 Y
| ******************************* END OF DB2 DATA *******************************
||
| Figure 414. Table Spaces panel (ADB21S)
|
The following primary commands are valid on this panel:

Chapter 25. System catalog panels 591


GRANT
Issues a GRANT command on multiple table spaces.
MIG
Issues a MIG command on multiple table spaces.
DIS
Issues a DB2 DISPLAY command on multiple table spaces.
STA
Issues a DB2 START command on multiple table spaces.
STO
Issues a DB2 STOP command on multiple table spaces.
| ALL
| Lists all objects of a specified type for each object in a list of objects. Supported
| values for this panel are:
| ALL T Shows all tables for the listed table spaces. Views or aliases are not
| shown.
| ALL K
| Shows all packages for the listed table spaces.
| ALL X Shows all indexes for the listed table spaces.

If the size of the statements generated by the GRANT, DIS, STA, or STO primary
command exceeds 32K (an ISPF limit), you will be prompted to send the
statements to a batch job or a work statement list (WSL).

If the number of statements generated by the DIS, STA, or STO primary command
exceeds 10, you will be prompted to send the statements to a batch job or a WSL.

| Restriction: The DROP line command does not allow LOB table spaces to be
| dropped. This restriction protects you from a leaving a definition
| incomplete.

Recommendation: Primary commands operate on each row that is displayed in


the table. If you want to omit some of the rows before you
issue the primary command, use the minus (-) line command to
remove rows from the display. The primary commands operate
only on rows that are listed.

The fields on this panel are:


SELECT
Input field where you enter one of the line commands listed on the panel.
NAME
Name of the table space.
DB NAME
Name of the database.
PARTS
Number of partitions for a table space. For non-partitioned table spaces, this
value is 0.
To display detailed information for a table space, issue the SP line command
against that table space. To display the data set name for the table space (or
the data set names for every partition of a partitioned table space), issue the

592 User's Guide and Reference


DSN line command against that table space. You can also use the DSN line
command against a single partition after you issue the SP line command to
display the data set name for that partition only.
BPOOL
Name of the buffer pool used for the table space.
| L Locking size, which is one of the following values:
| A Any
| L Large object (LOB)
| P Page
| R Row
| S Table space
| T Table
| X Implicitly created XML table space
E Erase rule, which is one of the following values:
Y Erase
N No erase
S Status of the table space, which is one of the following values:
A Available
C Incomplete, part index
P Check pending
S Alt check pending
T incomplete, table
I Implicit (whether the table space was created implicitly), which is one of the
following values:
Y Yes
N No
C Close rule, which is one of the following values:
Y Yes
N No
TABLES
Number of tables defined in the table space.
ACT. PAGES
Number of active pages in the table space. This field is 0 if the RUNSTATS
utility has not been run.
SEGSZ
Number of pages in each segment of a segmented table space. The value is 0 if
the table space is not segmented.
T Type of table space, which is one of the following values:
Blank Normal
| G The table space was defined with the MAXPARTITIONS option (a
| partitioned-by-growth table space) with the underlying structure of a
| universal table space
I Defined with MEMBER CLUSTER and is not greater than 64 GB
K Defined with MEMBER CLUSTER and can be greater than 64 GB
L Defined as LARGE and can be greater than 64 GB
O Defined as an LOB (large object) table space
| P Implicit table space created for XML columns
| R Range-partitioned universal table space.
L Log changes, which is one of the following values:
Y Yes

Chapter 25. System catalog panels 593


N No
| X This LOB or XML table space has the NOT LOGGED attribute. Undo
| and redo logging for the table space is suppressed. Also, the logging
| attribute for this LOB or XML table space is linked to the logging
| attribute of the associated base table space and might not be able to be
| altered independently. If the logging attribute of the base table space is
| altered to LOGGED, the logging attribute of the LOB or XML table
| space will also be altered to LOGGED.
Related tasks
“Creating a table space” on page 155
Related reference
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171

Option T. Tables, Views, and Aliases


The Tables, Views, and Aliases panel displays the tables, views, and aliases in the
DB2 catalog.

Select option T on the System Catalog panel to display the Tables, Views, and
Aliases panel, as shown in the following figure.

On the Tables, Views, and Aliases panel, you can issue many line commands. Enter
a question mark (?) on a row to view all valid line commands. These line
commands include:
v The N line command lists constraints on tables.
v The GEN line command enables you to reverse engineer DB2 objects from this
panel.
v The MIG line command migrates tables and lists of tables.
v The UTL line command generates JCL that can be run against a table.
v The VS line command shows how a view was created (see “Viewing source
statements for views” on page 597).
| v The J (Triggers) line command works on views as well as tables.
| v The XML line command, when it is issued against a table that has XML
| columns, shows the XML tables (see “Viewing XML tables” on page 597).
| v The CLONE line command, when it is issued against a base table with a defined
| clone, displays the clone table (see “Viewing clone tables” on page 599.)

594 User's Guide and Reference


| DB2 Admin ----------- DB2X Tables, Views, and Aliases ----------- Row 1 of 46
| Command ===> Scroll ===> PAGE
|
| Commands: GRANT MIG ALL
| Line commands:
| C - Columns A - Auth L - List X - Indexes S - Table space D - Database
| V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
| ? - Show all line commands
|
| Sel Name Schema T DB Name TS Name Cols Rows Checks
| * * * * * * * *
| ----- ------------------ -------- - -------- -------- ------ ----------- ------
| VASTRDE1 DSN8810 V DSNDB06 SYSVIEWS 13 -1 0
| VPSTRDE1 DSN8810 V DSNDB06 SYSVIEWS 12 -1 0
| DSN8ES1_RS_TBL DSN8 G DSNDB06 SYSPKAGE 6 -1 0
| DEPT DSN8810 T DSN8D81A DSN8S81D 5 14 0
| VDEPT DSN8810 V DSN8D81A DSN8S81D 4 -1 0
| VHDEPT DSN8810 V DSN8D81A DSN8S81D 5 -1 0
| EMP DSN8810 T DSN8D81A DSN8S81E 14 42 2
| TCONA DSN8810 T DSN8D81P DSN8S81C 5 0 0
| VCONA DSN8810 V DSN8D81P DSN8S81C 5 -1 0
| TOPTVAL DSN8810 T DSN8D81P DSN8S81C 11 160 0
| MAP_TBL DSN8810 T DSN8D81P DSN8S81Q 4 -1 0
| EDEPT DSN8810 T DSN8D81A DSN8S81R 7 -1 0
| EEMP DSN8810 T DSN8D81A DSN8S81R 16 -1 0
| PROJ DSN8810 T DSN8D81A DSN8S81P 8 20 0
| VPROJ DSN8810 V DSN8D81A DSN8S81P 8 -1 0
| PARTS DSN8810 T DSN8D81A DSN8S81S 4 -1 0
| VDEPMG1 DSN8810 V DSN8D81A DSN8S81D 7 -1 0
| VEMP DSN8810 V DSN8D81A DSN8S81E 5 -1 0
| VEMPDPT1 DSN8810 V DSN8D81A DSN8S81E 7 -1 0
| VASTRDE2 DSN8810 V DSN8D81A DSN8S81E 13 -1 0
| AAA J351156 M DSNDB04 DSN8S81E 1 -1 0
| AAA1 J351156 M DSNDB04 DSN8S81E 1 -1 0
| VPROJACT DSN8810 V DSN8D81A DSN8S81P 5 -1 0
| EMPPROJACT DSN8810 T DSN8D81A DSN8S81P 6 74 0
| VEMPPROJACT DSN8810 V DSN8D81A DSN8S81P 6 -1 0
| VPROJRE1 DSN8810 V DSN8D81A DSN8S81P 8 -1 0
| VOPTVAL DSN8810 V DSN8D81P DSN8S81C 11 -1 0
| TDSPTXT DSN8810 T DSN8D81P DSN8S81C 3 70 0
| VDSPTXT DSN8810 V DSN8D81P DSN8S81C 3 -1 0
| EPROJ DSN8810 T DSN8D81A DSN8S81R 10 -1 0
||
| Figure 415. Tables, Views, and Aliases panel (ADB21T)
|
The following primary commands are valid on this panel:
GRANT
Issues a GRANT command on multiple tables and views.
MIG
Issues a MIG command on multiple tables.
| ALL
| Lists all objects of a specified type for each object in a list of objects. Supported
| values for this panel are:
| ALL S Shows all table spaces for the listed tables.
| ALL K
| Shows all packages for the listed tables.
| ALL X Shows all indexes for the listed tables.
| ALL A
| Shows all aliases for the listed tables.
| ALL V
| Shows all first-level views for the listed tables. Views on views will not
| be shown.

Chapter 25. System catalog panels 595


| ALL VV
| Show all views for the listed tables, including views on views (for DB2
| V8 and V9)

Recommendation: Primary commands operate on each row that is displayed in


the table. If you want to omit some of the rows before you
issue the primary command, use the minus (-) line command to
remove rows from the display. The primary commands operate
only on rows that are listed.

The fields on this panel are:


Sel
Input field where you enter one of the line commands listed on the panel.
Name
Name of the table, view, or alias.
Owner
Authorization ID of the owner of the table, view, or alias.
T Type of object, which is one of the following values:
T Table
V View
A Alias
G Global temporary table
X Auxiliary table
M Materialized table. A materialized table is similar to a view, in that a
full SELECT statement is used to create the materialized table query on
a table or a view. A materialized table contains physical data behind it
and is maintained by the system or by a user. You can use the
REFRESH command to refresh the materialized table data. Only a
user-maintained materialized table can contain inserts, deletes, and
updates. Restriction: When a table contains materialized queries, no
ALTER commands can be performed on that table.
You can create a materialized table using the CREM command against
a table or a view. You can also create a new materialized table by
issuing the CRE command against an existing materialized table.
You can alter a regular table to make it be a materialized table. Issue
the ALM command against a regular table to change it to a
materialized table. You can use the DROPM command against a
materialized table to drop a materialized query from the materialized
table, changing it to a regular table.
| P Implicit tables created for XML columns.
| C Clone table.
DB Name
For a table or a view of tables, the name of the database that contains the table
space named in TS NAME field. For a view of a view, a global temporary table
or for an alias, this field contains DSNDB06.
TS Name
For a table or a view of one table, the name of the table space that contains the
table. For a view of a view, this field contains SYSVIEWS. For an alias, this
field contains SYSDBAUT.
Cols
Number of columns in the table or view.

596 User's Guide and Reference


Rows
Total number of rows in the table. If the RUNSTATS utility has not been run or
if the rows describe a view or an alias, this field contains a value of -1.
Checks
Number of check constraints defined on the table.

Viewing source statements for views

Use the VS line command (show view) against a table on the Tables, Views, and
Aliases panel to display the Create View Source Statements panel.

The Create View Source Statements panel shows how a view was created.

The following figure shows the Create View Source Statements panel

DB2 Admin -------------- DB2X View DDL Source Statements --------------- 01:09
Command ===>

Commands: BR - Browse E - Edit EX - Edit/Execute

-------------------------View_DDL_Source_Statement_----------------------------
CREATE VIEW "RDBI"."SYNONYM_VIEW" "CREATOR" , "NAME" , "TBCREATOR" ,
"TBNAME") AS SELECT A."CREATOR" , A."NAME" , A."TBCREATOR" , A."TBNAME" FROM
"SYSIBM"."SYSSYNONYMS" A

Figure 416. Create View Source Statements panel (ADB21VS)

| Viewing XML tables


| Use the XML line command against a table that has XML columns to display the
| XML tables. You issue the XML line command on the Tables, Views, and Aliases
| panel.
|
| ADB21T in ---------------DB2X Tables, Views, and Aliases ------ Row 2 from 25
| Command ===> Scroll ===> PAGE
|
| Commands: GRANT MIG
| Line commands:
| C - Columns A - Auth L - List X - Indexes S - Table space D - Database
| V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
| ? - Show all line commands
|
| Sel Name Owner T DB Name TS Name Cols Rows Checks
| * * T * * * * *
| ----- ------------------ -------- - -------- -------- ------ ----------- ------
| MYCUST SMITHAJ T XMLDB3 XMLTS2 5 -1 0
| XML MYCUSTOMER SMITHAJ T XMLDB XMLTS 5 6 0
| MYCUSTOMER1 SMITHAJ T XMLDB XMLTS1 5 -1 0
| ******************************* END OF DB2 DATA *******************************
||
| Figure 417. The Tables, Views, and Aliases panel (ADB21T) – viewing XML tables
|
| You can issue the BASE line command against an XML table to show its
| corresponding base table, as shown in the following figure:
|

Chapter 25. System catalog panels 597


| ADB21T in ---------------DB2X Tables, Views, and Aliases ---- Row 1 to 2 of 2
| Command ===> Scroll ===> PAGE
|
| Commands: GRANT MIG
| Line commands:
| C - Columns A - Auth L - List X - Indexes S - Table space D - Database
| V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
| ? - Show all line commands
|
| Sel Name Owner T DB Name TS Name Cols Rows Checks
| * * * * * * * *
| ----- ------------------ -------- - -------- -------- ------ ----------- ------
| BASE XMYCUSTOMER SMITHAJ P XMLDB XMYC0000 3 6 0
| XMYCUSTOMER000 SMITHAJ P XMLDB XMYC0001 3 0 0
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 418. The Tables, Views, and Aliases panel (ADB21T) – viewing XML base
|
| The corresponding base table is shown in the following figure:
|
| ADB21T in ---------------DB2X Tables, Views, and Aliases ---- Row 1 to 1 of 1
| Command ===> Scroll ===> PAGE
|
| Commands: GRANT MIG
| Line commands:
| C - Columns A - Auth L - List X - Indexes S - Table space D - Database
| V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
| ? - Show all line commands
|
| Sel Name Owner T DB Name TS Name Cols Rows Checks
| * * * * * * * *
| ----- ------------------ -------- - -------- -------- ------ ----------- ------
| MYCUSTOMER SMITHAJ T XMLDB XMLTS 5 6 0
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 419. The Tables, Views, and Aliases panel (ADB21T) – viewing XML base 2
|
| Issue the XMLR line command against a base table that has XML columns to
| display information about the XML columns and the related XML base table.
|
| ADB21T in ---------------DB2X Tables, Views, and Aliases ---- Row 1 to 2 of 2
| Command ===> Scroll ===> CSR
|
| Commands: GRANT MIG
| Line commands:
| C - Columns A - Auth L - List X - Indexes S - Table space D - Database
| V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
| ? - Show all line commands
|
| Sel Name Owner T DB Name TS Name Cols Rows Check
| * * * * * * *
| ----- ------------------ -------- - -------- -------- ------ ----------- -----
| XMLR PJTBXML SMITHAJ T PJDBXML PJTSXML 6 -1
| XPJTBXML SMITHAJ P PJDBXML XPJT0000 3 10
| ******************************* END OF DB2 DATA ******************************
||
| Figure 420. The Tables, Views, and Aliases panel (ADB21T) – viewing XML column
| information

| The following panel shows the XML column information and the related XML base
| table.
|

598 User's Guide and Reference


| ADB21TXR ------------------- DSN9 XML cols for: MARLINO.PJTBX Row 1 to 1 of 1
| Command ===> Scroll ===> PAGE
|
| Line commands: T - Table C - Column
|
| XML Table: SMITHAJ.PJTBXML
| S Owner Name Column
| * * *
| - -------- ------------------ -------------------
| SMITHAJ XPJTBXML INFO
|
|
| Figure 421. The XML cols panel (ADB21TXR) – XML table column information 2
|
| Viewing clone tables

| Use the CLONE line command against a table that has a defined clone to display
| the clone table. You issue the CLONE line command on the Tables, Views, and
| Aliases panel.
|
| ADB21T in ---------------DB2X Tables, Views, and Aliases ---- Row 1 to 9 of 9
| Command ===> Scroll ===> CSR
|
| Commands: GRANT MIG
| Line commands:
| C - Columns A - Auth L - List X - Indexes S - Table space D - Database
| V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
| ? - Show all line commands
|
| Sel Name Schema T DB Name TS Name Cols Rows Checks
| * * * * * * * *
| ----- -----------------> -------- - -------- -------- ------ ----------- ------
| clone PJCLNBS3 SMITHAJ T PJMDBCL PJTSCLN3 2 -1 0
| PJCLNBS4 SMITHAJ T PJMDBCL PJTSCLN4 2 -1 0
| PJCLNALIAS SMITHAJ C PJMDBCL PJTSCLN 2 -1 0
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 422. The Tables, Views, and Aliases panel (ADB21T) – viewing clone tables
|
| Other line commands that support clone tables include:
| BASE Shows the base table for a clone.
| DROP Drop clone tables.
| XCHG
| Exchange data between base and clone tables.

| Note: To see the complete set of line commands for clone tables, enter the "? -
| Show all line commands" line command on the ADB21T panel.

Chapter 25. System catalog panels 599


| Related concepts
“Using table utilities” on page 362
Related tasks
“Creating a table” on page 156
“Placing a label on a table” on page 160
“Placing a comment on a table” on page 161
“Dropping a table” on page 161
“Displaying views of stored procedures” on page 424
Related reference
“Option N. Constraints” on page 579
“The System Catalog panel” on page 546
Related information
Chapter 9, “Reconstructing SQL (DB2 Admin Reverse Engineering),” on page 171
Chapter 13, “Migrating DB2 objects, data, and catalog statistics,” on page 291

Option V. Views
Use option V to display the Tables, Views, and Aliases panel with a filter showing
only views in the catalog.

Select option V on the System Catalog panel to display the Tables, Views, and
Aliases panel with a filter showing only views in the catalog, as shown in the
following figure.

DB2 Admin ----------- DB2X Tables, Views, and Aliases ----- Row 1 to 11 of 686
Command ===> Scroll ===> PAGE

Commands: GRANT MIG


Line commands:
C - Columns A - Auth L - List X - Indexes S - Table space D - Database
V - Views T - Tables P - Plans Y - Synonyms SEL - Select prototyping
? - Show all line commands

Sel Name Owner T DB Name TS Name Cols Rows Checks


* * * * * * * *
----- ------------------ -------- - -------- -------- ------ ----------- ------
ABC_SYSTABLES ISTJE V DSNDB06 SYSDBASE 47 -1 0
ABC_SYSCOLDIST ISTJE V DSNDB06 SYSSTATS 11 -1 0
VIEW_INDEXSTATS ISTJE V DSNDB06 SYSSTATS 11 -1 0
EGF_LOBS TESTER1 V DSNDB06 SYSOBJ 4 -1 0
VIEW_SYSPAKS ISTJE V DSNDB06 SYSPKAGE 16 -1 0
VDSPTXT DSN8810 V DSN8D81P DSN8S81C 3 -1 0
VIEWS_EXT DB2USER V DB2DB02 PROCESS 10 -1 0
******************************* END OF DB2 DATA *******************************

Figure 423. The Tables, Views, and Aliases panel (ADB21T) – displaying views

Related reference
“The System Catalog panel” on page 546

Option X. Indexes
The Indexes panel displays the indexes in the DB2 catalog.

Select option X on the System Catalog panel to display the Indexes panel, as
shown in the following figure.

600 User's Guide and Reference


On the Indexes panel, you can issue the UTL line command or UTL primary
command to generate JCL for the utilities that can be run against an index.

| DB2 Admin --------------------- DB2X Indexes ---------------------- Row 1 of 3


| Command ===> Scroll ===> PAGE
|
| Commands: DIS STA STO ALL
| Line commands:
| T - Tables D - Database G - Storage group P - Plans C - Columns
| DIS - Display index space STA - Start index space STO - Stop index space
| ? - Show all line commands
|
| Index Table C C C C
| Select Index Name Schema Table Name Schema U Cols G D L M
| * * * * * * * * * *
| ------ ------------------ -------- ------------------ -------- - ------ - - - -
| XDEPT1 DSN8810 DEPT DSN8810 P 1 N Y N N
| XDEPT2 DSN8810 DEPT DSN8810 D 1 N Y N N
| XDEPT3 DSN8810 DEPT DSN8810 D 1 N Y N N
| ******************************* END OF DB2 DATA *******************************
|
|
| Figure 424. Indexes panel (ADB21X)
|
The following primary commands are valid on this panel:
DIS
Issues a DB2 DISPLAY command on multiple indexes.
STA
Issues a DB2 START command on multiple indexes.
STO
Issues a DB2 STOP command on multiple indexes.
| ALL
| Lists all objects of a specified type for each object in a list of objects. Supported
| values for this panel are:
| ALL T Shows all tables associated with the listed indexes.

If the size of the statements generated by the DIS, STA, or STO primary command
exceeds 32K (an ISPF limit) or the number of statements generated exceeds 10, you
will be prompted to send the statements to a batch job or a work statement list
(WSL).

The fields on this panel are:


SELECT
Input field where you enter one of the line commands listed on the panel.
INDEX NAME
Name of the index.
| INDEX SCHEMA
The schema of the index
TABLE NAME
Name of the table on which the index is defined.
| TABLE SCHEMA
The schema of the table.
U Unique rule, which is one of the following values:
U Yes

Chapter 25. System catalog panels 601


D No
P Primary index
C Unique constraint
R Unique non-primary parent key
G Unique ROWID GENERATED BY DEFAULT
N Unique where NOT NULL
| X Unique column values used to identify or find XML values associated
| with a specific row.
COLS
Number of columns in the key.
CG
This field indicates whether CLUSTER was specified when the index was
created. This field contains one of the following values:
Y Yes
N No
CD
This field indicates whether the table is clustered by the index. This field
contains one of the following values:
Y Yes, which means that more than 95 percent of the rows are in
clustering order.
N No, which means that 95 percent of the rows, or fewer, are in
clustering order.
The entry in this field can be changed by using the RUNSTATS utility.
CL
This field indicates whether the data sets are closed when the index is not in
use. This field contains one of the following values:
Y Yes
N No
| CM
| Index compression
| Y Active
| N Not active

| XML indexes

| XML indexes use the same DB2 catalog support structure as extended indexes
| (indexes on expressions.)
| v Panel ADB21X supports the extended indexes and columns in SYSINDEXES and
| SYSINDEXPART.
| v The KT line command on panel ADB21X displays the information from
| SYSKEYTARGETS on panel (ADB21Z).
| v Line commands are available to display statistics for catalog tables
| SYSKEYTARGET* and SYSKEYTGT* in the same way as SYSCOL* statistics
| tables.
| v The XC line command on panel ADB21T supports extended indexes.

| The following panels support extended indexes and columns in SYSINDEXES and
| SYSINDEXPART:

602 User's Guide and Reference


| ADB21Z - Key Targets
| Lists the key targets that participate in an extended index definition.
| Display ADB21Z by issuing the line command KT – Key Targets against a
| table entry on panel ADB21T.

|
| ADB21Z in ------------------- DSN9 Key Targets --------------- Row 1 to 2 of 2
| Command ===> Scroll ===> PAGE
|
| Line commands:
| T - Table X - Indexes I - Interpret DI - Distribution stats
| PST - Partition stats RH - Runstats history KX - Key expression
| UR - Update runstats
|
| Index Key
| Sel Index Name Owner Seq O Type Name Derived From Length N
| * * * * * * * *
| --- ------------------ -------- ---- - --------- --------------------> ------ -
| PJMIX2 SMITHJR 1 A VARCHAR LEFT(CHARCOL3) ASC 10 N
| PJMIX3 SMITHJR 1 A VARCHAR RIGHT(CHARCOL,2) || C 21 Y
| ******************************* END OF DB2 DATA *******************************
||
| Figure 425. Key targets panel (ADB21Z)
|
| ADB21ZX - Key Targets for Index
| Lists the key targets that participate in an extended index definition for
| each of the extended indexes of a table. Display ADB21ZX by issuing the
| line command ‘KT – Key Targets” against an index on panel ADB21X.

|
| ADB21ZX -- DSN9 Key Targets for Index SMITHJR.KAVIX2 ------- Row 1 to 2 of 2
| Command ===> Scroll ===> PAGE
|
| Line commands:
| X - Index I - Interpret DI - Distribution stats PST - Partition stats
| RH - Runstats history KX - Key expression UR -Update runstats
|
| Key Col Distinct
| Sel Seq Num O Type Name Length N Derived From Values
| * * * * * * * *
| --- ---- ---- - --------- ------ - -------------------------------- -----------
| 1 0 A CHAR 3 N SUBSTR(CHARCOL,1,3) ASC 3
| ******************************* END OF DB2 DATA *******************************
||
| Figure 426. Key targets for index panel (ADB21ZX)
|
Related concepts
“Using index utilities” on page 365
Related tasks
“Creating an index on a table” on page 159
Related reference
“The System Catalog panel” on page 546

Option Y. Synonyms
The Synonyms panel displays the synonyms in the DB2 catalog.

Select option Y on the System Catalog panel to display the Synonyms panel, as
shown in the following figure.

Chapter 25. System catalog panels 603


| DB2 Admin -------------------- DB2X Synonyms -------------------- Row 17 of 47
| Command ===> Scroll ===> PAGE
|
| Line commands:
| T - Table CRE - Create synonym DROP - Drop synonym I - Interpretation
| CREAL - Create alias D - Database REP - Report
|
| Select Synonym Owner Table/View Table/View Created By
| Name Schema
| * * * * *
| ------- ------------------ -------- ------------------ ------------- --------
| DEMO_UNICODE DSCGDB2 DEMO_UNICODE DSN8810 ISTJE
| DEPT DSCGDB2 DEPT DSN8810 ISTJE
| EMP DSCGDB2 EMP DSN8810 ISTJE
| EMPPROJACT DSCGDB2 EMPPROJACT DSN8810 ISTJE
| PROJ DSCGDB2 PROJ DSN8810 ISTJE
| PROJACT DSCGDB2 PROJACT DSN8810 ISTJE
| TCONA DSCGDB2 TCONA DSN8810 ISTJE
| TDSPTXT DSCGDB2 TDSPTXT DSN8810 ISTJE
| TOPTVAL DSCGDB2 TOPTVAL DSN8810 ISTJE
| VACT DSCGDB2 VACT DSN8810 ISTJE
| VASTRDE1 DSCGDB2 VASTRDE1 DSN8810 ISTJE
| VASTRDE2 DSCGDB2 VASTRDE2 DSN8810 ISTJE
| VCONA DSCGDB2 VCONA DSN8810 ISTJE
| VDEPMG1 DSCGDB2 VDEPMG1 DSN8810 ISTJE
| VDEPT DSCGDB2 VDEPT DSN8810 ISTJE
| VDSPTXT DSCGDB2 VDSPTXT DSN8810 ISTJE
| VEMP DSCGDB2 VEMP DSN8810 ISTJE
| VEMPDPT1 DSCGDB2 VEMPDPT1 DSN8810 ISTJE
| VEMPLP DSCGDB2 VEMPLP DSN8810 ISTJE
| VEMPPROJACT DSCGDB2 VEMPPROJACT DSN8810 ISTJE
| VFORPLA DSCGDB2 VFORPLA DSN8810 ISTJE
| VHDEPT DSCGDB2 VHDEPT DSN8810 ISTJE
| VOPTVAL DSCGDB2 VOPTVAL DSN8810 ISTJE
| VPHONE DSCGDB2 VPHONE DSN8810 ISTJE
| VPROJ DSCGDB2 VPROJ DSN8810 ISTJE
| VPROJACT DSCGDB2 VPROJACT DSN8810 ISTJE
| VPROJRE1 DSCGDB2 VPROJRE1 DSN8810 ISTJE
| VPSTRDE1 DSCGDB2 VPSTRDE1 DSN8810 ISTJE
| VPSTRDE2 DSCGDB2 VPSTRDE2 DSN8810 ISTJE
| VSTAFAC1 DSCGDB2 VSTAFAC1 DSN8810 ISTJE
| VSTAFAC2 DSCGDB2 VSTAFAC2 DSN8810 ISTJE
| ******************************* END OF DB2 DATA *******************************

Figure 427. Synonyms panel (ADB21Y)

The fields on this panel are:


Select
Input field where you enter one of the line commands listed on the panel.
Synonym
Synonym for the table or view.
Owner
Authorization ID of the owner of the synonym.
Table/View Name
Name of the table or view.
| Table/View Schema
The schema of the table or view.
Created By
Primary authorization ID of the user who created the synonym.

604 User's Guide and Reference


Related reference
“The System Catalog panel” on page 546

Authorizations for objects


You can use the DB2 Admin System Catalog panel to manage authorizations for
objects in the DB2 catalog.

From the DB2 Admin System Catalog panel, you can display information about the
authorizations that were granted for the following database objects:
v Collections
v Columns
v Databases
v Data types
v Functions
v Packages
v Plans
v Resources
v Schemas
v Sequences
v Storage groups
v Stored procedures
v System privileges
v Tables
v Table spaces
v Views

To display the authorizations granted on a particular type of database object:


1. On the DB2 Admin System Catalog panel, type the two-character AO object
option in the Option field and press Enter. The authorization options are
displayed.
2. Type the two-character option that corresponds to the particular type of object
in the Option field.
3. Optionally, specify a value in either the Grantor or Grantee fields at the bottom
of the System Catalog panel.

Recommendation: For optimum performance when using any authorization


option (xA), specify a value in either the Grantor or
Grantee fields that are located at the bottom of the System
Catalog panel.
4. Press Enter.

For example, to display authorization information for databases, type DA in the


Option field, and press Enter. The Database Authorizations panel, as shown in the
following figure, is displayed.

Chapter 25. System catalog panels 605


DB2 Admin --------------- DB2X Database Authorizations ----------- Row 1 of 27
Command ===> Scroll ===> PAGE

Commands: REVOKE GRANT


Line commands: C C D D D D D I L R R R S S S
R - Revoke GR - Grant D - Database R R B B B I R M O E E E T T T
I - Interpretation RE - Grantee role E E A C M S O A A O C P A A O
RR - Grantor role T T D T A P P G D R O A R T P
G Database Grant H A S M R I D D E D G V I T S
Sel Grantor Grantee T Name Date G B L N B B B R
* * * * * * * * * * * * * * * * * * * * * *
--- -------- ------- - -------- ---------------- - - - - - - - - - - - - - - - -
ADB ADB L ADBDCH 2004-08-28 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L DBEDB1 2004-09-17 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L DBEDB2 2004-09-17 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L DSQDBCTL 2004-06-18 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L DSQDBDEF 2004-06-18 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L DSQ1STBB 2004-06-18 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L RAADB 2004-06-18 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L RDBIDB1 2004-06-18 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L RDBIDB2 2004-06-18 G G G G G G G G G G G G G G G
DPGROTH DPGROTH L RDBIDB3 2004-06-18 G G G G G G G G G G G G G G G
DSCGDB2 DSCGDB2 L DSNDB07 2004-05-24 S G G G G G G G G G G G G G G G
DSCGDB2 DSCGDB2 L DSNRGFDB 2004-05-24 S G G G G G G G G G G G G G G G
DSCGDB2 DSCGDB2 L DSNRLST 2004-05-24 S G G G G G G G G G G G G G G G
DSCGDB2 DSCGDB2 L DSN8D81A 2004-05-24 S G G G G G G G G G G G G G G G
DSCGDB2 DSCGDB2 L DSN8D81E 2004-05-25 S G G G G G G G G G G G G G G G
DSCGDB2 DSCGDB2 L DSN8D81P 2004-05-24 S G G G G G G G G G G G G G G G
DSCGDB2 DSCGDB2 L DSN8D81U 2004-05-25 S G G G G G G G G G G G G G G G
ISTFL2 ISTFL2 L TFLDB 2004-07-31 G G G G G G G G G G G G G G G
ISTJE ISTJE L ISTJED 2004-06-22 G G G G G G G G G G G G G G G
ISTJE ISTJE L MAPD1 2004-10-25 G G G G G G G G G G G G G G G
ISTJE ISTJE L MAPD2 2004-10-257 G G G G G G G G G G G G G G G
ISTJE ISTJE L XXXXX 2004-10-04 G G G G G G G G G G G G G G G
ISTJE ISTJE L YYYYY 2004-10-24 G G G G G G G G G G G G G G G
DSCGDB2 PUBLIC L DSNDB04 2004-05-24 S Y Y
DSCGDB2 PUBLIC L DSN8D81A 2004-05-24 S Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
DSCGDB2 PUBLIC L DSN8D81E 2004-05-25 S Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
DSCGDB2 PUBLIC L DSN8D81P 2004-05-24 S Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
******************************* END OF DB2 DATA *******************************

Figure 428. Database Authorizations panel (ADB2AD)

All of the authorization-related panels are structured similarly to the Database


Authorizations panel. Valid primary commands and line commands are listed at
the top of the panel; detailed authorization information about the type of database
object that you selected is displayed in the bottom of the panel. You enter line
commands in the Sel field that is located to the left of the database objects.

From the authorization-related panels, you can grant and revoke authorizations for
a particular object or for all the objects that are displayed.

Refer to the online help for detailed descriptions of the primary commands, line
commands and fields.

Revoking all authorizations from a user


You can revoke all of the directly held or explicitly granted authorizations from a
user.

To revoke the authorizations from a user:


1. On the DB2 Admin System Catalog panel, type the two-character AO object
option in the Option field and press Enter.
2. Type the two-character UA authorization option in the Option field and specify
the name of the user or users from whom to revoke authorizations in the

606 User's Guide and Reference


Grantee field at the bottom of the panel. Press Enter. The User Authorizations
Summary panel, as shown in the following figure, is displayed.

DB2 Admin ----------- DB2X User Authorizations Summary ----- Row 1 to 11 of 16


Command ===> Scroll ===> PAGE

Authorities held by VNDSHL1%


Authority includes SYSADM
Commands: AU AP ALL AE AI
Line commands: AU - User Only AP - All PUBLIC ALL - All Authorizations
AE - Explicit to User AI - Implicit to User

Sel Type Explicit Implicit PUBLIC Total


--- ---------------- ----------- ----------- ----------- -----------
System 1 0 1 2
Storage group 0 0 3 3
Database 0 0 10 10
Table space 0 0 30 30
Table 0 2 735 737
Column 0 0 0 0
Plan 0 0 79 79
Collection 0 0 15 15
Package 0 0 235 235
Function 0 0 54 54
Buffer pool 0 0 6 6

Figure 429. User Authorizations Summary panel (ADB2AUS)

3. Issue the AU or AE command to display the authorizations that are held by the
grantees that you specified. AU shows the authorizations that the specified
grantees hold directly, and AE shows the authorizations that the specified
grantees were granted explicitly. The User Authorizations panel, as shown in
the following figure, is displayed.

DB2 Admin --------------- DB2X User Authorizations --------- Row 1 to 8 of 169


Command ===> Scroll ===> PAGE

Commands: REVOKE GRANT


Line commands: A - Auth I - Interpret R - Revoke GR - Grant

S Grantor Grantee T Name Authority Date WGO


* * * * * * *
-- -------- -------- - --------------------------- ----------------- ------ ---
R148286 VNDSHL1 Z (SYSTEM) SYSADM 030113 YES
VNDSHL1 VNDSHL1 D SHLIMR1 DBADM 030929 YES
VNDSHL1 VNDSHL1 D DBSHL DBADM 031003 YES
VNDSHL2 VNDSHL1 D DBSHL2 DBADM 031201 NO
VNDSHL2 VNDSHL1 D DBSHL2 DBCTRL 031201 NO
VNDSHL1 VNDSHL1 T VNDSHL1.VDEPT111 ALL 031202 YES
K351156 VNDSHL1 T K351156.GROUPCONFIG ALL 030220 NO
VNDSHL1 VNDSHL1 T VNDSHL1.VDEPT1 ALL 030115 YES

Figure 430. User Authorizations panel (ADB2AUD)

4. Issue the REVOKE primary command to revoke all of the listed system and
user authorities from the listed grantees. The Revoke panel, as shown in the
following figure, is displayed to remind you of the significant impact that
executing the command can have and to have you confirm whether you really
want to execute it.

Chapter 25. System catalog panels 607


DB2 Admin -- DB2X Revoke ------------------------------ 18:17

This command revokes all system and user authorizations


from the listed grantees. Other privileges from other
users may also be revoked as the result of a CASCADE
revoke. Choose to execute the command or to return.

Select a choice
1. Execute the command
2. Return

F1=Help F2=Split F3=Exit F9=Swap F12=Cancel

Figure 431. Revoke panel (ADB2CONF)

5. Select option 1 to execute the REVOKE command. The SQL is generated and
executed if the total size of the generated SQL is less than 32K (approximately
60 REVOKE statements). Otherwise, the Statement Execution Prompt panel is
displayed, and you can choose to create a batch job with the statements or add
the statements to a work statement list (WSL).

Granting a set of authorizations to a user


When managing authorizations, you might want to give all the authorizations that
are held by one user, either those held directly or those granted explicitly, to
another user or a list of users.

To grant all the authorizations that are held by one user to another user:
1. On the DB2 Admin System Catalog panel, type the two-character AO object
option in the Option field and press Enter.
2. Type the two-character UA authorization option in the Option field and specify
the name of the user from whom to copy authorizations in the Grantee field at
the bottom of the panel. Press Enter. The User Authorizations Summary panel,
as shown in the following figure, is displayed.

DB2 Admin ----------- DB2X User Authorizations Summary ----- Row 1 to 11 of 16


Command ===> Scroll ===> PAGE

Authorities held by VNDSHL1%


Authority includes SYSADM
Commands: AU AP ALL AE AI
Line commands: AU - User Only AP - All PUBLIC ALL - All Authorizations
AE - Explicit to User AI - Implicit to User

Sel Type Explicit Implicit PUBLIC Total


--- ---------------- ----------- ----------- ----------- -----------
System 1 0 1 2
Storage group 0 0 3 3
Database 0 0 10 10
Table space 0 0 30 30
Table 0 2 735 737
Column 0 0 0 0
Plan 0 0 79 79
Collection 0 0 15 15
Package 0 0 235 235
Function 0 0 54 54
Buffer pool 0 0 6 6

Figure 432. User Authorizations Summary panel (ADB2AUS)

608 User's Guide and Reference


3. Issue the AU or AE command to display the authorizations that are held by the
grantee that you specified. AU shows the authorizations that the specified
grantee holds directly, and AE shows the authorizations that the specified
grantee was granted explicitly. The User Authorizations panel, as shown in the
following figure, is displayed.

DB2 Admin --------------- DB2X User Authorizations --------- Row 1 to 8 of 169


Command ===> Scroll ===> PAGE

Commands: REVOKE GRANT


Line commands: A - Auth I - Interpret R - Revoke GR - Grant

S Grantor Grantee T Name Authority Date WGO


* * * * * * *
-- -------- -------- - --------------------------- ----------------- ------ ---
R148286 VNDSHL1 Z (SYSTEM) SYSADM 030113 YES
VNDSHL1 VNDSHL1 D SHLIMR1 DBADM 030929 YES
VNDSHL1 VNDSHL1 D DBSHL DBADM 031003 YES
VNDSHL2 VNDSHL1 D DBSHL2 DBADM 031201 NO
VNDSHL2 VNDSHL1 D DBSHL2 DBCTRL 031201 NO
VNDSHL1 VNDSHL1 T VNDSHL1.VDEPT111 ALL 031202 YES
K351156 VNDSHL1 T K351156.GROUPCONFIG ALL 030220 NO
VNDSHL1 VNDSHL1 T VNDSHL1.VDEPT1 ALL 030115 YES

Figure 433. User Authorizations panel (ADB2AUD)

4. Issue the GRANT primary command. The Grant Privileges panel, as shown in
the following figure, is displayed.

DB2 Admin -------------------- DB2X Grant Privileges -------------------- 18:20


Command ===>

Specify grantees to use for all the GRANT statements.


An "S" preceding the listed privilege indicates the privilege exists
in the list of authorizations shown on the previous panel. Replace "S"
with null to avoid granting the privilege.

GRANT

S SYSADM SYSCTRL SYSOPR


DBADM DBCTRL DBMAINT PACKADM

TO

Grantees ===> >

With GRANT option ===> YES - retains option for each GRANT statement
NO - removes option for all GRANT statements

Figure 434. Grant Privileges panel (ADB2AUG)

5. Specify the users to whom you would like to grant authorizations in the
Grantees field. The SQL is generated and executed if the size of the generated
SQL is less than 32K. Otherwise, the Statement Execution Prompt panel is
displayed, and you can choose to create a batch job with the statements or add
the statements to a work statement list (WSL).

Chapter 25. System catalog panels 609


610 User's Guide and Reference
Chapter 26. DB2 Admin commands
There are two types of DB2 Admin commands.

The following topics describe the two types of DB2 Admin commands.

Topics:
v “DB2 Admin primary commands” on page 612
v “DB2 Admin line commands” on page 617
Related concepts
“Using DB2 Admin commands” on page 88
“Line commands” on page 88
“Controlling DB2 Admin processing” on page 527

© Copyright IBM Corp. 1995, 2010 611


DB2 Admin primary commands
Primary commands are issued from the command line on DB2 Admin panels.

The primary commands are shown in the following table. Most primary
commands can be entered on all panels. To determine which commands are
available for a particular panel and the correct syntax for those commands, access
the help for that panel.

| Tip: When you enter a DB2 Admin primary command that has the same name as
| a TSO command, the TSO command is executed first. To bypass the TSO
| command processor, enter the primary command with a prefix of the greater
| than symbol (>), which is a TSO escape character.
Table 26. DB2 Admin primary commands
Command Alias Description
| ALL Lists all objects of a specified type for each object
in a list of objects. For example, for a list of
indexes on panel ADB21X, the ALL T command
will display all tables associated with those
indexes.
BIND Generates BIND commands for multiple
application packages or plans. The BIND
commands are created in a work statement list.
This command is valid only when packages or
plans are displayed.
BROWSE B, BR, Browse the current ISPF table.
BRO,
BROW
| CMM Displays the Change Management (CM) panel
| (ADB2C).
| COLUMNS Performs a column lookup when primary, unique,
| or foreign key constraints are being added.
DB2 db2 command Issues a DB2 command. For example: DB2 -DIS
THREAD (*).

DB2 can be omitted from the command.


DIS Generates a DB2 command to display information
for all objects listed. The command is valid only
when databases, table spaces, or indexes are
displayed.

612 User's Guide and Reference


Table 26. DB2 Admin primary commands (continued)
Command Alias Description
FINDstring [NEXT|PREV] Find a string in the rows that are returned in a
[fromcolno tocolno] table display panel. This command allows you to
go directly to a particular string without having to
scroll. The command starts at the row on which
the cursor is positioned and searches all the
columns, or the specified columns, for the
specified string. If the string is found, the cursor is
placed at the row. The default, NEXT, is to search
in a forwards direction. To search in a backwards
direction, specify PREV. For example:
FIND MYUSERID
FIND MYUSERID PREV
FIND MYUSERID 2 4
FIND MYUSERID PREV 2 4

If the string contains special characters, use quotes


around the string. You can specify RFIND to
repeat the last FIND command.
FREE Generates FREE commands for multiple
application packages or plans. The FREE
commands are created in a work statement list.
This command is valid only when packages or
plans are displayed.
GEN Generates SQL for the objects from the DB2
catalog.
GRANT Generates a GRANT statement for all the objects
that are listed. This command is valid only when
databases, tables, views, aliases, packages, plans,
sequences, stored procedures, user-defined
functions, user-defined data types, or
authorizations are displayed. The GRANT
command is useful on authorization panels when
copying authorizations from one user to one or
more other users, and the command is valid only
when the values in the Grantee column are the
same.
ISPF ispf statement Issues one or more ISPF statements. For example:
ISPF SELECT CMD(MYCMD). A semicolon (;) should
separate ISPF statements.
LIKE Switches the LIKE operator ON or OFF for search
criteria. This command is valid only on the System
Catalog panel (ADB21).
MIG Performs a migration (MIG) on the displayed
objects. This command is valid only when
databases, table spaces, or tables are displayed.
PANEL panel name Displays the panel whose name is specified.

| The purpose of the PANEL command is to allow


| installations to extend DB2 Admin with their own
| panels and then use these panels directly with DB2
| Admin. The panel must be designed to be invoked
| this way. That is, the panel should not be designed
| to be part of a multi-panel dialog and rely on
| variables being set in the preceding panels.
| Otherwise, unpredictable results can occur.

Chapter 26. DB2 Admin commands 613


Table 26. DB2 Admin primary commands (continued)
Command Alias Description
PARMS PARM Shows or updates current DB2 Admin parameters.
| PLANMGMT Displays the plan management attributes for the
| packages.
| PRINT TABLE ON FILE Prints the current table to the specified file. If you
| ddname or PRT TABLE ON don't specify a file name, the default file with the
| FILE ddname ddname PRINT is used.

| The file must be preallocated with a disposition of


| OLD.
PROMPT (options) PRMT Changes DB2 Admin prompt options.
| QUALIFIER Displays the qualifier for the packages.
REBIND Generates REBIND commands for multiple
application packages or plans. The REBIND
commands are created in a work statement list and
contain only the package or plan name. This
command is valid only when packages or plans
are displayed.

When you specify REBIND, the resulting BIND


commands contain only the package or plan name.
Specify REBIND FULL to have the resulting BIND
commands contain both the package or plan name
and all of the parameters.
REFRESH REF Refreshes the current ISPF table with data from
DB2.
REVOKE Generates REVOKE statements for all of the
system authorities, user authorities, and object
authorizations that are listed for the specified
grantees. When you issue the REVOKE command,
you are prompted to confirm that you really want
to execute the command because of the significant
impact that the command can have.
| REP Generates a batch job that produces a printable
| report of the objects in the DB2 catalog.
SAVE TABLE AS name IN Saves the current ISPF table with the specified
LIB ddname name in the specified library. If you do not specify
a library name, the default library ISPTABL is
used.

The ddname must be preallocated to a data set


before you use this command.
| SCHEMA schema Changes the CURRENT SCHEMA. For example,
SCHEMA ISTJE

614 User's Guide and Reference


Table 26. DB2 Admin primary commands (continued)
Command Alias Description
SEARCH SARG Performs more sophisticated searches of the ISPF
tables than the search arguments or the panel
allows. When you use the SEARCH command,
DB2 Admin displays a panel with all the columns
of the ISPF table. On this panel you can specify
searches on individual columns by entering a
search operator and a search value for the
columns.

Valid search operator values include:


v Equal to: EQ or =
v Greater than: GT or >
v Greater than or equal to: GE or >=
v Less than: LT or <
v Less than or equal to: LE or <=
v Not equal to: NE or ¬=

When you press END (PF3), a subset of the ISPF


table with only the data meeting the search criteria
is displayed.
SHOW LIBRARY ddname Shows a member list of the specified library on the
ON PANEL name specified panel. If you do not specify a library
name, the default library ISPTABL is used. If you
do not specify a panel name, the default panel
DB2ADL is used.

The ddname must be preallocated to a data set


before you use this command.
SHOW TABLE name ON Shows the specified table. If you do not specify a
PANEL name panel name, the default panel ADB2DF is used.
| SPACE Shows the amount of space (in KB) that is used for
| the VSAM page set.
SORT column names ORDER Sorts on a column in the current ISPF table. You
can place the cursor on the column that you want
sorted, instead of specifying a column name.

If you do not specify a column name, and the


cursor is not in a column, DB2 Admin displays a
panel in which you can specify your sort criteria.
SQL SQL statement Issues one or more SQL statements. For example:
A plus SQL SELECT * FROM MYTABLE. A semicolon (;) should
sign (+) separate SQL statements.

If an SQL statement returns rows, the default table


display panel shows the rows.
SQLID id AUTH, Shows or changes the current SQLID. For example:
AUTHID SQLID ISTJE.
| SSID xxxx Switches to another DB2 SSID. For example: SSID
| DSN9.
STA Generates a DB2 command to start all objects
listed. The command is valid only when databases,
table spaces, or indexes are displayed.

Chapter 26. DB2 Admin commands 615


Table 26. DB2 Admin primary commands (continued)
Command Alias Description
STO Generates a DB2 command to stop all objects
listed. The command is valid only when databases,
table spaces, or indexes are displayed.
STATUS STAT Shows the current status of DB2 Admin and
execution control statement statistics.
WSL Displays the Manage Work Statement Lists panel
(ADB2W).
UTIL Generates utility JCL for the table spaces of all the
databases that are listed.

Related concepts
“Primary commands” on page 88

616 User's Guide and Reference


DB2 Admin line commands
Line commands are issued from ISPF table display panels and are directed at a
particular row or rows of data.

Specify line commands in the line command area, called the Select field, in front of
each row.

Two types of line commands are available:


v Special line commands
v General line commands

You also can define your own line commands during installation procedure.

Special line commands

Special line commands that are available for a panel are listed in the line command
description area.

| A question mark (?) line command indicates that there is not enough room to show
| all of the line commands. Enter ? to display a list of all of the line commands
| available for that panel.

| Since the objects listed on a panel have varying attributes, not all of the line
| commands shown on the panel or its extension panel are applicable to each object.
| An attempt to issue a line command in such a case results in an error message.

Utility line commands, those commands that allow you to move directly to DB2
utility panels, are prefixed with "U."

The following table shows the special line commands.


Table 27. DB2 Admin special line commands
Command Description
A Displays information about authorizations for this object.
ACT Creates a new active version.
ADD Adds constraints.

For the ADBDMT Launchpad panel, ADD adds a utility to the


panel.
| ADDV For native SQL procedures: ALTER PROCEDURE ADD VERSION
ADDRI Adds RI-related tables to a list of tables to migrate.
AH Schema authorization.
AL, ALTER Alters an object.
ALC Alters table columns with DB2 Admin Alter.
ALIAS Shows aliases.
ALM Modifies a table to be a materialized query table.
| AN Analyzes a change.
AUX Displays associated auxiliary table.
AUXR Displays associated AUX data column.
B Binds the object.

Chapter 26. DB2 Admin commands 617


Table 27. DB2 Admin special line commands (continued)
Command Description
BASE Displays associated base table.
BC Binds the copy of the object.
| BIND For native SQL procedures: BIND DEPLOY command
BLD Build options.
BR Browse the object.
C Shows the columns for this object.
CA Shows column authorizations (UPDATE or REFERENCES
privileges on individual columns of a table or a view).
| CAN Cancels a change or cancels a thread.
CC Shows columns referenced in constraint.
CDI Shows column distribution.
| CH Shows information about the referential integrity defined for child
| tables or, on the Change Management panels, shows the changes
| that use the mask, ignore, or version.
CHK Shows information about table check constraints.
CHR Shows information about the referential integrity defined for child
relations.
| CLONE Displays the clone table.
COM Adds a comment on the object.
CON Shows constraints on table.
COUNT Displays the current number of rows in the table, as measured by
the SQL SELECT COUNT(*) function.
| CP Create a prerequisite change.
CRE Creates an object.
CREA Creates an auxiliary table.
CREAL Creates an alias for the object.
CREM Creates a new materialized query table using a table or a view.
CRESYN Creates a synonym for the table.
CRET Creates a table.
CRETAB Creates a table in a table space.
CRETS Creates a table space.
CREV Creates a view.
CREX Creates an index on the table.
CREY Creates a synonym for the table.
| CS Creates a change statement.
D Shows the database for the object.

For the System Administration panels, D deletes the row.


DC Describes the columns.
DDL Generates DDL for the object from the DB2 catalog.
| DEL Deletes the row in the ADBDMT Launchpad panel. On the Change
| Management panels, deletes the change, mask, ignore, version, or
| version scope.

618 User's Guide and Reference


Table 27. DB2 Admin special line commands (continued)
Command Description
DEP Shows the dependencies on an object.
DI Displays distribution statistics.
DIS Displays information about the status of the object.
DISA Displays information about the allocated page sets.
DISC Displays information about SQL claimers.
DISL Displays information about locks for this object.
DISR Displays information about restrictions on use for this object.
DIST Displays information about threads for this object.
DISU Displays information about correlation or connection IDs for this
object.
DK Deletes the rows for the package.
DP Shows the dependencies on an object.
DQ Deletes the rows for the query number.
DRD Drops the Restrict on Drop attribute for the table.
DROP Drops the object or constraint.
DROPM Drops a materialized query from a materialized query table,
changing the materialized query table into a table.
DROPSYN Drops the synonym for the table.
DRPV Drop version.
DS Shows the database structure.
DSN Displays the data set names for the associated table space or index
space.
DSP Shows the database structure, including plans and packages that
are dependent on the table spaces, tables, views, aliases, synonyms,
and indexes.
E Normally, E shows related data types. On some panels, E edits the
member (which is indicated on the panel).
| EA Edits the job to analyze the change.
| ER Edits the job to run the change (or the job to promote the change).
EN, ENDI Shows the connections that are either enabled or disabled for the
object.
ENV Displays the environment variables for the selected object.
F On the BIND and REBIND panels, frees the object. On all other
panels, shows related functions.
FC Shows the From Column.
FK Shows information about the referential integrity defined for
foreign keys.
FR Shows explain function table rows.
G Shows the storage groups for the object.
GEN Generates SQL for the objects from the DB2 catalog.
GR, GRANT Grants privileges for the object.
| GV Generates a new version file for the version scope.
H Shows the homonyms for the object.

Chapter 26. DB2 Admin commands 619


Table 27. DB2 Admin special line commands (continued)
Command Description
I Shows detailed information about the object.

For the System Administration panels, it can also mean insert the
row.
ICS Shows the status of image copies for the object.
| IG Shows the ignores for the object.
IH Inserts an optimizer hint.
| IL Shows the definition (or the ignore lines) for the ignore.
ILOC Inserts a location.
ILUM Inserts LU modes.
IMODE Inserts a mode.
INS Inserts a row into a table or inserts a change, mask, ignore, or
version scope.
IUSER Inserts an authorization ID for a user.
J Shows triggers.
JAR Shows JAVA or JAR detail.
K Shows the packages for the object.
KT Shows key targets.
L Shows the collection for the object.

For the tables panels, L shows the rows in the table.

For the System Administration panels, L lists the catalog.


LA Adds an index to LISTDEF definition.
LAB Labels the object.
LISTC Shows the ICF catalog entries.
LKEY Shows the limit key values for a partitioned table or a partitioned
index.
LOC Shows the location.
LP Lists the PLAN_TABLE table for the object.
LST Shows statistics for LOB table space.
LU Shows the LU name.
LUM Shows the LU modes.
M Shows the DBRMs for the object.
| MA Shows the masks for the object.
MIG Migrates the table.
| ML Shows the definition (or the mask lines) for the mask.
MODE Shows the SYSMODESELECT rows for the location.
| O Shows related stored procedures. On the work statement list
| panels, runs the work statement list online.
| OR Shows the original change.
P Shows the plans for the object.
PA Shows information about the referential integrity defined for
parent tables.

620 User's Guide and Reference


Table 27. DB2 Admin special line commands (continued)
Command Description
PAR Shows information about the referential integrity defined for
parent relations.
PARM Shows the parameter list.
PK Shows the primary key for this table.
PL Shows the package lists for the object.
| PQ Shows the prerequisite changes for the change.
| PR For a change, promotes the associated base version file. For a base
| version, promotes the base version file.
PST Shows partition statistics.
| PT Changes the protected status of a base version from off to on, or
| vice versa, so that the base version cannot be deleted easily.
R Revokes the privilege for the object.
RB Rebinds the object.
| RC Recovers (or backs out) the completed change.
| RE Shows the recover change for the change.

| For the Authorization panels, RE shows the grantee role


| REG Regenerates version.
REM Comments on the object.
| REN Renames a table.

| For the Rename Index panel, REN renames an index.


| REP Generates a batch job that produces a printable report for the
| object from the DB2 catalog.
| REPV For native SQL procedures: ALTER PROCEDURE REPLACE
| VERSION
RESZ Resizes page sets.
RH Shows RUNSTATS history.
RI Shows the referential integrity constraints for the selected table and
its related tables
| RIT Shows the referential integrity constraints for the selected table
RIX RUNSTATS invalidate dynamic SQL cache for index spaces. Issued
from the Listdef Utilities panel (ADB25LU).
| RO For the System Catalog panels, displays the object owner role.
| RN Runs the change.
| RR For the Authorization panels, RR shows the grantor role.
| RST Restarts the job that runs the change.
RT Return type.
RTS Shows real-time statistics for index space (DB2 Version 7 and
higher).
RX RUNSTATS invalidate dynamic SQL cache for table spaces. Issued
from the Table Space Utilities panel (ADB21US), the Index Utilities
panel (ADB21UX), and the Listdef Utilities panel (ADB25LU).

Chapter 26. DB2 Admin commands 621


Table 27. DB2 Admin special line commands (continued)
Command Description
S Shows the table spaces for the object.

For the SQL Statements panels, S shows the column in the result.

For the System Administration panels, S displays or update the


table you selected.

For the ADB2DDF and ADB2ZD2 panels, S selects the location.

For the ADBDMT Launchpad panel, S starts the tool on that line.
SA Sorts in ascending order.
| SC Shows the version scopes.
SD Sorts in descending order.
SEL Builds the SQL SELECT statement for this object.
SEQ Identifies column information.
SM Displays space statistics for database.
| SO Shows the objects that are defined in the version scope.
SP Shows the table space's parts.
SQ, SQL Shows the SQL statements.
SR Shows explain statement table rows.
SRC Shows the source code for a stored procedure.
| ST Shows the specific table that is associated with the selected
| column. For changes, shows the statements in the change.
STA Starts the object.
STAFO Forces a start of the object.
STARO Starts the object for a read operation.
STARW Starts the object for a read/write operation.
STASP Starts all spaces for read/write.
STAUT Starts the object so a DB2 utility can access it (no SQL statements
can be issued against the object).
STO Stops the object.
STOQ Stops the stored procedure and queues requests.
STOR Stops the stored procedure and rejects requests.
STOSP Stops all spaces.
| SX Shows all of the indexes on the selected row's table that use the
| column name in a key.
T Shows the tables.
TC Shows the To column.
TERM Terminates the utility.
U Updates the row.
U.x Generates utility job streams by requesting a utility using one of
the codes in the following table.
UPD Updates the row in the ADBDMT Launchpad panel.
UR Updates the information provided by the RUNSTATS utility.

622 User's Guide and Reference


Table 27. DB2 Admin special line commands (continued)
Command Description
USER Shows the user names.
USERD Example of user-defined line command with DB2.
USERI Example of user-defined line command with ISPF.
USERP Example of user-defined line command with panel.
USERS Example of user-defined line command with SQL.
UT, UTL, UTIL Runs a DB2 utility job against the object.
V Shows the views on the object.
VB Shows the objects that are dependent on this view.
VD Shows the objects on which view is dependent.
VE Shows the versions.
VOL Shows the volumes.
| VS Shows how the view was created or, for a version, shows the
| version scope.
X Shows the indexes for the object.
XC Shows indexes, index columns, and key targets on table.
| XCHG Exchanges data between a base table and its associated clone table.
XML Shows the XML tables created for a base table.
XMLR Shows XML column information and the related XML table.
XP Shows the parts of the index.
Y Shows the synonyms for the object.
any installation-defined See the links for related reading.
command

The following table shows the utility line command codes.


Table 28. DB2 Admin utility line command codes
Command Description Valid on panel
U.BP Change batch job parameters ADB21S,
ADB25L
U.C Copy full ADB21S,
ADB21X,
ADB25L
U.CC Copy concurrent ADB21S,
ADB25L
U.CI Copy incremental ADB21S,
ADB25L
U.C2 Copy to copy ADB21S,
ADB21X,
ADB25L
U.DG Define GDG for copy data sets ADB21S,
ADB21X,
ADB25L
U.E Mergecopy ADB21S,
ADB25L

Chapter 26. DB2 Admin commands 623


Table 28. DB2 Admin utility line command codes (continued)
Command Description Valid on panel
U.EN Mergecopy–newcopy ADB21S,
ADB25L
U.K Check index ADB21S,
ADB21X,
ADB25L
U.KD Check data ADB21S
U.L Load (with input created from U) ADB21T
U.LX Load (with input created from UX or UL) ADB21T
U.M Modify ADB21S
U.N Repair NOCOPYPEND ADB21S,
ADB21X
U.NA Repair NOCHECKPEND ADB21S
U.NB Repair NORCVRPEND ADB21S
U.NL Repair LEVELID ADB21S
U.O Reorganize ADB21S,
ADB21X,
ADB25L
U.OC Reorganize with inline copy ADB21S
U.OI Reorganize index ADB25L
U.OO Reorganize online ADB21S,
ADB25L
U.OU Reorganize unload only ADB21S,
ADB25L
U.P Report recovery ADB21S,
ADB21X,
ADB25L
U.Q Quiesce ADB21S,
ADB25L
U.R RUNSTATS for a table space ADB21S,
ADB21X,
ADB25L
U.RB Rebuild index ADB21X,
ADB25L
U.RI RUNSTATS for an index ADB25L
U.RIR RUNSTATS index report ADB25L
U.RR RUNSTATS report ADB21S,
ADB21X,
ADB25L
U.RT RUNSTATS for a table (all) ADB21S,
ADB25L
U.RX RUNSTATS (invalidate dynamic cache) ADB21S,
ADB21X,
ADB25L
U.SM Standard maintenance ADB25L

624 User's Guide and Reference


Table 28. DB2 Admin utility line command codes (continued)
Command Description Valid on panel
U.TU Specify template usage ADB21S,
ADB21X,
ADB25L
U.U Unload ADB21S,
ADB21T,
ADB25L
U.UL Unload using UNLOAD utility ADB21T
U.UX Unload using reorganization unload external ADB21T
U.V Recover ADB21S,
ADB21X,
ADB25L
U.VC Recover to copy ADB21S
U.VG Recover to last GDG ADB21S
U.VI Recover index ADB21S
U.VL Recover log only ADB21S,
ADB25L
U.VP Recover to log point ADB21S,
ADB25L
U.VR Recover to RBA ADB21S,
ADB25L

General line commands

Three general line commands are available: minus (-), equal (=), and slash (/).
Related concepts
“Special line commands” on page 89
“Step 21. Define your own line commands” on page 70
“DB2 Admin restrictions on DB2 object names” on page 139
Related information
Chapter 16, “Running DB2 utilities,” on page 355
Chapter 4, “Using DB2 Admin panels,” on page 83

Chapter 26. DB2 Admin commands 625


626 User's Guide and Reference
Chapter 27. DB2 Admin data type conversions
DB2 Admin supports different data type conversions.

The following tables show the data type conversions that DB2 Admin supports.

X indicates that DB2 Admin supports the data type conversion.


Table 29. DB2 Admin data type conversions, part 1
New data type:
Original data sm. long var. long time
type: int. int. float dec. char. vchar. vchar. graph graph. vgr. date time st.
small integer X X X X1 X5 X5
integer X1 X X X1 X5 X5
float X X X X
1 1
decimal X X X X1 X5 X5 X X X
5 5 5 1 1 2 3
character X X X X X X X X X4
varchar X5 X5 X5 X1 X1 X X2 X3 X4
long varchar X1 X1 X X2 X3 X4
graphic X X X
vgraphic X X X
long vgraphic X X X
5 5
date X X X X
5 5
time X X X
5 5
time stamp X X X X X

Notes:
1. This conversion checks for truncation and number overflows. Displayed
during the ALC process and before job submission.
2. Indicates conversions from character, variable-length character, and long
variable-length character to date format. Examples of valid load formats
include:
v dd.mm.yyyy
v mm/dd/yyyy
v yyyy-mm-dd
3. Indicates conversions from character, variable-length character, and long
variable-length character to time format. Examples of valid load formats
include:
v hh.mm.ss
v hh:mm AM
v hh:mm PM
v hh:mm:ss
4. Indicates conversions from character, variable-length character, and long
variable-length character to time stamp format. Examples of valid load
formats include:
v yyyy-mm-dd-hh.mm.ss
v yyyy-mm-dd-hh.mm.ss.nnnnnn

© Copyright IBM Corp. 1995, 2010 627


5. Support is available for this conversion in APAR PQ66500.

| The following table shows further data type conversions that DB2 Admin supports.

| An A or a D indicates that DB2 Admin supports the data type conversion. The
| object action for A is ALTER, and the object action for D is DROP or DROP-SC.
| Table 30. DB2 Admin data type conversions, part 2
| New data type:
| dec dec
| Original data sm long float float var
| type: int int float dec char vchar vchar big int (16) (34) binary binary
| small integer A A A
| integer A A A
| float D A A
2
| decimal A A A
| character A1 A1
| varchar A1 A1
| long varchar A
| big integer D D D A D A
| dec float (16) D D D D D A
| dec float (34) D D D D D D
| binary A A
| var binary A A
|

| Notes:
| 1. The original column must be defined as FOR BIT DATA.
| 2. Due to a potential issue when converting from DECIMAL(19,0) to
| BIGINT using DB2 ALTER statement, the product instead will perform
| a DROP along with data conversion in order to detect the data issue.
| Consult the DB2 Version 9.1 for z/OS SQL Reference ALTER TABLE
| statement for further details.

| Attention:
| 1. If the truncation action chosen on ADB27CT is “Z” or “T”, the action will be
| DROP.
| 2. If the conditions in the Notes column above are not met, the action is a
| DROP-SC.
| 3. Changing NULL to NOT NULL requires a DROP operation.
Related concepts
“Changing tables” on page 252
“How the DB2 Admin Alter ALC function works” on page 272
Related information
IBM Publications Center

628 User's Guide and Reference


Chapter 28. DB2 Admin with a large number of objects
Enterprise Resource Planning (ERP) applications are increasingly using DB2 for
z/OS.

These ERP systems typically have a large number of objects, such as 1 000
databases, 10 000 to 30 000 table spaces, and 20 000 to 100 000 tables that have
one or more indexes. Administering such large DB2 systems is a challenge, and
when you use certain DB2 Admin functions, you must take into account the large
number of objects. In addition, the data sets that are allocated for DB2 Admin and
ISPF functions must be large enough to accommodate the large number of objects.

Topics:
v “ISPF work data sets” on page 630
v “Output data sets for GEN DDL” on page 630
v “Other recommendations for a large number of objects” on page 630

© Copyright IBM Corp. 1995, 2010 629


ISPF work data sets
DB2 Admin uses ISPF file tailoring services when generating batch jobs. The ISPF
services uses preallocated work data sets when generating the JCL for the batch
jobs. However, when you generate JCL for many objects, the preallocated ISPF
work data sets might not be large enough.

The ISPF work data sets are either allocated by the TSO logon procedure or
dynamically allocated based on ISPF customization parameters. When you
generate batch jobs for many objects, you might need to have the allocations
changed for the data sets with these ISPF DD names:
v ISPCTLn (where n=0, 1, 2, ...)
v ISPWRK1
v ISPWRK2

The recommended space allocation for these data sets is SPACE=(CYL,(1,5). This
space allocation allows for generating batch jobs with 115,000 lines of JCL, using
three extents. If you are experiencing space problems (x37 abends), contact your
storage administrator to have the space allocations changed for the above DD
names.

Output data sets for GEN DDL


When you use the DB2 Admin GEN function to generate DDL for objects in the
DB2 catalog, you can choose to place the DDL in different types of output data
sets.

| When you use the DB2 Admin GEN function to generate DDL for objects in the
| DB2 catalog, you can choose to place the DDL in:
| v An existing or new data set
| v An existing or new work statement list (WSL) data set

| When you generate DDL for a large number of objects and specify that a new data
| set be used, either a regular data set or a WSL data set, the default space allocation
| that DB2 Admin uses might not be sufficient.

If you are experiencing x37 abends on the output data set (either regular or WSL)
for the generated DDL, use a preallocated data set instead of a new data set.
Define the DDL output data set with the following attributes:
RECFM=FB
LRECL=80

The generated DDL for all the objects in an ERP system can get very large, for
example, 3 million lines of statements. The GEN DDL output data set for that
number of statements would require 287 cylinders. You can use ISPF option 3.2 to
| preallocate a large data set. A WSL data set must be a partitioned data set.

Other recommendations for a large number of objects


You should follow certain recommendations when you use DB2 Admin in an
environment that has a large number of objects.

The following recommendations will help you use DB2 Admin with a large
number of objects:

630 User's Guide and Reference


v Reduce the number of objects for primary commands. Running DB2 Admin
primary commands on a very large number of objects can take some time and
locks your ISPF session while the objects are being processed. If possible, when
searching for objects in the DB2 catalog (DB2 Admin option 1), limit the number
of objects by specifying a narrower search criteria.
v When searching for objects in the DB2 catalog (DB2 Admin option 1), use a
search criteria that allows DB2 to use indexes to retrieve the information that
you need. For more information, see the online help for the System Catalog
panel (ADB21).
v Add the recommended indexes to the DB2 catalog.
v Run RUNSTATS on the DB2 catalog.
v Ensure that there is free space on the DASD volumes that you are using. DB2
Admin functions might need to expand the data sets beyond the primary
allocation. Extending the data sets with secondary extents requires that the
DASD volume has sufficient free space. If you are experiencing problems with
space on data sets that have not reached their maximum extents, contact your
storage administrator. The storage administrator might need to change the
storage policy for these data sets to avoid the problems.
v Ensure that your batch jobs can get sufficient virtual storage. Some DB2 Admin
functions keep information in storage while processing through the objects. If
you are experiencing out-of-storage abends, specify a large region size on the job
card, for example, 64 MB. If you still experience abends, contact your system
administrator because the installation limits in the system that you are using
might be causing the problem.
v Ensure that your batch jobs can get sufficient CPU time. When you generate the
DDL for a large number of objects, you might, depending on your installation
settings and processor speed, need to add a TIME=n option on your job card.
The recommended initial value for n is 180 (CPU minutes).
Related concepts
“Step 20. Run the RUNSTATS utility” on page 70
Related tasks
“Step 18. Create additional DB2 catalog indexes” on page 69

Chapter 28. DB2 Admin with a large number of objects 631


632 User's Guide and Reference
Part 6. Troubleshooting
Use the following topics to diagnose and correct problems that you experience
with DB2 Admin.

© Copyright IBM Corp. 1995, 2010 633


634 User's Guide and Reference
Chapter 29. Troubleshooting
Use these topics to diagnose and correct problems that you experience with DB2
Admin.

Topics:
v “Gathering diagnostic information” on page 636
v “DB2 Admin messages and codes” on page 637

© Copyright IBM Corp. 1995, 2010 635


Gathering diagnostic information
Before you report a problem with DB2 Admin to IBM Software Support, you need
to gather the appropriate diagnostic information.

If you receive DB2 Admin error messages that do not contain adequate information
regarding the actions you should take, use the following information to diagnose
common problems before contacting the IBM Support Center. The information that
you gather to diagnose the problem is required when you open an incident with
the DB2 Admin Support team.
v For general abends, obtain the following information:
– ABEND code
– Dump title
– Failing module/CSECT name
– A printout of the traceback from a Language Environment® (LE) dump
– Recent maintenance applied
– Recent changes to the system
– Frequency of abend, or prevailing conditions when the abend occurred. For
example, does the abend occur for only a single user ID?
– VTAM message
– MVS ABENDs
– Dumps, as appropriate
v Documentation that is required when contacting the support team:
– DB2 Admin version number, release number, and maintenance level.
– DB2 version number, release number, and maintenance level.
– Is DB2 data sharing used?
– Is a remote DB2 subsystem involved?
– A complete explanation of the problem encountered.
– Complete job output of failing jobs.
– If problems occur using the ONLINE mode, send screen shots of any error
messages and screen shots of all panels leading up to the error.
– Appropriate input parameters for re-creating the problem scenario.
– Complete DDL that fails, if appropriate.
– A screen shot of the DB2 Admin Options panel.
– Any work statement lists, mask data sets, or IGNORE data sets that apply.
Related reference
“DB2 Admin Reverse Engineering condition codes” on page 637

636 User's Guide and Reference


ADB100E • ADB456E

DB2 Admin messages and codes


Use the information in these messages to help you diagnose and solve DB2 Admin
problems.

Topics:
v “DB2 Admin Reverse Engineering condition codes”
v “DB2 Admin messages”

DB2 Admin Reverse Engineering condition codes


A DB2 Admin Reverse Engineering job that is running can issue condition codes.

The following condition codes can be issued:


0 Successful run.
4 Parameter error. The parameter is ignored, or the default is used. No generate
requests are issued. Requested object is not found. A warning is issued.
8 No parameters found. Processing ended. The DB2 version is not yet supported.
Other Errors might be issued.
12 DB2 version is not supported. Processing ended. Remote location is not
defined or is not a DB2 MVS system. Internal error or limitation. Other severe
errors are detected.
16 Severe error.
Related concepts
“Sample output with the Rebind option” on page 186
Related reference
“Gathering diagnostic information” on page 636

| DB2 Admin messages


| When you use DB2 Admin functionality, messages might be issued.

| Not all DB2 Admin messages are included in this section.


|
| ADB100E A parameter was omitted or an invalid
| v Changing from an external procedure, such as PLI, to
| an SQL procedure
| parameter value was passed to module
| name module_name. | v Changing from an SQL procedure to a non-SQL
| procedure
| Explanation: A required parameter has not been
| located in the parameter string passed to the program.
| v Changing from an SQL external procedure to a
| native stored procedure
| System action: None.
| User response: If the parameter string was edited,
| Changing from an external procedure to another of a
| different language is allowed, but not recommended.
| provide the missing parameter, and ensure the
| parameter value is valid. If the parameter was omitted | System action: None.
| by the product, contact IBM Software Support.
| User response: Restore the original language or native
| | stored procedure value to the appropriate field.
| ADB338E Invalid specification. Changing
| procedure types during CREATE is not |
| allowed from this panel. | ADB456E The database already exists. Enter a new
| database name.
| Explanation: The following changes are not allowed
| when using the CRE (Create Like) line command from | Explanation: The database cannot be renamed to an
| panel ADB21O: | existing database name.

Chapter 29. Troubleshooting 637


ADB471E • ADB703E

| System action: None. | Combine job steps=NO


| User response: Enter a new database name in the | Member name or prefix=ADBTS (five chars)
| New database name field and press Enter. | Unload Method=H
| | System action: Processing stops.
| ADB471E The specified database name is implicit.
| Enter a new database name.
| User response: Specify a prefix that is less than five
| characters for the job member names.
| Explanation: The database cannot be renamed to an
| implicit database name, such as DSNnnnnn where |
| nnnnn is a numeric value. | ADB700E Column not allowed. Column
| column_name cannot be specified as part
| System action: None. | of the primary key because it is a
| DECFLOAT, XML, or LOB data type, or
| User response: Enter a new database name in the
| it is a row-change-timestamp column.
| New database name field and press Enter.
| Explanation: DB2 does not allow a column of the
|
| indicated type to be included as one of the primary key
| ADB472W No utilities (except UNLOAD) will be
| columns for the table.
| generated for implicit table spaces.
| System action: Processing stops.
| Explanation: The RENDB function will not generate
| utilities for implicit table spaces. | User response: Remove the column from the primary
| key specification.
| System action: This warning message is displayed if
| the database to be renamed has at least one implicit |
| table space. | ADB701E Column not allowed. Column
| column_name cannot be specified as part
| User response: Press Enter if you want to continue
| of the unique key because it is a LOB
| processing.
| data type.
|
| Explanation: DB2 does not allow a unique key to be
| ADB473E The specified database name is
| created for a LOB column data type.
| reserved. Enter a new database name.
| System action: Processing stops.
| Explanation: The database cannot be renamed to a
| reserved database name of DSNDB01, DSNDB04, | User response: Remove the column from the
| DSNDB06, or DSNDB07. | specification.
| System action: None. |
| ADB702E Column not allowed. Column
| User response: Enter a new database name in the
| column_name cannot be specified as part
| New database name field and press Enter.
| of the foreign key because it is a LOB
| | data type.
| ADB526E An XML column defined as NOT NULL
| Explanation: DB2 does not allow a column of the
| and no default cannot be added.
| indicated type to be included in a foreign key
| Explanation: An XML column cannot be added with | definition.
| the NOT NULL attribute and no default, since there is
| System action: Processing stops.
| no default data value to LOAD for columns.
| User response: Remove the column from the
| System action: Processing stops.
| specification.
| User response: Re-specify the attributes to allow null
|
| values.
| ADB703E Column not allowed. Column
| | column_name cannot be specified as a
| ADB559F The LOAD job member names to be | column of a parent key in a
| generated exceed eight characters. | REFERENCES clause because it is a
| Specify a prefix that is less than five | LOB data type.
| characters for the job member names.
| Explanation: DB2 does not allow a column of the
| Explanation: Because numerous tables are being | indicated type to be included in a REFERENCES clause.
| processed, the LOAD job member names to be
| System action: Processing stops.
| generated exceed eight characters (ADBTSnnRL) This
| error occurs when the table space being Altered or | User response: Remove the column from the
| Redefined has more than nine tables and the following | specification.
| options are specified:

638 User's Guide and Reference


ADB704E • ADB723E

| |
| ADB704E Column not allowed. Column | ADB709E Column not allowed. Column
| column_name cannot be specified as a | column_name cannot be provided as a
| column of a partitioning key because it | column in the constraint because it is a
| is a data_type data type. | DECFLOAT, XML or LOB data type, or
| it is a row-change- timestamp column.
| Explanation: DB2 does not allow a column of the
| indicated type to be included as one of the partitioning | Explanation: DB2 does not allow a column of the
| columns for the table. | indicated type to be included in the constraint
| System action: Processing stops. | System action: Processing stops.
| User response: Remove the column from the | User response: Remove the column from the
| specification. | specification.
| |
| ADB705E Operation not allowed. Column | ADB710E Operation not allowed. Column
| column_name cannot be changed to a | column_name cannot be converted from
| LOB column because a check constraint | NULL to NOT NULL.
| exists on this column.
| Explanation: The column cannot be converted from
| Explanation: DB2 does not allow a column of the | NULL to NOT NULL.
| indicated type to be included in a check constraint.
| System action: Processing stops.
| System action: Processing stops.
| User response: Retain the NULL specification.
| User response: Remove the column from the
| specification.
|
| ADB711E Operation not allowed. A hidden
| | column cannot be altered.
| ADB706E Operation not allowed. Column
| column_name cannot be changed to a
| Explanation: A hidden column cannot be altered.
| LOB column because a field procedure | System action: Processing stops.
| exists on this column.
| User response: Retain the column's original
| Explanation: A column with a field procedure cannot | specification.
| be changed to a LOB data type.
|
| System action: Processing stops. | ADB712E Improper length. A LOB column cannot
| User response: Remove the field procedure prior to
| be shortened in length.
| changing the column definition. | Explanation: A LOB column's length cannot be
| | reduced.
| ADB707E Operation not allowed. Column | System action: Processing stops.
| column_name cannot have a default
| value. Only NULL is allowed. | User response: Retain the original column's length.

| Explanation: DB2 does not allow the column to have a |


| default value. Specifying NULL is allowed. | ADB720E Column column_name cannot be
| specified as a column of an index key
| System action: Processing stops. | due to its data type, data_type.
| User response: Specify NULL as required. | Explanation: A column of the selected data type
| | cannot be specified as part of an index.
| ADB708E Operation not allowed. Column | System action: Processing stops.
| column_name cannot be converted from a
| LOB data type to any other data type. | User response: Select a column with a data type that
| can be part of an index.
| Explanation: Data type conversion from a LOB data
| type is not allowed. |
| ADB723E Operation not allowed. A table defined
| System action: Processing stops. | with DATA CAPTURE CHANGES
| User response: Specify a data type conversion that is
| cannot be placed into a NOT LOGGED
| allowed.
| table space.
| Explanation: A table defined with the DATA
| | CAPTURE CHANGES attribute cannot be placed into a
| table space defined with the NOT LOGGED attribute.

Chapter 29. Troubleshooting 639


ADB724E • ADB735E

| System action: Processing stops. | indicated data type is not permitted.


| User response: Specify a table space with the proper | System action: Processing stops.
| DB2 logging attribute, or remove the DATA CAPTURE
| CHANGES attribute from the table. | User response: Respecify the column without
| changing the data type.
|
| ADB724E Operation not allowed. A table cannot
|
| be moved to an implicitly created
| ADB729E Conversion from column_type to
| database or table space.
| new_column_type data type is not allowed
| since the source column is not defined
| Explanation: A table cannot be placed into a table | as FOR BIT DATA.
| space which was implicitly created by DB2. .
| Explanation: The original column is not defined as
| System action: Processing stops. | FOR BIT DATA. Conversion is only allowed on FOR
| BIT DATA columns.
| User response: Specify a table space that was
| explicitly created. | System action: Processing stops.
| | User response: None.
| ADB725E A row change timestamp column cannot
| be added to the table.
|
| ADB730E Operation not allowed. The target table
| Explanation: Adding a ROW CHANGE TIMESTAMP | space must be of the same partitioning
| column is not permitted. | type as the existing table space
| (partition by growth or partition by
| System action: Processing stops.
| range).
| User response: Respecify the column without the
| Explanation: Moving a table to a table space of a
| ROW CHANGE TIMESTAMP attribute.
| different format when the old or new table space is
| | partitioned by growth is not permitted.
| ADB726E Conversion to or from a row change
| System action: Processing stops.
| timestamp column is not allowed.
| User response: Specify a target table space of the
| Explanation: Changing to or from a ROW CHANGE
| same type as the table's current table space.
| TIMESTAMP column is not permitted
|
| System action: Processing stops.
| ADB731E Too many operations performed. Only
| User response: Respecify the column without | one operation is allowed at a time.
| changing to or from a ROW CHANGE TIMESTAMP
| Explanation: The combination of operations is not
| attribute.
| allowed.
|
| System action: Processing stops.
| ADB727W Different columns in the primary key
| definition were specified, or the length | User response: Specify one operation at a time.
| of a primary key column was increased.
|
| Explanation: The primary key columns for the table | ADB731E Too many operations performed. Only
| were respecified, or a column length was changed. The | one operation is allowed at a time.
| primary key must be dropped first, which will result in
| the loss of any referential integrity definition based
| Explanation: The combination of operations is not
| upon the primary key definition.
| allowed.

| System action: This message is issued as a warning | System action: Processing stops.
| and an action prompt panel is displayed. | User response: Specify one operation at a time.
| User response: An ALTER TABLE ... DROP PRIMARY |
| KEY statement is needed to perform this change. Use | ADB735E An upgrade cannot be done. The table
| option 3 to create new referential constraints and any | table_name can only be upgraded from
| required new indexes. | the previous release to the current
| | release. Re-create the table.
| ADB728E Conversion from column_type to | Explanation: An upgrade cannot be done to the
| new_column_type data type, or changing | control table table_name because it is not at the proper
| the length of a column_type data type is | level.
| not allowed.
| System action: None.
| Explanation: Changing the data type to or from the

640 User's Guide and Reference


ADB737E • ADB1662W

|
| User response: Drop and re-create the TEMPLATE
| ADB1457e The number of package dependencies
| control table.
| has exceeded the product limit of 32K.
|
| Explanation: A product limit has been reached. The
| ADB737E Incorrect table format. The table
| maximum number of package.dependencies for each
| table_name does not have the expected
| package is 32K.
| column names, data types, or both.
| Check the current definition of the | System action: Processing stops.
| TEMPLATE control table.
| User response: None.
| Explanation: The identified TEMPLATE control table
| cannot be upgraded because the table definition is
|
| incorrect.
| ADB1458e The number of packages has exceeded
| the product limit of 32K.
| System action: None.
| Explanation: A product limit has been reached. The
| User response: Check the table name and the table | maximum number of packages that can be generated is
| owner to see if it is a control table. LISTDEF and | 32K.
| TEMPLATE control tables are DB2 control tables. Thus,
| they could be created during DB2 installation by the
| System action: Processing stops.
| DSNTIJCC member. DB2 Administration Tool could | User response: None.
| also be used to create LISTDEF and TEMPLATE control
| tables. The default name for LISTDEF control tables is |
| DSNACC.UTLIST, and the default name for | ADB1660W The database was skipped because a
| TEMPLATE control tables is DSNACC.UTTEMPLATE. | temporary database is not supported in
| See LISTDEFs and TEMPLATEs in this User Guide for | DB2 V9 or later versions.
| further information. | Explanation: A temporary database is being generated
| | for DB2 V9 function mode, but the DB2 V9 function
| ADB900E Error condition. An unrecognized object | mode does not support temporary databases. The GEN
| type object_type was passed when virtual | function will not generate DDL for the temporary
| changes were applied. | database.

| Explanation: The object type is unrecognized. It is | System action: None. GEN processing continues.
| unlikely that this error will cause a problem. | User response: No action is required.
| System action: Processing continues. |
| User response: Contact IBM support to report the | ADB1661W Table space database table_space was
| message. | skipped because it was implicitly
| created.
|
| ADB1429W Clone table clone_schema clone_name | Explanation: The GEN functon does not generate
| required that base table base_table_schema | information for an implicit table space for XML
| base_table_name exist before the clone can | columns.
| be created. | System action: None. GEN processing continues.
| Explanation: The GEN function created DDL to add a | User response: No action is required.
| clone, but the base table is not part of the DDL.
|
| System action: None. | ADB1662W Table table_creator table_name was
| User response: No action is necessary if you do not | skipped because it is an implicit table
| want the base table included in the DDL. Otherwise, | that was created for XML columns.
| include the base table base_ table_schema base_ table_ | Explanation: GEN does not generate information for
| name and run GEN again. | an implicit table space that was created for XML
| | columns.
| ADB1456e The number of plan dependencies has | System action: None. GEN processing continues.
| exceeded the product limit of 32K.
| User response: No action is required.
| Explanation: A product limit has been reached. The
| maximum number of plan dependencies for each plan ||
| is 32K.
|
| System action: Processing stops.
| User response: None.

Chapter 29. Troubleshooting 641


ADB1663W • ADB3000E

| |
| ADB1663W The owner of object_type | ADB1918E An unknown formatter error occurred.
| qualified_object_name is a role. | GEN cannot complete the request.
| Explanation: If the object owner should be a role | Explanation: Since the GEN request contained DDL
| when the object is created, a trusted context must be | changes (such as masking, change owner, change
| established when creating the object. | schema, or Run SQLID), processing stops.
| System action: None. GEN processing continues. | System action: Processing stops.
| User response: Establish a trusted context to create the | User response: Run GEN again with no DDL changes.
| object with a role as the object owner. You can ignore
| this message if you do not want a role as the object
|
| owner.
| ADB1919W Unformatted DDL will be generated for
| the following object because the
| | formatted DDL exceeded 2 MB. Verify
| ADB1915W The original DDL for the following | the DDL.
| object will be generated as it is stored
| in DB2. Verify the DDL.
| Explanation: The output formatter buffer size was
| exceeded. Since the GEN request did not contain any
| Explanation: The internal DDL buffer of the DDL | DDL changes (such as masking, change owner, change
| statement the GEN program attempted to create | schema, or Run SQLID), the unformatted DDL is
| exceeded 2 MB. Since the GEN request did not contain | generated.
| any DDL changes (such as masking, change owner,
| change schema, or Run SQLID) the original DDL that is
| System action: None.
| stored in DB2 is generated. | User response: Verify the DDL is correct.
| System action: None. |
| User response: Verify the DDL is correct. | ADB1920E The formatted DDL has exceeded 2 MB.
| GEN cannot complete the request
| | because DDL changes were specified.
| ADB1916E The DDL for the following object
| cannot be created within the 2 MB limit.
| Explanation: The output formatter buffer size was
| GEN cannot complete the request.
| exceeded. Since the GEN request contained DDL
| changes (such as masking, change owner, change
| Explanation: The DDL statement the GEN program | schema, or Run SQLID), processing stops. GEN cannot
| attempted to create exceeded the output buffer size. | complete the request.
| The GEN program will not attempt to generate the
| original DDL stored in DB2. This is probably because a
| System action: Processing stops.
| request was made to change the DDL (such as | User response: Run GEN again with no DDL changes.
| masking, change owner, change schema, or Run
| SQLID), or the object is a native stored procedure and |
| it has a table parameter. | ADB3000E An error occurred while processing
| object name object_name in statement
| System action: GEN processing stops. | type statement_type. The object already
| User response: Run GEN again, but with no DDL | exists.
| change requests. | Explanation: The syntax of the generated SQL
| | statements is being validated to ensure consistency. The
| ADB1917W Unformatted DDL will be generated for | object name obj_name in statement type statement_type is
| the following object because of an
| not correct in the identified SQL statement.
| unknown formatter error. Verify the | System action: Processing stops.
| DDL.
| User response: If you are validating a work statement
| Explanation: An unknown internal formatter error | list (WSL), correct the SQL statement in the WSL and
| occurred. Since the GEN request did not contain any | revalidate the WSL. If you are using DB2 Object
| DDL changes (such as masking, change owner, change | Comparison Tool to compare objects, correct the SQL
| schema, or Run SQLID), the unformatted DDL is | statement in the DDL source and regenerate the
| generated.. | compare job.
| System action: None.
||
| User response: Verify the DDL is correct.
|
|

642 User's Guide and Reference


ADB3001E • ADB3007E

|
| ADB3001E An error occurred while processing
| System action: Processing stops.
| object name object_name in statement | User response: If you are validating a work statement
| type statement_type. The object does not | list (WSL), correct the SQL statement in the WSL and
| exist. | revalidate the WSL. If you are using DB2 Object
| Explanation: The syntax of the generated SQL | Comparison Tool to compare objects, correct the SQL
| statements is being validated to check consistency. The | statement in the DDL source and regenerate the
| object name object_name does not exist. | compare job.

| System action: Processing stops. |


| ADB3005E An error occurred while processing
| User response: If you are validating a work statement | object name object_name in statement
| list (WSL), correct the SQL statement in the WSL and | type statement_type. The object and a
| revalidate the WSL. If you are using DB2 Object | foreign key must exist.
| Comparison Tool to compare objects, correct the SQL
| statement in the DDL source and regenerate the
| Explanation: The syntax of the generated SQL
| compare job.
| statements is being validated to check consistency.
| Ensure that the object and a foreign key exist.
|
| ADB3002E An error occurred while processing
| System action: Processing stops.
| object name object_name in statement | User response: If you are validating a work statement
| type statement_type. The object does not | list (WSL), correct the SQL statement in the WSL and
| exist. | revalidate the WSL. If you are using DB2 Object
| Explanation: The syntax of the generated SQL | Comparison Tool to compare objects, correct the SQL
| statements is being validated to check consistency. The | statement in the DDL source and regenerate the
| object name object_name does not exist. | compare job.

| System action: Processing stops. |


| ADB3006E An error occurred while processing
| User response: If you are validating a work statement | object name object_name in statement
| list (WSL), correct the SQL statement in the WSL and | type statement_type. Column column_name
| revalidate the WSL. If you are using DB2 Object | does not exist in the table.
| Comparison Tool to compare objects, correct the SQL
| statement in the DDL source and regenerate the
| Explanation: The syntax of the generated SQL
| compare job.
| statements is being validated to check consistency.
| Column column_name does not exist in the table.
|
| ADB3003E An error occurred while processing
| System action: Processing stops.
| object name object_name in statement | User response: If you are validating a work statement
| type statement_type. A clustering index | list (WSL), correct the SQL statement in the WSL and
| already exists on object name | revalidate the WSL. If you are using DB2 Object
| object_name. | Comparison Tool to compare objects, correct the SQL
| Explanation: The syntax of the generated SQL
| statement in the DDL source and regenerate the
| statements is being validated to check consistency. A
| compare job. The SQL statement should not reference
| clustering index already exists on object name
| the identified column.
| object_name. |
| System action: Processing stops | ADB3007E An error occurred while processing
| object name object_name in statement
| User response: If you are validating a work statement | type statement_type. Column name
| list (WSL), correct the SQL statement in the WSL and | column_name is not part of the parent
| revalidate the WSL. If you are using DB2 Object | table primary key.
| Comparison Tool to compare objects, correct the SQL
| statement in the DDL source and regenerate the
| Explanation: The syntax of the generated SQL
| compare job.
| statements is being validated to check consistency.
| Column name column_name is not part of the parent
| | table primary key.
| ADB3004E An error occurred while processing
| object name object_name in statement
| System action: Processing stops.
| type statement_type. The object was | User response: If you are validating a work statement
| dropped many times. | list (WSL), correct the SQL statement in the WSL and
| Explanation: The syntax of the generated SQL | revalidate the WSL. If you are using DB2 Object
| statements is being validated to check consistency. The | Comparison Tool to compare objects, correct the SQL
| object was dropped many times.
Chapter 29. Troubleshooting 643
ADB3008E • ADB3013E

|
| statement in the DDL source and regenerate the
| ADB3011E An error occurred while processing
| compare job.
| object name object_name in statement
| | type statement_type. The table space is
| ADB3008E An error occurred while processing | partitioned but a partitioning index has
| object name object_name in statement | not been found.
| type statement_type. The referenced key
| Explanation: The syntax of the generated SQL
| has been dropped.
| statements is being validated to check consistency. The
| Explanation: The syntax of the generated SQL | table space is partitioned but a partitioning index has
| statements is being validated to check consistency. The | not been found.
| referenced key has been dropped.
| System action: Processing stops.
| System action: Processing stops.
| User response: If you are validating a work statement
| User response: If you are validating a work statement | list (WSL), correct the SQL statement in the WSL and
| list (WSL), correct the SQL statement in the WSL and | revalidate the WSL. If you are using DB2 Object
| revalidate the WSL. If you are using DB2 Object | Comparison Tool to compare objects, correct the SQL
| Comparison Tool to compare objects, correct the SQL | statement in the DDL source and regenerate the
| statement in the DDL source and regenerate the | compare job. Ensure that a partitioning index is defined
| compare job. | in the WSL or DDL source.

| |
| ADB3009E An error occurred while processing | ADB3012E An error occurred while processing
| object name object_name in statement | object name object_name in statement
| type statement_type. The number of index | type statement_type. The primary index
| partitions does not match the number of | or index enforcing unique constraint
| table space partitions. | does not have a matching primary or
| unique key.
| Explanation: The syntax of the generated SQL
| statements is being validated to check consistency. The | Explanation: The syntax of the generated SQL
| number of index partitions does not match the number | statements is being validated to check consistency. The
| of table space partitions. | primary index or index enforcing unique constraint
| does not have a matching primary or unique key.
| System action: Processing stops.
| System action: Processing stops.
| User response: f you are validating a work statement
| list (WSL), correct the SQL statement in the WSL and | User response: If you are validating a work statement
| revalidate the WSL. If you are using DB2 Object | list (WSL), correct the SQL statement in the WSL and
| Comparison Tool to compare objects, correct the SQL | revalidate the WSL. If you are using DB2 Object
| statement in the DDL source and regenerate the | Comparison Tool to compare objects, correct the SQL
| compare job. Ensure that the number of index | statement in the DDL source and regenerate the
| partitions specified in the SQL statement is same as the | compare job. Ensure that a primary key or unique key
| number of table space partitions. | that matches the index is defined in the WSL or DDL
| source.
|
| ADB3010E An error occurred while processing |
| object name object_name in statement | ADB3013E An error occurred while processing
| type statement_type. The referenced | object name object_name in statement
| column column_name does not exist in | type statement_type. The primary key or
| the parent table. | unique key does not have a matching
| primary index or index enforcing
| Explanation: The syntax of the generated SQL | unique constraint.
| statements is being validated to check consistency. The
| referenced column column_name does not exist in the | Explanation: The syntax of the generated SQL
| parent table. | statements is being validated to check consistency. The
| primary key or unique key does not have a matching
| System action: Processing stops. | primary index or index enforcing unique constraint.
| User response: If you are validating a work statement | System action: Processing stops.
| list (WSL), correct the SQL statement in the WSL and
| revalidate the WSL. If you are using DB2 Object | User response: If you are validating a work statement
| Comparison Tool to compare objects, correct the SQL | list (WSL), correct the SQL statement in the WSL and
| statement in the DDL source and regenerate the | revalidate the WSL. If you are using DB2 Object
| compare job. The SQL statement should not reference | Comparison Tool to compare objects, correct the SQL
| the identified column. | statement in the DDL source and regenerate the
| compare job. Ensure that a primary index or index

644 User's Guide and Reference


ADB3014E • ADB5000E

|
| enforcing unique constraint that matches the primary
| ADB3017E When obj_name stmt_typ is processed, a
| or unique key is defined in the WSL or DDL source.
| clone table does not exist.
|
| Explanation: A base table is attempting to drop a
| ADB3014E An error occurred while processing
| clone table, but that base table does not have a clone
| object name object_name in statement
| table.
| type statement_type. Either column
| column_name does not exist in the table | System action: After the Validate Report is generated,
| or the table does not exist. | a return code of 8 is set, and processing stops.
| Explanation: The syntax of the generated SQL | User response: If you are validating a WSL, correct
| statements is being validated to check consistency. | the SQL statement in the work statement list (WSL) and
| Either column column_name does not exist in the table | revalidate the WSL. If you are comparing objects with
| or the table does not exist. If the table is missing, the | DB2 Object Comparison Tool, correct the SQL statement
| first column from the table is reported as missing. | in the DDL source and regenerate the compare job.
| System action: Processing stops. |
| ADB3020W A warning occurred while processing
| User response: If you are validating a work statement
| object name object_name in statement
| list (WSL), correct the SQL statement in the WSL and
| type statement_type. Objects referred to
| revalidate the WSL. If you are using DB2 Object
| in Create/Alter/Comment/Drop/
| Comparison Tool to compare objects, correct the SQL
| Exchange/Label/ Rename might or might
| statement in the DDL source and regenerate the
| not exist during native stored
| compare job. Check the catalog or source to determine
| procedures runtime.
| whether the column does not exist or the table does not
| exist. Then, fix the SQL statement accordingly. | Explanation: The syntax of the generated SQL
| statements is being validated to check consistency.
|
| Objects referred to in Create/Alter/Comment/Drop/
| ADB3015E An error occurred while processing
| Exchange/Label/ Rename might or might not exist
| object name object_name in statement
| during native stored procedures runtime.
| type statement_type. Object name
| object_name in statement type | System action: Processing stops.
| statement_type does not exist; it has been
| renamed.
| User response: If you are validating a work statement
| list (WSL), correct the SQL statement in the WSL and
| Explanation: The syntax of the generated SQL | revalidate the WSL. If you are using DB2 Object
| statements is being validated to check consistency. | Comparison Tool to compare objects, correct the SQL
| Object name object_name in statement type | statement in the DDL source and regenerate the
| statement_type does not exist; it has been renamed. | compare job.
| System action: Processing stops. |
| ADB3201E After masks were applied, DBNAME
| User response: If you are validating a work statement
| obj_name1 results in an implicit or
| list (WSL), correct the SQL statement in the WSL and
| system-reserved database DSN00001.
| revalidate the WSL. If you are using DB2 Object
| Comparison Tool to compare objects, correct the SQL | Explanation: The specified DBNAME mask definition
| statement in the DDL source and regenerate the | results in an implicit or system-reserved database,
| compare job. Determine what the object that is reported | which is not valid because the database is not accepted
| as missing was renamed to, and correct the identified | by DB2.
| SQL statement to use that name.
| System action: A return code of 8 is set and
| | processing stops.
| ADB3016E When obj_name stmt_typ is processed,
| obj_name2 already exists.
| User response: Correct the definition of the DBNAME
| mask, and resubmit the job.
| Explanation: A base table already has a clone table
| and is trying to add another clone without dropping |
| the existing clone. | ADB5000E An invalid value specified for parameter
| insert1.
| System action: After the validate report is generated,
| a return code of 8 is set, and processing stops. | Explanation: An invalid value was specified for the
| parameter.
| User response: If you are validating a work statement
| list (WSL), correct the SQL statement in the WSL and
| System action: Processing stops.
| revalidate the WSL. If you are comparing objects with | User response: Specify a valid value for the
| DB2 Object Comparison Tool, correct the SQL statement | parameter.
| in the DDL source and regenerate the compare job.

Chapter 29. Troubleshooting 645


ADB5001E • ADB5031W

|
| ADB5001E The PLAN= parameter was not found.
| User response: None.

| Explanation: The ADBOPT parameter of PLAN= is |


| required for ADBTEPA. | ADB5011W ADBCHKPT update failed for
| WORKLIST(Wklist) during
| System action: Processing stops. | RESTART(NO) processing.
| User response: Provide the PLAN= parameter in the | System action: Processing continues.
| ADBOPT DD card.
| User response: None.
|
| ADB5002E The ADBTEPA invocation was not from
|
| an APF-authorized environment.
| ADB5017E The ADBCHKPT checkpoint table does
| not exist.
| System action: Processing stops.
| System action: Processing stops.
| User response: Use APF to authorize all data sets in
| the STEPLIB. | User response: Check the package qualifier of
| ADBTEP2.
|
| ADB5003E A failure occurred attempting command
|
| RexxCmd1.
| ADB5021W The preceding query was cancelled by
| RLF after successful retrieval of RecCnt
| Explanation: The provided command failed for an | rows.
| undetermined reason.
| System action: The cursor is closed and processing
| System action: Processing stops. | continues.
| User response: If possible, resolve the problem and | User response: None.
| run the RexxCmd1 command again.
|
| | ADB5025E A "Not Found" condition was
| ADB5007E An invalid input parameter InvalidParm | encountered during an open.
| was encountered.
| System action: Processing continues.
| Explanation: The parameter is unrecognized.
| User response: None.
| System action: Processing stops.
|
| User response: Remove the unrecognized parameter. | ADB5028E An authorization error occurred during
| -START.
|
| ADB5008E Either the SSID= or PLAN= parameter | System action: Processing stops.
| was not provided.
| User response: Grant the job submitter ID the
| System action: Processing stops. | necessary authority and restart the batch statement list.
| User response: |
| 1. Provide the PLAN=plan setting in the ADBOPT DD | ADB5029E An error occurred during -START.
| card. | Explanation: An unrecognized error occurred while
| 2. Provide the SSID() parameter as a parameter to the | attempting the -START command.
| program.
| System action: Processing stops.
|
| ADB5009E A non-zero SQL code was issued.
| User response: Examine the output and take remedial
| action.
| System action: Processing stops.
|
| User response: Investigate the specific SQL code and | ADB5031W No statements were found that can be
| take remedial action. | run.
| | System action: Processing continues.
| ADB5010W The DB2 Version could not be
| determined.
| User response: None.

| Explanation: This message indicates a positive, ||


| non-zero return code from the SQL CONNECT
| statement. |

| System action: The product assumes a DB2 Version 6


| level, and processing continues.
646 User's Guide and Reference
ADB5034E • ADB5073W

| |
| ADB5034E Delete failed for ADBCHKPT control | ADB5056E There is an error in the CHANGEID()
| record for WORKLIST(WorkList ). | input parameter value.
| System action: Processing stops. | System action: Processing stops.
| User response: Resubmit the job to complete | User response: Provide the correct CHANGEID()
| processing. | parameter and value.
| |
| ADB5035E Invalid input parm term character. | ADB5057E The SET QUERYNO statement
| contained syntax errors.
| System action: Processing stops.
| System action: Processing continues.
| User response: Specify a valid term character.
| User response: Specify a valid SET QUERYNO
|
| statement.
| ADB5036E A trailing parenthesis has been omitted
| or no value was provided. |
| ADB5058E The RELEASE statement contained
| System action: Processing stops.
| syntax errors.
| User response: Specify a trailing parenthesis or
| System action: Processing continues.
| provide a value.
| User response: Specify a valid RELEASE statement.
|
| ADB5037E An error in the MAXE input parameter |
| parenthesis occurred. | ADB5063E The ADBCHKPT control record for
| WORKLIST(WorkList ) is missing.
| System action: Processing stops.
| System action: Processing stops.
| User response: Specify a trailing parenthesis or
| provide a value. | User response: Provide the WORKLIST(WorkList)
| parameter and value.
|
| ADB5043E Restart processing was halted due to a |
| command mismatch. | ADB5064E There is an SQL buffer overflow. The
| maximum size is Maxsize.
| Explanation: The command from the last run does not
| match the command from the restarted run. | System action: Processing stops.
| System action: Processing stops. | User response: Specify a larger region size.
| User response: Verify that the statement being |
| restarted has not been changed. | ADB5067E The command Command is not
| supported, or execs are not in
|
| SYSEXEC/SYSPROC.
| ADB5051E An error occurred in the CHANGEID()
| input parameter | System action: Processing stops.
| System action: Processing stops. | User response: Provide a SYSEXEC DD card.
| User response: Provide the correct CHANGEID() |
| parameter and value. | ADB5071E The ADBPART table does not exist.
| | System action: Processing stops.
| ADB5052E The CONNECT statement contained
| syntax errors.
| User response: Check the qualifier of package
| ADBTEP2.
| System action: Processing continues.
|
| User response: Specify a valid CONNECT statement. | ADB5073W Keys do not match for part PartNo .
| | Explanation: Limitkeys do not match between unload
| ADB5054E The SET CONNECTION statement | and load. Processing of data might proceed serially.
| contained syntax errors.
| System action: Processing continues.
| System action: Processing continues.
| User response: None.
| User response: Specify a valid SET CONNECTION
| statement. ||
|

Chapter 29. Troubleshooting 647


ADB5080E • ADB9006I

| |
| ADB5080E A restart with a different unload | ADB9002W Comments are not allowed in the input
| method is not allowed. | parameter file.
| Explanation: It is not permitted to change the | Explanation: The input parameter file cannot contain
| UNLOAD method on restart. | comments. The job might not have run correctly.
| System action: Processing continues. | System action: A return code of 4 is set, and
| processing continues. The program continues on to the
| User response: Either resubmit the restart with DB2
| next request after reporting the error.
| (parm UNLOAD(HPU) or start the run from the
| beginning RESTART(NO). | User response: Delete the comments from the input
| parameter file, and resubmit the job.
|
| ADB5081E A restart with a different unload |
| method is not allowed. | ADB9003W Invalid input from the input parameter
| file is ignored.
| Explanation: It is not permitted to change the
| UNLOAD method on restart. | Explanation: The input parameter file contains invalid
| input, which is ignored. The job might not have run
| System action: Processing continues.
| correctly because of the invalid input.
| User response: Either resubmit the restart with DB2
| System action: A return code of 4 is set, and
| (parm UNLOAD(DB2) or start the run from the
| processing continues. The program continues on to the
| beginning RESTART(NO).
| next request after reporting the error.
|
| User response: Correct the invalid parameter, and
| ADB5094E The held DSN commands have been
| resubmit the job.
| queued on SYSIN and will be retried.
|
| System action: Processing continues.
| ADB9004W Processing continues.
| User response: None.
| Explanation: This message is issued in conjunction
| | with message ADB9001, ADB9002, or ADB9003 to
| ADB5100E No restart was requested and no | indicate that processing continues when the program
| checkpoint was found. This was an | encounters these errors.
| abnormal run, and cannot be restarted.
| System action: Processing continues.
| System action: Processing stops..
| User response: None.
| User response: None.
|
| | ADB9005W The following input was skipped:
| ADB5105E The command Command is not | error_text.
| supported or the execs are not in
| Explanation: The job might not have run correctly
| SYSEXEC/SYSPROC.
| because input was skipped. error_text identifies the
| System action: Processing stops.. | input that was skipped.
| User response: Provide a SYSEXEC DD containing the | System action: A return code of 4 is set, and
| product execs. | processing continues.
| | User response: Correct the input, and resubmit the
| ADB9001W A parameter name in the input | job.
| parameter file was not recognized.
|
| Explanation: The input parameter file contains a | ADB9006I The program program_name completed
| parameter name that is not valid. The job might not | abnormally.
| have run correctly because of the incorrect parameter
| Explanation: The accompanying messages indicate
| name.
| why the identified program did not complete normally.
| System action: A return code of 4 is set, and
| System action: None..
| processing continues. The program continues on to the
| next request after reporting the error. | User response: See the accompanying messages in the
| report.
| User response: Correct the invalid parameter, and
| resubmit the job.
||
| |

648 User's Guide and Reference


ADB9007E • ADB9016W

| |
| ADB9007E A version name was not specified. | ADB9012E The DD statement ddname is missing or
| is incorrect.
| Explanation: The request cannot be processed because
| a version name was not specified. | Explanation: The JCL for the job is missing the
| identified DD statement or the DD statement is
| System action: A return code of 12 is set, and
| incorrect.
| processing stops.
| System action: A return code of 12 is set, and
| User response: Specify a valid version name, and
| processing stops.
| resubmit the request.
| User response: Supply the missing DD statement, and
|
| resubmit the job.
| ADB9008E A version qualifier was not specified.
|
| Explanation: The request cannot be processed because
| ADB9013E The specified scope
| a version qualifier was not specified.
| scope_qualifier.scope_name was not found.
| System action: A return code of 12 is set, and
| Explanation: The request required the use of a version
| processing stops.
| scope and could not be processed because the scope
| User response: Specify a valid version qualifier and | that was specified does not exist.
| resubmit the request.
| System action: A return code of 8 is set, and
| | processing stops.
| ADB9009E Package module_name needs to be bound
| User response: Correct the scope qualifier, scope
| or rebound.
| name, or both to identify a scope that exists, and
| Explanation: An SQL statement has been issued, and | resubmit the request.
| DB2 has returned an SQLCODE of -805, which
|
| indicates that the program needs to be bound or
| ADB9014I The specified version
| rebound on that particular DB2 system.
| version_qualifier.version_name was found
| System action: A return code of 12 is set, and | in the database.
| processing stops.
| Explanation: The request was processed because the
| User response: Bind or rebind the named module, and | specified version exists.
| resubmit the job.
| System action: None.
|
| User response: None.
| ADB9010E A plan access error occurred for program
| program_name because you are not |
| authorized to run the plan. | ADB9015E The specified version
| version_qualifier.version_name was not
| Explanation: The identified program did not run
| found in the database.
| successfully because the program attempted to issue an
| SQL request, and DB2 issued an SQLCODE of -922. | Explanation: The request could not be processed
| because the specified version does not exist.
| System action: A return code of 12 is set, and
| processing stops. | System action: A return code of 8 is set, and
| processing stops.
| User response: Correct the authorization, and
| resubmit the job. | User response: Correct the version qualifier, the
| version name, or both to identify a version that exists,
|
| and resubmit the request.
| ADB9011E An unexpected sqlcode was found in
| error_function. |
| ADB9016W The specified version
| Explanation: This message is issued when the
| version_qualifier.version_name exists but its
| environment in which the program is running is not
| definition is empty or incomplete.
| correct or a possible user error exists.
| Explanation: The request might not have been
| System action: A return code of 12 is set, and
| processed accurately because the version is not defined
| processing stops.
| correctly.
| User response: Obtain a dump, and contact IBM
| System action: A return code of 4 is set, and
| Software Support.
| processing continues.
| | User response: Correct the version qualifier, the

Chapter 29. Troubleshooting 649


ADB9017I • ADB9027E

| version name, or both and ensure that the version has | System action: A return code of 12 is set, and
| version records. | processing stops.
| | User response: Edit the input job to specify a valid
| ADB9017I ADBCVEX - Export Version Files | version type, and resubmit the job. Report this internal
| error to IBM Software Support.
| Explanation: This report message identifies the DB2
| Admin program that is being run to export version |
| files. | ADB9023E An invalid action for a version file
| import was specified. The valid values
| System action: None.
| are ADD and REPLACE.
| User response: None.
| Explanation: The input job that DB2 Admin generated
| | contains an invalid value for the action to take when
| ADB9018I ADBCVEX - Version Export Complete | importing a version file. The action for the import must
| be either ADD or REPLACE.
| Explanation: This report message indicates that the
| DB2 Admin program to export version files ran | System action: A return code of 12 is set, and
| successfully. | processing stops.
| System action: None. | User response: Edit the input job to specify a valid
| action, and resubmit the job. Report this internal error
| User response: None. | to IBM Software Support.
| |
| ADB9019I The number of version data records | ADB9024I The scope ID for version scope
| exported is integer. | scope_qualifier.scope_name is scope
| Explanation: After the DB2 Admin program to export | scope_identifier.
| version files completes, this report message is issued to | Explanation: This report message indicates that the
| indicate the number of version file records that were | version scope with the identified scope ID is being
| exported. | processed.
| System action: None. | System action: Processing continues.
| User response: None. | User response: None.
| |
| ADB9020I ADBCVIC or ADBCVIM - Import Version | ADB9025I The version will be replaced.
| Files
| Explanation: A version is being created. A version
| Explanation: This report message identifies the DB2 | with the specified name already exists and will be
| Admin program that is being run to import version | overwritten.
| files.
| System action: Processing continues.
| System action: Processing continues.
| User response: None.
| User response: None.
|
| | ADB9026E The version already exists. It cannot be
| ADB9021I - Version Import Complete. The import | added.
| for version ADBCVIC or ADBCVIM
| completed successfully. | Explanation: DB2 Admin is trying to process a request
| to add a new version. The version cannot be created
| Explanation: This report message indicates that the | because a version with the specified qualifier and name
| DB2 Admin program to import version files ran | already exists.
| successfully.
| System action: A return code of 8 is set, and
| System action: None. | processing stops.
| User response: None. | User response: Report this internal error to IBM
| | Software Support.
| ADB9022E An invalid version type was specified. |
| The valid values are BASE and DELTA. | ADB9027E The input file is empty. No records were
| Explanation: The input job that DB2 Admin generated | found.
| contains an invalid value for the version type. The type | Explanation: DB2 Admin is trying to process a request
| of version must be either BASE or DELTA. | but the input file that describes the action that should
| be taken is empty.

650 User's Guide and Reference


ADB9028I • ADB9035I

|
| System action: A return code of 12 is set, and
| ADB9302E Change "change_owner.change_name"
| processing stops.
| cannot be recovered because the
| User response: Report this internal error to IBM | following changes must be recovered
| Software Support. | first and either they do not have a
| recover change or they have a recover
| | change that is not in the ANALYZED
| ADB9028I A version file was created from | state. Owner.Name
| DB2_subsystem_id at extract_time by | -------------------------------------------------
| extract_sqlid.
| Explanation: An attempt is being made to recover a
| Explanation: This report message provides | change that cannot be recovered because other changes
| information about the version file that is being | must be recovered first and those changes either do not
| processed. It displays the ID of the DB2 subsystem, the | have a recover change or have a recover change that is
| time the version file was extracted, and the ID of the | not in the ANALYZED state. The accompanying
| user who ran the DB2 Admin program to extract the | messages provide a list of the changes that must be
| version information. | recovered first that either do not have a recover change
| System action: None. | or have a recover change that is not in the ANALYZED
| state.
| User response: None.
| System action: Processing stops.
|
| ADB9029I A version file was extracted from | User response: Create a new change to undo the
| location DB2_location at extract_time by | changes for the specified changes.
| extract_sqlid. |
| Explanation: This report message provides | ADB9032I The number of version data records
| information about the version file that is being | imported is integer.
| processed. It displays the location of the DB2 | Explanation: After the DB2 Admin program to import
| subsystem, the time the version file was extracted, and | version files completes, this report message is issued to
| the ID of the user who ran the DB2 Admin program to | indicate the number of version data records that were
| extract the version information. | exported.
| System action: None. | System action: None.
| User response: None. | User response: None.
| |
| ADB9030E The version file description is not | ADB9033I The SQLCA sqlcode is sqlca.sqlcode.
| available because the input file does not
| have a header record. | Explanation: This message displays the SQLCODE
| that was returned.
| Explanation: DB2 Admin is trying to process a version
| file but cannot because the input file does not have a | System action: None.
| header record.
| User response: None.
| System action: A return code of 12 is set, and
|
| processing stops.
| ADB9034I ADBCVOB - Object Extraction
| User response: Report this internal error to IBM | Complete
| Software Support.
| Explanation: This report message indicates that the
| | DB2 Admin program to extract objects completed
| ADB9031W The input file is empty. No records were | successfully.
| found.
| System action: None.
| Explanation: DB2 Admin is trying to process a request
| User response: None.
| but cannot because the input file is empty.
|
| System action: A return code of 4 is set, and
| ADB9035I he number of objects that were found is
| processing continues.
| integer.
| User response: Report this internal error to IBM
| Explanation: After the DB2 Admin program to extract
| Software Support.
| objects completes, this report message is issued to
| indicate the number of objects that were processed.
|
| System action: None.

Chapter 29. Troubleshooting 651


ADB9036I • ADB9046E

|
| User response: None.
| ADB9042I The number of scope objects written is
| | integer.
| ADB9036I ADBCVOB - Extract Version Objects.
| Explanation: After the DB2 Admin program to process
| Explanation: This report message indicates that the | scope objects completes, this report message is issued
| DB2 Admin program that extracts the objects for a | to indicate the number of scope objects that were
| version has started. | processed.

| System action: Processing continues. | System action: None.


| User response: None. | User response: None.
| |
| ADB9037I ADBCVSX - Export Scope Objects | ADB9043I Its scope ID is scope_identifier.

| Explanation: This report message indicates that the | Explanation: A version scope with the identified scope
| DB2 Admin program that extracts version scopes has | identifier is being processed.
| started.
| System action: Processing continues.
| System action: Processing continues.
| User response: None.
| User response: None.
|
| | ADB9044I The version will be added.
| ADB9038I ADBCVSX - Scope Export Complete
| Explanation: The DB2 Admin program that processes
| Explanation: This report message indicates that the | versions will add a version.
| DB2 Admin program that extracts version scopes has
| System action: Processing continues.
| completed successfully.
| User response: None.
| System action: None.
|
| User response: None.
| ADB9045I It should be there.
|
| Explanation: DB2 Admin is attempting to replace an
| ADB9039E A scope name was not specified
| existing version file, but the version file being replaced
| Explanation: The DB2 Admin program to extract a | does not exist.
| version scope could not run because the input to the
| System action: Processing continues.
| program did not include the scope name.
| User response: Verify that having the version file
| System action: A return code of 12 is set, and
| replaced is the action that you want. Ensure that the
| processing stops.
| version qualifier and version name are correct if you
| User response: Report this internal error to IBM | want the version replaced. If you do want to replace an
| Software Support. | existing version file, change the action to ADD instead
| of REPLACE in the input parameters to the DB2
| | Admin program.
| ADB9040E A scope qualifier was not specified.
|
| Explanation: The DB2 Admin program to extract a | ADB9046E The specified version version_identifier
| version scope could not run because the input to the | was not found in the database.
| program did not include the qualifier for the scope.
| Explanation: DB2 is attempting to replace an existing
| System action: A return code of 12 is set, and | version file with a version file that is being imported,
| processing stops. | but the version file being replaced does not exist.
| User response: Report this internal error to IBM | System action: A return code of 12 is set, and
| Software Support. | processing stops.
| | User response: Verify that having the version file
| ADB9041I The scope scope_qualifier.scope_name was | replaced is the action that you want. Ensure that the
| found in the database. Its scope ID is | version qualifier and version name are correct if you
| scope_identifier. | want the version replaced. If you do want to replace an
| Explanation: The scope that was being processed was | existing version file, change the action to ADD instead
| found, and it has the identified scope ID. | of REPLACE in the input parameters to the DB2
| Admin program.
| System action: Processing continues.
| User response: None. ||
|
652 User's Guide and Reference
ADB9047I • ADB9064E

|
| ADB9047I The version ID is version_identifier.
| the scope that was specified for the version.

| | System action: A return code of 4 is set, and


Explanation: A version with the identified version ID
| is being processed.
| processing continues.

| System action: Processing continues.


| User response: Complete the definition of the scope
| by editing the scope and adding objects to it.
| User response: None.
|
| | ADB9060I The processing for the ignore or mask
| ADB9048I The specified version | begins.
| version_qualifier.version_name was not
| found in the database.
| Explanation:

| Explanation: The version that is being processed


| System action: Processing continues.
| should replace an existing version, but that version | User response: None.
| does not exist.
|
| System action: A return code of 12 is set, and | ADB9061E An error occurred while processing the
| processing stops. | ignore or mask request.
| User response: Correct the version qualifier, version | Explanation: The DB2 Admin program that processes
| name, or both to identify a valid version, and resubmit | ignores and masks has encountered an error.
| the request.
| System action: A return code of 8 is set, and
| | processing stops.
| ADB9049I Scope object records are being
| processed. | User response: See the previously issued message,
| which provides details about the error.
| Explanation: The process to extract version scope
| object definitions has started. |
| ADB9062I The processing for the ignore or mask
| System action: Processing continues. | completed successfully.
| User response: None. | Explanation: This report message indicates that DB2
| | Admin has completed the processing for the ignore or
| ADB9050I Version version_qualifier.version_name is
| mask successfully.
| being extracted. | System action: None.
| Explanation: A version is needed to process the | User response: None.
| request, and the identified version is being extracted.
|
| System action: Processing continues. | ADB9063E The input parameter input_keyword for
| User response: None.
| the ignore or mask request was not
| provided.
|
| ADB9051E The version name, qualifier, or both for
| Explanation: The ignore or mask could not be
| version ID version_identifier is null in the
| processed because the input information that the DB2
| database.
| Admin program needs was not provided. This is an
| internal error.
| Explanation: DB2 Admin is trying to replace a delta
| version file, but a delta version file is not found for the
| System action: A return code of 12 is set, and
| version identifier that is provided as input to the DB2
| processing stops.
| Admin program. | User response: Report this internal error to IBM
| System action: A return code of 12 is set, and
| Software Support.
| processing stops. |
| User response: Report this internal error to IBM
| ADB9064E op_parameter_value is not a valid value
| Software Support.
| for the OP parameter.

| | Explanation: The ignore or mask could not be


| ADB9052W No scope object records for scope ID
| processed because the input to the DB2 Admin
| scope_identifier were found in the
| program that processes ignores and masks did not
| database.
| contain a valid value for the OP parameter. This is an
| internal error.
| Explanation: The version that was created might be
| incomplete because there were no objects defined for
| System action: A return code of 12 is set, and
| processing stops.
Chapter 29. Troubleshooting 653
ADB9065E • ADB9075I

| User response: Report this internal error to IBM | User response: None.
| Software Support.
|
| | ADB9071I Mask mask_owner.mask_name was inserted
| ADB9065E type_parameter_value is not a valid value | to database.
| for the Type parameter.
| Explanation: The request to add a mask in the Change
| Explanation: The ignore or mask could not be | Management database was successful.
| processed because the input to the DB2 Admin
| program that processes ignores and masks did not
| System action: None.
| contain a valid value for the Type parameter. This is an | User response: None.
| internal error.
|
| System action: A return code of 12 is set, and | ADB9072E Mask mask_owner.mask_name does not
| processing stops. | exist.
| User response: Report this internal error to IBM | Explanation: The request required the use of a mask
| Software Support. | and could not be processed because the specified mask
| | does not exist.
| ADB9067I Ignore ignore_owner.ignore_name was | System action: A return code of 12 is set, and
| inserted to database. | processing stops.
| Explanation: The request to add an ignore in the | User response: Ensure that the correct mask owner,
| Change Management database was successful. | mask name, or both was specified. Or, create an mask
| System action: None.
| with the owner and name that were specified. Then,
| resubmit the request.
| User response: None.
|
| | ADB9073W The definition of mask
| ADB9068E The definition of ignore | mask_owner.mask_name is incomplete (no
| ignore_owner.ignore_name is incomplete | mask lines exist).
| (no ignore lines exist).
| Explanation: The mask cannot be used because its
| Explanation: The ignore cannot be used because its | definition is empty.
| definition is empty.
| System action: A return code of 4 is set, processing
| System action: A return code of 12 is set, and | continues, and no system action taken.
| processing stops.
| User response: If you do not intend to use the empty
| User response: Complete the definition of the ignore | mask, complete the definition of the mask by editing
| by editing the ignore and specifying ignore fields, and | the mask and specifying mask lines. Then, resubmit the
| resubmit the request. | request.
| |
| ADB9069E Ignore ignore_owner.ignore_name does not | ADB9074IE Mask mask_owner.mask_name was
| exist. | retrieved from the database.
| Explanation: The request required the use of an ignore | Explanation: The request was processed because the
| and could not be processed because the specified | required mask exists.
| ignore does not exist.
| System action: None.
| System action: A return code of 12 is set, and
| processing stops.
| User response: None.

| User response: Ensure that the correct ignore owner,


|
| scope name, or both was specified. Or, create an ignore
| ADB9075I The processing for an ignore or mask is
| with the owner and name that was specified. Then,
| ending.
| resubmit the request. | Explanation: This report message indicates that DB2
| | Admin has finished processing an ignore or a mask.
| ADB9070I Ignore ignore_owner.ignore_name was | System action: None.
| retrieved from database.
| User response: None.
| Explanation: The request was processed because the
| required ignore exists. ||
| System action: None. |

654 User's Guide and Reference


ADB9076E • ADB9305I

|
| ADB9076E The DD statement for dd_name is
| User response: See message ADB9110.
| missing. |
| Explanation: The JCL for the job is missing the | ADB9300E Change change_owner.change_name cannot
| identified DD statement. | be recovered until the following
| changes are recovered in the order that
| System action: A return code of 12 is set, and | they are specified. The list contains
| processing stops. | those changes that completed after the
| change to recover completed and have
| User response: Supply the missing DD statement, and
| not been recovered. They modify the
| resubmit the job.
| same or related objects as those in the
| | change to recover and, hence, the
| ADB9110I The status of the following changes will | recover change itself. Rcvr Order
| be set to DEFINED: | Owner.Name -----
| -------------------------------------------
| Explanation: When a recover change is being run, any
| pending changes to the objects within the recover | Explanation: An attempt is being made to recover a
| change are set to DEFINED status. The original change | change that cannot be recovered because other changes
| of the recover change is also set to DEFINED status. | must be recovered first. The accompanying messages
| The original change supersedes any pending changes | provide a list of the changes that must be recovered
| for the objects within the original change. The pending | first.
| changes that were superseded are set to DEFINED
| System action: Processing stops.
| status. This message introduces the list of the changes
| that are set to DEFINED status. Message ADB9113 is | User response: Recover the list of changes in the order
| issued after this message to list each change that is set | that is specified.
| to DEFINED status.
|
| System action: Processing continues. | ADB9304E This change cannot be recovered
| because it does not have a recover
| User response: Review the list of changes that is
| change or its recover change is not in
| displayed after this message to understand which
| the ANALYZED state.
| changes are set to DEFINED status when the change is
| recovered. | Explanation: An attempt is being made to recover a
| change that cannot be recovered because it does not
|
| have a recover change or its recover change is not in
| ADB9111I Owner.Name
| ANALYZED status.
| Explanation: Messages ADB9110, ADB9111, ADB9112,
| System action: Processing stops.
| and ADB9113 are issued in conjunction with each other.
| This message provides a heading to identify the owner | User response: Ensure that each change currently
| and the name of the changes that are listed by message | being recovered that is, the change is in RUNNING
| ADB9113. | status) completes. Otherwise, create a new change to
| undo the changes made by this change.
| System action: Processing continues.
|
| User response: See message ADB9110.
| ADB9305I The following pending changes will be
| | set to DEFINED status. These changes
| ADB9112I ----–------------------------------------------- | modify the same or related objects as
| those in the change to recover and,
| Explanation: Messages ADB9110, ADB9111, ADB9112, | hence, the recover change itself.
| and ADB9113 are issued in conjunction with each other. | Owner.Name
| This message provides a heading for message ADB9113. | –-----------------------------------------------
| System action: Processing continues. | Explanation: A change is being recovered, and there
| User response: See message ADB9110. | are pending changes for the objects that are affected by
| the change to recover. The pending changes will be set
| | to DEFINED status. The accompanying messages
| ADB9113I change_owner.change_name | provide a list the changes that will be set to DEFINED
| Explanation: Messages ADB9110, ADB9111, ADB9112, | status.
| and ADB9113 are issued in conjunction with each other. | System action: Processing continues.
| This message lists the owner and name of each change
| that is set to DEFINED status when you recover the | User response: None.
| change.
||
| System action: Processing continues.
|
Chapter 29. Troubleshooting 655
ADB9306I • ADBC102E

| |
| ADB9306I This change can be recovered. No other | ADB9352E The specified change change_ID does not
| changes that modify the same or related | exist.
| objects completed after the change
| completed, and there are no pending
| Explanation: A request was made to update the
| changes that modify the same or related
| change status for a change ID that does not exist.
| objects. | System action: No system action is taken.
| Explanation: A change is being recovered, and this | User response: Try generating a new run job or
| informational message indicates that there are no other | re-analyze the change.
| changes that need to be recovered first and that there
| are no pending changes for the affected objects. |
| ADB9353E SQL error SQL_error_code occurred while
| System action: Processing continues. | the Change Management database was
| User response: None. | being accessed.

| | Explanation: An unexpected SQL error occurred while


| ADB9307E This change cannot be recovered
| accessing DB2.
| because the WSL and JCL files for the | System action: None.
| recover change do not exist.
| User response: Fix the problem and try again.
| Explanation: An attempt was made to recover a
| change, and the WSL and JCL files that are required to |
| recover the change do not exist. The change cannot be | ADBC100E The owner.name change does not exist.
| recovered. | Explanation: An attempt was made to delete a change
| System action: Processing stops. | that does not exist.

| User response: Create a new change to undo the | System action: Processing ends.
| changes made by this change. | User response: Refresh the panel to retrieve the
| | current list of changes.
| ADB9308E The JCL file for the recover change does |
| not exist. An error occurred while a | ADBC101E You do not have the privilege to delete
| temporary JCL file for the recover WSL | the owner.name change according to the
| was being created. | definition of the delete change view
| Explanation: An attempt was made to recover a | (ADBCHGV1).
| change, and the JCL file for the recover job that is | Explanation: The delete change view (ADBCHGV1)
| required to recover the change does not exist. | has been defined in a way that prevents you from
| System action: Processing stops. | deleting the change.

| User response: Create a new change to undo the | System action: Processing ends.
| changes made by this change. | User response: Check with the system administrator
| | who installed DB2 Admin and enabled Change
| ADB9351E An error occurred when the change | Management.
| status was updated. Neither the old or |
| new change status values match the | ADBC102E The owner.name change cannot be
| current change status: | deleted because the change does not
| current_change_status. | satisfy the delete criteria.
| Explanation: The request to update the change status | Explanation: The change cannot be deleted because
| was invalid. | the change does not meet the criteria for being
| System action: Processing stops. | dropped. To be dropped, a change must meet one of
| the following criteria:
| User response: If you submitted a run job, ensure that | v The status of the change is CANCELED
| you analyze the change before running it. If you | v The status of the change is FAILED and the type is
| submitted an analyze job, ensure that the change is in | FAST
| DEFINED or ANALYZED status before submitting the | v The type of the change is COMPARE
| analyze job.
| System action: Processing ends.
| | User response: Put the change into a status such that
| the criteria to delete a change is met, and then try the
| DEL line command to delete the change again.

656 User's Guide and Reference


ADBC103E • ADBM029E

|
| ADBC103E You do not have the privilege to run the
| character 'G', for example, 8G. If a REXX user exit is
| delete change command.
| specified for DSSIZE, ensure that the REXX user exit is
| coded so that it returns an integer value followed with
| Explanation: You have not been given the privilege to | character 'G'. After the corrections are made, resubmit
| delete changes. This error usually means that an | the job.
| SQLCODE -922 was received while an attempt was
| made to run the ADBCDCH plan.
|
| ADBM027E The overwrite value for
| System action: Processing ends. | space_allocation_quantity_attribute must be
| a numeric value.
| User response: Check with the system administrator
| who sets up the DB2 Admin plans and packages to | Explanation: The use of masking was specified, and
| request access to the ADBCDCH plan. | the value that is specified for
| space_allocation_quantity_attribute (PRIQTY, TSPRIQTY,
|
| IXPRIQTY) is not valid.
| ADBC104E The delete change command is not
| enabled. | System action: A return code of 1012 is set, and
| processing stops.
| Explanation: DB2 Admin has not been configured to
| enable the delete change command. This error usually | User response: Correct the definition of the mask. If a
| means that an SQLCODE -805 was received while an | specific value is specified for
| attempt was made to run the ADBCDCH package. | space_allocation_quantity_attribute, ensure that the value
| is an integer value. If a REXX user exit is specified for
| System action: Processing ends.
| space_allocation_quantity_attribute, ensure that the REXX
| User response: Check with the system administrator | user exit is coded so that it returns an integer value.
| who sets up the DB2 Admin plans and packages to | After the corrections are made, resubmit the job.
| request the appropriate set up of the ADBCDCH
|
| package and plan.
| ADBM028E The overwrite value for
| | space_allocation_quantity_attribute must be
| ADBM024E The overwrite value that is specified for | a numeric value.
| the SEGSIZE must be an integer that is
| Explanation: The use of masking was specified, and
| a multiple of 4.
| the value that is specified for
| Explanation: The mask contains a value for SEGSIZE | space_allocation_quantity_attribute (SECQTY, TSSECQTY,
| that is not valid. | or IXSECQTY)) is not valid.

| System action: A return code of 1012 is set, and | System action: A return code of 1012 is set, and
| processing stops. | processing stops.
| | User response: Correct the definition of the mask. If a
| ADBM025E The overwrite value that is specified for | specific value is specified for
| COMPRESS must be YES or NO. | space_allocation_quantity_attribute, ensure that the value
| is an integer value. If a REXX user exit is specified for
| Explanation: The mask contains a value for | space_allocation_quantity_attribute, ensure that the REXX
| COMPRESS that is not valid. | user exit is coded so that it returns an integer value.
| System action: A return code of 1012 is set, and | After the corrections are made, resubmit the job.
| processing stops. |
| User response: Change the mask definition to specify | ADBM029E The overwrite value for DEFER must be
| a value for SEGSIZE that is a multiple of 4, and then | YES or NO.
| resubmit the job. | Explanation: The use of masking was specified, and
| | the value that is specified for DEFER is not valid.
| ADBM026E The overwrite value for DSSIZE must | System action: A return code of 1012 is set, and
| be a numeric value that is followed by | processing stops.
| the character 'G'.
| User response: Correct the definition of the mask. If a
| Explanation: The use of masking was specified, and | specific value is specified for DEFER, ensure that the
| the value that is specified for DSSIZE is not valid. | value is YES or NO. If a REXX user exit is specified for
| System action: A return code of 1012 is set, and | DEFER, ensure that the REXX user exit is coded so that
| processing stops. | it returns the value YES or NO. After the corrections
| are made, resubmit the job.
| User response: Correct the definition of the mask. If a
| specific value is specified for DSSIZE, ensure that the ||
| value is an integer value that is followed by the
|
Chapter 29. Troubleshooting 657
ADBM030E

|
| User response: Correct the definition of the mask. If a
| ADBM030E The overwrite value for define_attribute
| specific value is specified for define_attribute, ensure
| must be YES or NO.
| that the value is YES or NO. If a REXX user exit is
| Explanation: The use of masking was specified, and | specified for define_attribute, ensure that the REXX user
| the value that is specified for define_attribute (DEFINE, | exit is coded so that it returns the value YES or NO.
| TSDEFINE, or IXDEFINE) is not valid. | After the corrections are made, resubmit the job.
| System action: A return code of 1012 is set, and
| processing stops.
|

658 User's Guide and Reference


Notices
This information was developed for products and services offered in the U.S.A.

IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program or service may be used. Any functionally equivalent product,
program or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the user’s responsibility to evaluate and verify the
operation of any non-IBM product, program or service.

IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.

For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
Intellectual Property Licensing
Legal and Intellectual Property Law
IBM Japan, Ltd.
1623-14, Shimotsuruma, Yamato-shi Kanagawa 242-8502
Japan

The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply
to you.

This information could include technical inaccuracies or typographical errors.


Changes are periodically made to the information herein; these changes will be
incorporated in new editions of the publication. IBM may make improvements
and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.

IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.

Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created

© Copyright IBM Corp. 1995, 2010 659


programs and other programs (including this one) and (ii) the mutual use of the
information that has been exchanged, should contact:
IBM Corporation
J46A/G4
555 Bailey Avenue
San Jose, CA 95141-1003
U.S.A.

Such information may be available subject to appropriate terms and conditions,


including in some cases, payment of a fee.

The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.

This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include the
names of individuals, companies, brands, and products. All of these names are
fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.

COPYRIGHT LICENSE:

This information contains sample application programs in source language, which


illustrate programming techniques on various operating platforms. You may copy,
modify, and distribute these sample programs in any form without payment to
IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating
platform for which the sample programs are written. These examples have not
been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or
imply reliability, serviceability, or function of these programs. The sample
programs are provided "AS IS", without warranty of any kind. IBM shall not be
liable for any damages arising out of your use of the sample programs.

Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of
International Business Machines Corporation in the United States, other countries,
or both. These and other IBM trademarked terms are marked on their first
occurrence in this information with the appropriate symbol (® or ™), indicating US
registered or common law trademarks owned by IBM at the time this information
was published. Such trademarks may also be registered or common law
trademarks in other countries. A complete and current list of IBM trademarks is
available on the Web at http://www.ibm.com/legal/copytrade.shtml.

Java™ and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in
the United States, other countries, or both.

Linux is a trademark of Linus Torvalds in the United States, other countries, or


both.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the Unites States, other countries, or both.

660 User's Guide and Reference


UNIX is a registered trademark of The Open Group in the United States and other
countries.

Other company, product, and service names may be trademarks or service marks
of others.

Notices 661
662 User's Guide and Reference
Bibliography
This section lists the documentation that supports DB2 Admin Tool. Use the appropriate library for the
version of DB2 that you are using.

Tip: To quickly locate a specific book, use the IBM Publications Center, which is located at
www.elink.ibmlink.ibm.com/public/applications/publications/cgibin/pbi.cgi. After you enter your
country information, click the Search for publications link, and enter the publication number (xxxx-xxxx)
of the book that you want.
DB2 Version 9.1 for z/OS product information
v DB2 Version 9.1 for z/OS Administration Guide, SC18-9840
v DB2 Version 9.1 for z/OS Application Programming and SQL Guide, SC18-9841
v DB2 Version 9.1 for z/OS Application Programming Guide and Reference for Java, SC18-9842
v DB2 Version 9.1 for z/OS Codes, GC18-9843
v DB2 Version 9.1 for z/OS Command Reference, SC18-9844
v DB2 Version 9.1 for z/OS Data Sharing: Planning and Administration, SC18-9845
v DB2 Version 9.1 for z/OS Diagnosis Guide and Reference, LY37-3218
v DB2 Version 9.1 for z/OS Diagnostic Quick Reference Card, LY37-3219
v DB2 Version 9.1 for z/OS Installation Guide, GC18-9846
v DB2 Version 9.1 for z/OS Introduction to DB2, SC18-9847
v DB2 Version 9.1 for z/OS Licensed Program Specifications, GC18-9848
v DB2 Version 9.1 for z/OS Messages, GC18-9849
v DB2 Version 9.1 for z/OS ODBC Guide and Reference, SC18-9850
v DB2 Version 9.1 Performance Monitoring and Tuning Guide, SC18-9851
v DB2 Version 9.1 for z/OS Program Directory, GI10-8737
v DB2 Version 9.1 for z/OS RACF Access Control Module Guide, SC18-9852
v DB2 Version 9.1 for z/OS Reference for Remote DRDA Requesters and Servers, SC18-9853
v DB2 Version 9.1 for z/OS Reference Summary, SX26-3854
v DB2 Version 9.1 for z/OS SQL Reference, SC18-9854
v DB2 Version 9.1 for z/OS Utility Guide and Reference, SC18-9855
v DB2 Version 9.1 for z/OS What's New?, GC18-9856
v DB2 Version 9.1 for z/OS XML Extender for z/OS Administration and Programming, SC18-9857
v DB2 Version 9.1 for z/OS XML Guide, SC18-9858
DB2 Universal Database for z/OS, Version 8 product information
v DB2 Administration Guide, SC18-7413
v DB2 Application Programming and SQL Guide, SC18-7415
v DB2 Application Programming Guide and Reference for Java, SC18-7414
v DB2 Command Reference, SC18-7416
v DB2 Data Sharing: Planning and Administration, SC18-7417
v DB2 Diagnosis Guide and Reference, LY37-3201
v DB2 Diagnostic Quick Reference Card, LY37-3202
v DB2 Installation Guide, GC18-7418
v DB2 Licensed Program Specifications, GC18-7420
v DB2 Messages and Codes, GC18-7422
v DB2 ODBC Guide and Reference, SC18-7423
v DB2 Reference Summary, SX26-3853
v DB2 Release Planning Guide, SC18-7425
v DB2 SQL Reference, SC18-7426
v DB2 Utility Guide and Reference, SC18-7427
v DB2 What's New?, GC18-7428
v DB2 XML Extender for z/OS Administration and Programming, SC18-7431
v Program Directory for IBM DB2 Universal Database for z/OS, GI10-8566

© Copyright IBM Corp. 1995, 2010 663


DB2 Universal Database for z/OS, Version 7 product information
v An Introduction to DB2 for OS/390, SC26-9937
v DB2 Administration Guide, SC26-9931
v DB2 Application Programming and SQL Guide, SC26-9933
v DB2 Application Programming Guide and Reference for Java, SC26-9932
v DB2 Command Reference, SC26-9934
v DB2 Data Sharing: Planning and Administration, SC26-9935
v DB2 Data Sharing Quick Reference Card, SX26-3846
v DB2 Diagnosis Guide and Reference, LY37-3740
v DB2 Diagnostic Quick Reference Card, LY37-3741
v DB2 Image, Audio, and Video Extenders Administration and Programming, SC26-9947
v DB2 Installation Guide, GC26-9936
v DB2 Licensed Program Specifications, GC26-9938
v DB2 Master Index, SC26-9939
v DB2 Messages and Codes, GC26-9940
v DB2 ODBC Guide and Reference, SC26-9941
v DB2 Reference for Remote DRDA Requesters and Servers, SC26-9942
v DB2 Reference Summary, SX26-3847
v DB2 Release Planning Guide, SC26-9943
v DB2 SQL Reference, SC26-9944
v DB2 Text Extender Administration and Programming, SC26-9948
v DB2 Utility Guide and Reference, SC26-9945
v DB2 What's New? GC26-9946
v DB2 XML Extender for OS/390 and z/OS Administration and Programming, SC27-9949
v DB2 Program Directory, GI10-8182
Accessibility titles cited in this book
v z/OS ISPF User's Guide, Volume 1, SC34-4822
v z/OS TSO/E Primer, SA22-7787
v z/OS TSO/E User's Guide, SA22-7794

664 User's Guide and Reference


Index
Special characters ADB21XAR panel 282
ADB21XR panel 281
- line command 89 ADB21Y panel 603
? Look Up character 91 ADB21Z panel 600
/ line command 89 ADB21ZX panel 600
* asterisk 93 ADB22 panel 142
% percent sign 93 ADB221 panel 143
+ Look Up character 91 ADB222 panel 144
= line command 89 ADB223 panel 147
ADB223T panel 147
ADB231 panel 189
A ADB2310 panel 202
A line command, issuing the 108 ADB2311 panel 202
accessibility ADB2311X panel 204
overview 16 ADB2312 panel 205
active DB2 systems, choosing 42 ADB2312X panel 206
active locations 412 ADB2313 panel 207
ADB CLIST 42 ADB2314I panel 211
ADB2 panel 42, 61, 62, 97 ADB2314T panel 209
ADB21 panel 132, 546 ADB231X panel 190
ADB21A panel 551 ADB232 panel 192
ADB21C panel 552 ADB233 panel 192
ADB21D panel 89, 91, 162, 172, 293, 555 ADB234 panel 194
ADB21DA panel 241 ADB235 panel 195
ADB21DAJ panel 241 ADB236 panel 196
ADB21DAO panel 241 ADB237 panel 198
ADB21DS panel 557, 559 ADB238 panel 199
ADB21E panel 560 ADB239 panel 200
ADB21F panel 425, 562 ADB24 panel 129
ADB21G panel 564 ADB25 panel 217
ADB21H panel 565 ADB25C panel 217
ADB21J panel 566 ADB25L panel 219
ADB21K panel 568 ADB25LA panel 219
ADB21KB panel 571 ADB25LE panel 221
ADB21KF panel 575 ADB25LEA panel 224
ADB21KR panel 574 ADB25LU panel 368
ADB21KSE panel ADB25T panel 226
for a collection 577 ADB25TC panel 228
for a DBRM 579 ADB25TD panel 231
for a package 575 ADB25TE panel 228
ADB21L panel 576 ADB25TS panel 228
ADB21M panel 577 ADB25TT panel 228
ADB21N panel 579 ADB25TU panel 234
ADB21O panel 414, 580 ADB25TU3 panel 234, 236
ADB21P panel 582 ADB26 panel 152
ADB21PB panel 585 ADB26CD panel 154
ADB21PF panel 589 ADB26CF panel 427
ADB21PR panel 588 ADB26CM panel 157
ADB21Q panel 590 ADB26CN panel 548
ADB21S panel 591 ADB26CO panel 416, 417
ADB21SA panel 245 ADB26CS panel 91, 155
ADB21SAR panel 155, 247 ADB26CT panel 156
ADB21SAX panel 284 ADB26CTF panel 156
ADB21T panel 85, 254, 257, 424, 430, 594, 600 ADB26CTU panel 257, 267
ADB21TA panel 254 ADB26CV panel 147
ADB21TAF panel 268 ADB26CX panel 159, 376
ADB21TSE panel 147 ADB26DD panel 162
ADB21VS panel 597 ADB26DDR panel 166
ADB21W1R panel 241 ADB26LT panel 160
ADB21X panel 600 ADB26RDT panel 161
ADB21XA panel 280 ADB26RT panel 161

© Copyright IBM Corp. 1995, 2010 665


ADB27A panel 262 ADB2E panel 372
ADB27C panel 257 ADB2EC panel 375, 376, 377
ADB27CA panel 278 ADB2EE panel 373
ADB27CR panel 276 ADB2EL panel 373
ADB27CTC panel 269 ADB2G panel 167
ADB27PGA panel 260 ADB2GEN panel 172
ADB28M panel 295 ADB2M panel 436
ADB28S panel 293 ADB2M1 panel 437
ADB28T panel 293 ADB2M1M panel 439
ADB2AD panel 605 ADB2M1R panel 438
ADB2AN panel 548 ADB2M1S 437
ADB2ATH program, authorizing 67 ADB2MES panel 441
ADB2AUD panel 606, 608 ADB2MEX panel 441
ADB2AUG panel 608 ADB2P panel 122
ADB2AUS panel 606, 608 ADB2P1 panel 122
ADB2AZ panel 168 ADB2P2 panel 123
ADB2C panel 452 ADB2PP panel 126
ADB2C11 panel 499 ADB2PRMT panel 127
ADB2C11A panel 462 ADB2PSTM panel 127, 154
ADB2C11R panel 468 ADB2RE, reverse engineering stored procedure 69
ADB2C14 panel 473 ADB2RT panel 167
ADB2C14M panel 473 ADB2S panel 526
ADB2C1S panel 470 ADB2S source member 526
ADB2C2 panel 477 ADB2S1 source member 526
ADB2C2L panel 479 ADB2STAT panel 96, 97
ADB2C3 panel 485 ADB2SU source member 526
ADB2C31 panel 478, 486 ADB2SYS panel 42
ADB2C4 panel 489, 494 ADB2UCUS skeleton 64
ADB2C40 panel 496, 497 ADB2UE panel 365, 367
ADB2C41 panel 491 ADB2UPA panel 359
ADB2C42 panel 492, 495 ADB2US panel 356
ADB2C6 panel 498 ADB2UT panel 362
ADB2C62 panel 500 ADB2UTC panel 362
ADB2CCD panel 534 ADB2UTIL program, authorizing 67
ADB2CCI panel 534 ADB2UX panel 365
ADB2CCJ panel 534 ADB2W panel 310
ADB2CCR panel 459 ADB2W1 panel 311, 323
ADB2CCS panel 134 ADB2W1I panel 316
ADB2CEX1 panel 465 ADB2W1O panel 316, 317
ADB2CNA panel 548 ADB2W1Q panel 312
ADB2CNU panel 548 ADB2W1S panel 314, 323
ADB2CONF panel 606 ADB2Z panel 380
ADB2CPS panel 472 ADB2Z2B panel 392
ADB2CUS1 panel 47 ADB2Z2B1 panel 345, 392
ADB2CUS2 panel 44 ADB2Z2D panel 382
ADB2CUS3 panel 44 ADB2Z2D2 panel 382
ADB2DB2O panel ADB2Z2R panel 386
display archive log 401, 402 ADB2Z2RD panel 386
display distributed threads 410 ADB2Z2RS panel 386
display function statistics 428 ADB2Z2RU panel 386
Display Group 391 ADB2Z2S panel 390
Display Log Information 404 ADB2Z2T2 panel 384
display RLIMIT 386 ADB2Z2U2 panel 383
display stored procedure statistics 423 ADB2Z2Z panel 394
display utilities 383 ADB2Z5 panel 405
start all functions 429 ADB2Z51 panel 407
start all stored procedures 423 ADB2Z52 panel 408
start DDF 413 ADB2Z53 panel 408
start RLIMIT 386 ADB2Z54 panel 409
stop all functions 429 ADB2Z55 panel 409
stop all stored procedures 423 ADB2Z56 panel 410
stop RLIMIT 386 ADB2Z5L panel 406
ADB2DB2X panel 62 ADB2ZBA2 panel 399
ADB2DDF panel 539 ADB2ZBD panel 399
ADB2DF panel 147 ADB2ZBH panel 401
ADB2DIP panel 162 ADB2ZBH2 panel 401
ADB2DIPD panel 162 ADB2ZDC2 panel 410

666 User's Guide and Reference


ADB2ZDL2 panel 412 ADDRI primary command 278
ADB2ZDS panel 413 Administration Menu panel 42, 62, 97
ADB2ZF panel 425 AL line command
ADB2ZF6 panel 430 databases 240, 241
ADB2ZLA panel 404 indexes 280
ADB2ZLSS panel 403 table spaces 245
ADB2ZLZ panel 405 tables 253, 254
ADB2ZP panel 414 ALC line command
ADB2ZP6 panel 424 tables 253, 257
ADB2ZSB panel 431, 432 Aliases panel 551
ADB2ZSR panel 433 See Tables, Views, and Aliases panel 594
ADB2ZZAL panel 398 aliases, displaying 551
ADB2ZZMN panel 396 ALIBNDxx job 534
ADB2ZZTL panel 398 ALIGN parameter 340
ADBBIND member 34 ALLOC
ADBCATVT, catalog copy version table 68 supplying as input to ADBTEP2 335
ADBCHKPT checkpoint table 31, 344 Allocated and Used Space for Table Spaces panel 207
ADBCMRG panel 460 Alter ALC function 271, 272, 273, 275, 339
ADBCRO panel 457, 459 Alter Buffer Pools panel 399
ADBDMT EXEC 79 Alter Database panel 241
ADBDMT panel 78 Alter Functions panel 425
ADBDMT table 78 ALTER primary command 278
ADBDMTI EXEC 79 Alter Stored Procedures panel 414
ADBDMTI panel 80 Alter Table Space panel 245
ADBL CLIST 36, 42 Alter/Rename Database panel 241
ADBL CLIST with DMT parameter 79 alternate forms of syntax 10
ADBOPT parameters 352 alternate statements 10
ADBPAUSE ALTPART primary command 260
supplying as input to ADBTEP2 335 analyze WSL 462
ADBPAUSE statement 353 APF Authorization Table, updating
ADBSYSIN ADB2ATH and ADB2UTIL, authorizing 67, 68
supplying as input to ADBTEP2 335 Application Plans panel 110, 582
ADBTEP2 (Batch Restart program) 339 application structure 530
ADBOPT parameters 352 applications
DB2 Admin support commands creating 525
ADBPAUSE 335 developing 525
ADBSYSIN 335 developing new 11
ALLOC 335 developing small 13
CHECKBEGIN 335 extending 11, 525
CHECKEND 335 sample 526
TEMPLATE 335 sample application structure 530
TSODELETE 335 using variables 531
enabling to run 31 writing 525
input types 340 Archive Current Log panel 404
parameters 340 archive log
pausing 353 display parameters 402
restarting 345 set parameters 403
restarting Migrate jobs 291 Archive Log panel 398
supplying input to 335 asterisk (*) 93
using 343 authorization options panel 132
using with LOBs 348 Authorization Options panel 546
ADBTEP2 summary report authorization switching 287, 339, 350
using 347 authorizations
ADBTEPA (Batch Restart program) 339 displaying 605
ADBOPT parameters 352 granting 608
enabling to run 31 revoking 606
overview 350 Automatic (A) base version method 449
pausing 353 auxiliary table 594
restarting 352
using 351
ADBWSTOP panel 245
ADBZ2SB panel 432
B
backup, subsystem 431
Add LISTDEFs panel 219
BALANCE command 247
Add Template panel 228
base version method 449, 465
ADDFK primary command 278
Batch Checkpoint Table panels 344, 392
ADDFK, primary command 260
Batch Job Utility Parameters panel 359
ADDRI line command 293

Index 667
batch reports change management (continued)
creating 136 main menu panel 452
generating 136 making a change to a database 455
overview 135 masks 477
Batch Restart program modifying changes 470
See also ADBTEP2 339 moving changes from one system to another 456, 472
See also ADBTEPA 339 overview 446
batch statement lists 309, 340 pending changes 447
Bind Application Plan panel 585 prerequisites 453
Bind Batch Jobs panel 534 process 447
Bind Package panel 571 promoting changes 456, 472
BIND, DB2 34 recovering changes 468
BINDERROR parameter 340 regenerating versions containing LOBs 493
BLOB (binary large object) 85, 291 registering changes 448, 457
browse panels 85 run-time WSL 450
Buffer Pool Hit Ratios panel 401 running changes 450, 465
buffer pools runtime analyze 465
altering 399 scenarios 454
displaying 399 setting the level of use 453
hit ratios 401 status of changes 450
Build SQL SELECT Prototype panel 147 strategy 454
terminology 446
types of changes 450
C version scopes 494
versions 489
CAN line command 382
Change Management
Cancel Distributed Threads panel 410
database 33, 34
catalog
enabling to use 33, 34
creating additional indexes 69
Change Management (CM) panel 452
displaying 7
Change Management ID table 453
multiple copies 7, 68, 133, 533
Change Parameters panel 122
panels 101
Change Statements panel 470
previously defined 537
Changed Objects panel 500
querying 131
changes
retrieving interpretive information from 115
analyzing 449, 462
selecting copy of 134
auditing 498
system catalog panels 545
Change Management process 447
catalog copy version table
Change Management scenarios 454
ADBCATVT table, creating catalog copy version 68
Change Management strategy 454
maintaining 534
defining for change management 447
catalog copy versions
deleting 471
bind jobs 534
displaying 499
create copy 534
enabling Change Management 33, 34
delete 534
importing SQL statements into 473
insert 534
making through Change Management 457
catalog records
managing 445
containing default masks 512
modifying 470
catalog statistics
moving changes from one system to another 456, 472
migrating 291
pending 447
reverse engineering 171
recovering 468
CDB (communications database) panel 405
registering 448, 457
Change Current SQL ID panel 129
running 450, 465
Change DB2 Admin Defaults panel (ADB2P2) 162
status of 450
Change DB2 System Checkpoint Frequency panel 405
types of 450
Change defaults panel 123
virtual 447
change management
Changes panel 499
analyze WSL 462
characters
analyzing changes 449, 462
mixed-case support 93, 123
auditing changes 498
CHECKBEGIN
base version method 449
supplying as input to ADBTEP2 335
choosing a base version method 465
CHECKEND
comprehensive solutions 6
supplying as input to ADBTEP2 335
defining changes 447
checkpoint table, creating 31
deleting changes 471
CLIST, ADB
displaying changed objects 500
TSO LOGON PROC, linking DB2 Admin to 42
displaying changes 499
CLIST, ADBL 42
ignores 482
CLIST, ADBL, preparing 36
importing changes from a data set 473

668 User's Guide and Reference


CLIST, DB2 Admin 530
CLOB (character large object) 85, 291
D
clone line commands 594 data conversion 275
clone tables data entry panels 527
line commands 594 data set names
viewing 594 used for Migrate function 300
cloning work statement lists 312 used with DB2 HPU 300
clustered tables 252 data set naming conventions, using ADB2UCUS 64
collections 576 data sets
Collections panel 576 GEN DDL output 630
column headers 84 print 126
column values, variables containing 532 data sets, work
columns created when redefining indexes 249, 285
changing 252 created when redefining tables 271, 273
displaying 552 created when renaming databases 243
Columns panel 552 ISPF 630
command line data sharing group 391
DB2 Admin commands, using 84 data types 560, 627
commands Data Types panel 560
DB2 8 Database administration
DB2 line commands 70 comprehensive solutions 6
equal (=) line 89 database administration and change management solutions 6
general line 89 Database Structures panel
General Line 617 displaying 557, 559
installation-defined line 70 databases
line 88, 617 AL line command 240, 241
maximum length, setting 123 altering 240, 241
minus (-) line 89 Change Management 33, 34
overview 88 changing 240
primary 88, 612 creating 154
slash (/) line 89 displaying 555
special line 89 exploring 13
Special Line 617 large number of 629
Comment On Objects panel 152 migrating 291, 293
comments performance and space queries 9
functional 335 renaming 240, 241
placing on objects 161 Databases panel
communications database panel 405 displaying 555
compatibility mode 4 reverse engineering example 172
constraints 579 DB2 Admin
Constraints panel 579 Alter ALC function 272
CONTINUE command 247 Alter Redefine function 245
CONTINUE primary command 272 Alter Restore function 270
CONTINUE, primary command 257 Authorization Switching function 71
control tables, LISTDEF 217 features overview 7
conversion job step 275 improving performance of 74
conversions 627 Look Up function 91
copies of DB2 catalog 533 main menu panel 97
Copy Customization Parameters panel 44 menus, tailoring main and selection 60
copying DB2 data 291 Migrate function 291
cost estimates, displaying 123 panels
CPYRUNxx job 534 browse 85
Create Catalog Copy and Bind Batch Jobs panel 534 filtering data on 93
Create Function panel 427 naming conventions 87
Create Stored Procedure panel 416 navigation 87
Create View on SYSIBM.SYSROUTINES panel 424, 430 refreshing data on 95
Create View Source Statements panel (for a table) 597 scrollable fields 95
Create/Drop/Label/Comment On Objects panel 152 sorting data on 103
creating native SQL procedure panels 417 source code names 87
creating SQL procedures 417 SQL error display 86
customization table display 84
ADB2CUST EXEC 46 parameters
ADB2UCUS skeleton 64 action for SQL error 123
environment variables 44 changing 122
summary 29 defaults 123
using sample library jobs 44, 47 migrate options 129
panel colors and highlights 122
print data sets 126

Index 669
DB2 Admin (continued) diagnostic information
parameters (continued) gathering 636
prompt options 127 Display Active Locations panel 412
processing logic 528 Display Archive Log Parameters panel 402
product highlights 4 Display Batch Checkpoint Table panel 392
Rename database function 240 Display Batch Job Checkpoint Table panel 345
running multiple versions 31, 35, 67 Display Buffer Pool Hit Ratios panel 401
Smart Alter function 269 Display Buffer Pools panel 399
status of 96 Display Catalog Copy Versions panel 534
tailoring summary 29 Display Function Statistics panel 428
uses of 12 Display Group panel 391
DB2 Admin Main Menu panel 73 Display Log Information panel 404
DB2 Admin Menu panel 97 Display or Alter Functions panel 425
DB2 Admin restrictions on DB2 object names 139 Display or Cancel Distributed Threads panel 410
DB2 Admin Sample Update Application panel 526 Display or Manage Traces panel 384
DB2 authorizations, granting 108 Display or Terminate Utilities panel 383
DB2 BIND 34 Display or Update CDB panel 405
DB2 data type conversions 627 Display or Update IPNAMES panel 408
DB2 High Performance Unload (HPU) Display or Update LOCATIONS panel 406
reading the DB2 catalog 334 Display or Update LULIST panel 410
DB2 Object Comparison Tool 29, 323 Display or Update LUMODES panel 408
DB2 object names restrictions 139 Display or Update LUNAMES panel 407
DB2 objects Display or Update MODESELECT panel 409
changing 239 Display or Update Resource Limit (RLIMIT) Tables Owner
creating reports 136 panel 386
generating reports 136 Display or Update Resource Limit (RLIMIT) Tables panel 386
large number of 629 Display or Update USERNAMES panel 409
migrating 11, 291 display panels 86
reports 134 Display Stored Procedure Statistics panel 423
reverse engineering 171, 503, 630 Display Threads panel 382
DB2 Performance Queries panels 187 Display Utilities panel 383
DB2 subsystem Display Views on SYSIBM.SYSROUTINES panel 424, 430
administering 379 Display/Alter Stored Procedures panel 414
Archive Log panel 398 Display/Update Resource Limits panel 386
backing up 431 distributed data facility
choosing active system to use 42 See DDF 413
data sharing groups 391 Distributed DB2 Systems panel 539
recovery 431, 433 distributed systems, running DB2 Admin across 539
stopping 390 distributed threads, displaying or canceling 410
system parameters 394 DLEVEL variable 531
System Parameters panel 396 DMT parameter of ADBL CLIST 79
DB2 Subsystem Customization Parameters panel 44 documentation
DB2 system catalog accessing 15
See catalog 68 documentation changes 17
DB2 System Catalog panel 132, 546 Drop Impact Reports, using 162
DB2 Table Spaces with Locking Size=S panel 195 Drop Objects panel 152
DB2 tools, invoking 12, 14, 77 DSN line command 591
DB2 utilities DSN1COMP offline utility 369
running 355 DSN1COPY offline utility 369
DB2 utility templates, upgrading 75 DSN1PRNT offline utility 369
DB2, upgrading to a new release of 75 DSNTIAD program 34
DB2ACMD variable 527 DSNWZP, optimizing 70
DB2AUTH variable 531 dynamic SQL statements 8
DB2SYS variable 531
DBCLOB (double-byte character large object) 85, 291
DBRM 577
DDF (distributed data facility)
E
Edit Alter Job panel 262
starting 413
Edit Generated JCL panel
stopping 413
for a table 365
DDL command 172
for a table space 358
DDLBNDxx job 534
for an index 367
ddnames, associating with templates 234
Edit LISTDEF Clause panel 224
declared temporary tables 32
Edit LISTDEF panel 221
defaults, changing DB2 Admin parameters 123
Edit Template panel 228
delete LISTDEF clause panel 221
enabling-new-function mode 4
DELETE prototyping 147
end-of-data marker 84
demo panels 101
environment variables 44

670 User's Guide and Reference


equal (=) line command 89
ERP (Enterprise Resource Planning) 629
I
examples IBM Support Center
SQL SELECT prototyping 147 using the 637
translation masks 519 ignore fields 483, 485
Execute SQL Statements from Screen Input panel 143 ignores
Execute SQL Statements panel 142 creating 487
execution prompt 127 deleting 489
Existing (E) version base method 449 displaying 486
Explain an SQL Statement panel 373 editing 488
EXPLAIN function 9, 371 fields 483
Explain panel 372 generic fields 485
Extracted SQL panel managing with Change Management 482, 485
for a DBRM 579 overview 482
for a package 575 Ignores panel 486
for package in collection 577 image copy data sets 369
Implicit LOB and XML table support 289
import changes 450
Import changes - Select process modes panel 473
F Import changes panel 473
fast changes 450 Index Space Estimator panel 441
filter objects 102 Index Space Maintenance Recommendations panel 211
Free Application Plan panel 589 Index Utilities panel 365
Free Package panel 574 indexes
function table, creating 377 AL line command 280
functional comments 335 altering 280
functions changing 280
altering 425 creating 159
creating 427 displaying 600
displaying 425 estimating space requirements 441
managing 425 plan table 376
starting 429 RDEF command 280
statistics 428 redefining 280, 282, 284
stopping 429 renaming 281
view of 430 Indexes Exceeding Allocated Primary Quantity panel 206
views of 430 Indexes Not Used By Any Plan or Package panel 200
Functions panel 562 Indexes On Tables With Fewer Than n Pages panel 199
fuzzy searches, performing 132 Indexes panel 600
Indexes with 150 or more Leaf Page Distance panel 198
Indexes with 2 or More Levels panel 196
G Indexes With Clustering Level Problems panel 192
GEN command 172 Indexes Without RUNSTATS Information panel 190
General Customization Parameters panel 47 Indexes Without SPACE Information panel 204
general DB2 Admin variables 531 INSERT prototyping 147
general line commands 89, 617 Insert RLIMIT panel 386
Generate Analyze Job panel 462 installation
Generate Compare Jobs panel 323 activating DB2 Admin 27
Generate SQL from DB2 Catalog panel 172 running different versions of DB2 Admin 31, 35, 67
Generate SQL from the DB2 catalog 630 summary 29
global temporary table 594 verification 42, 73
GOC3 panel 479 installation-defined line commands 70
GOC4 panel 487 Interpret Work Statement List Options panel 316
GOCCI panel 487, 488 Interpret Work Statement List report 316
Grant/Revoke Privileges On Objects panel 167 IPNAMES panel 408
ISPF
work data sets 630
ISPF browse, setting for command output 123
H ISPF environment
hardware requirements 29 customizing variables 44
help panels 527 ISPF panel source members
high level qualifier 534 See source members 526
High Performance Unload (HPU) ISPF parameters 122
work data sets for Migrate 300 ISPF Parameters panel 122
highlights of DB2 Admin 4 ISPF statements
hint mode 373 maximum length, setting 123
hit ratios 401 ISPFSTMT variable 527

Index 671
J LookAt xvi
lowercase character support 93, 123
JCL for COPY utility, editing 358 LULIST panel 410
LUMODES panel 408
LUNAMES panel 407
L
Label Objects panel 152
labels 160 M
Launchpad main menu panel 42, 61, 62, 97
launching tools 82 Manage Batch Checkpoint Table panel 392
running 77 Manage Functions panels 425
tailoring 66 Manage Ignores panel 485
Launchpad Entry panel 80 Manage Masks panel 477
Launchpad table Manage Stored Procedures panels 414
adding tools to 80 Manage Traces panel 384
creating 78 Manage Versions panel 489, 494
deleting tools from 82 Manage Work Statement Lists panel 310
displaying 78 mask lines 479
modifying 79 masks 503
updating tools in 81 creating 479
Launchpad Table panel 78 deleting 482
legal notices displaying 478
trademarks 660 editing 481, 504, 505
libraries, copying fixed to variable block 36 examples 519
LIKE ON/OFF command 132 hierarchy 479, 507
line command area 84 managing with Change Management 477
line command description area 84 specifying 504
line command table syntax 507
DB2 line command table, contents of 70 valid names 507
line commands Masks Lines panel 479
equal (=) 89 Masks panel 478
general 89 materialized query tables 157, 594
installation defined 70 MAXE parameter 340
list of 617 MAXROWS variable 531
minus (-) 89 menu panels 527
slash (/) 89 message retrieval tool
special 89 LookAt xvi
using 88 messages
LISTDEF methods for accessing xvi
adding 219 MIG
adding a clause to 221 line command 293
changing a single clause 224 primary command 295
changing the clauses of 221 migrate
control tables for 217 placing primary commands on 293
deleting 226 migrate batch jobs, running 298
deleting a clause from 221 Migrate function
managing 217 Batch Restart program 339
running utilities 368 overview 11, 291
upgrading control tables for 218 restrictions 291
LISTDEF panels 215 specifying input 293
LISTDEFs panel 219 using 293
LO option 362 work data sets 300
load jobs, migrating 299 migrate options, changing 129
load summary report 321 Migrate panels, displaying the 293
LOAD utility job stream, creating your own 362 migrate parameters
LOBs generating batch jobs with 295
running WSLs 329 Migrate Parameters panel 295
utility options 362 minus (-) line command 89
LOCATIONS panel 406 MIXED parameter 340
log mixed-case character support 93, 123
archive current 404 MODESELECT panel 409
display parameters 402 Move STOGROUP-defined Page Set Input panel 439
set parameters 403, 404 Move VCAT-defined Page Set Input panel 439
logic, DB2 Admin 528 multilevel security 253
Look Up function multiple copies of system catalog
examples of 91 panel appearance 133
using 91 using 7, 68, 533

672 User's Guide and Reference


multiple copies of system catalog (continued) parameters (continued)
using previously defined 537 DB2 Admin (continued)
multiple versions of DB2 Admin 31, 35, 67 panel highlights 122
MySupport 15 print data sets 126
prompt options 127
ISPF 122
N PANEL(panel) 530
SYSTEM(name) 530
name used to restart 340
partition 255
naming conventions, panels 87, 529
partitioned tables
native SQL procedures
adding a partition 252, 255
creating 417
adding a partitioning key 252, 255
navigation of DB2 Admin panels 87
altering a partition 255
new-function mode 4
changing partition boundaries 252
NL option 356
rotating partitions 252, 255
normal changes 450
partitioning indexes 284
partitioning key 255
PCACT parameter 340
O pending changes 447
object types 594 Pending Changes - Conflict Resolution panel 459
objects percent sign (% ) 93
changing 239 performance
creating reports 136 features 4
creating views of 69 reverse engineering 171
displaying changed 500 performance queries panels 187
displaying information 102 plan table
filtering information 102 creating 375
generating reports 136 index on 376
large number of 629 listing rows 373
managing changes 8 rows in 372
managing changes to 445 upgrading 375
migrating 291 planname suffix 534
reports 134 plans
reverse engineering 115, 171, 503, 630 binding 585
offline utilities, using 369 displaying 559, 582
online utilities 68 freeing 589
ORIGINAL command 247 rebinding 587
plus sign (+), in Look Up function 91
predictive governing 10
P prefix of panels 529
primary commands
packages
list of 612
binding 571
using 88
displaying 559, 568
primary keys
freeing 574
adding 255
rebinding 573
primary space allocation
Packages panel 568
estimating 441
Page Set Statistics panel for VSAM Statistics 437
PRIMKEY, primary command 257
page sets
print data sets 126
displaying statistics 437
problem determination 13
moving between STOGROUP- and VCAT-defined
problems
spaces 439
diagnostic information about 636
resizing 438
procedures
panel source members
altering 414
See source members 526
creating 416
PANEL variable 527
displaying 414
PANEL(panel) parameter 530
managing 414
panels
starting 423
naming 529
statistics 423
prefix and suffix 529
stopping 423
setting variables 527
views 424
types of 527
views of 424
parameters
programs
DB2 Admin
ADBTEP2 339
changing 122
DSNTIAD 34
changing defaults 123
promote changes 450
migrate options 129
Promote panel 472
panel colors 122

Index 673
prompt options, changing 127 RI (referential integrity) 278
prototyping 147 RLIMIT
PUNCHDDN substitution variables 233 displaying 386
updating 386
rows
Q setting maximum length to fetch 123
setting message when none are returned 123
queries
table display panels 84
performance and space utilization 187
updating using SQL 530
running 102
Run a Change panel 465
system catalog 131
Run or Explain SQL Statements panel 144
question mark (?), in Look Up function 91
run-time WSL 450
running DB2 Admin across distributed systems 539
running performance queries 187
R running work statement lists 309
RDEF command RUNSTATS information
indexes 280, 282 creating views for updating 69
table spaces 245, 247 RUNSTATS utility
real-time statistics panel 209, 211 performance panels 189, 190
rebind and reverse engineering output 186 runtime analyze 465
Rebind Application Plan panel 587
Rebind Package panel 573
recover change 468
recover changes 450
S
SADBSAMP library jobs 34, 44, 47
Recover Strategy panel 468
sample
recovery of changes 468
application 526
recovery, subsystem 431
application structure 530
referential integrity (RI) 278
library jobs 44, 47
Register Change panel 460
SAVE ON/OFF command 132
Register Options panel 457, 459, 460
saving search criteria 132
REL primary command 260
schemas 565
related table objects 276
Schemas panel 565
REN line command
screen readers and magnifiers 16
indexes 281
scrollable fields 95
Rename Database panel 241
search arguments 84, 93
REPAIR LEVELID statement 356
search criteria, saving 132
Report Changes panel 498
secondary space allocation
report drop impacts 123
estimating 441
report revoke impacts 123
security 4
reports
security label columns 253
creating 136
SELECT access, granting 69
generating 136
Select Copy of DB2 Catalog panel 134
overview 135
SELECT prototyping 147
requirements
selection menu, tailoring 60
hardware 29
Sequence Objects panel 590
software 29
sequences 590
Resize Page Sets input panel 438
Set Archive Log Parameters panel 403
Resource Limit Tables Owner panel 386
Show Work Statement List panel 314
resource limit, displaying or updating 386
Skip-Next line command 345
RESTART parameter 340
slash (/) line command 89
restarting jobs 339
Smart Alter 269
restarting Migrate jobs 291
software requirements 29
restarting work statement lists 309
SORT primary command, issuing a 103
reverse engineering
source code
example 172
for panel ADB2DB2X 62
large number of objects 630
panel names in source code 87
objects 172
source members
overview 10
ADB2S 526
panels 171
ADB2S1 526
performance improvements 171
ADB2SU 526
sample output 115, 182
sample application 526
sample rebind output 186
SP line command 369, 591
sample Rebind output 115
space information collection utilities 202, 204
stored procedure ADB2RE 69
space management 435
wildcard characters 179
estimating for indexes 441
Revoke Privileges On Objects panel 167
estimating for tables 441
revoking system authority from an SQLID 168
using Space Manager 436

674 User's Guide and Reference


Space Management by Database panel 437 Storage Group panel 564
space management functions, performing 11 storage groups 564
Space Manager stored procedures
launching 436 altering 414
overview 435 creating 416
Space Manager panel 436 displaying 414, 580
space utilization queries 187 managing 414
special characters 91 starting 423
special line commands 89, 617 statistics 423
Specify Compare Ignore Fields panel 487 stopping 423
Specify Compare Masks panel 479 views of 424
Specify Ignore Fields: Objects panel 487, 488 Stored Procedures panel 580
Specify Job Parameters panel 241 STOSPACE utility 202, 204
SQL (structured query language) structure, sample application 530
error display panels 86 structured query language
explain function 373 See SQL 530
IDS, managing 9 Substitution variables in utility templates 233
updating rows using 530 suffix of panels 529
SQL error, specify DB2 Admin action for 123 summary of changes 17
SQL IDs support
changing 129 required information 636
managing 9 synonyms 603
SQL procedures Synonyms panel 603
creating 417 syntax
SQL SELECT prototyping 147 translation masks 507
SQL statements SYSIBM.SYSROUTINES panel 424, 430
DELETE prototyping 147 system administration 379
executing dynamic 8 system administration functions 9
EXPLAIN function 9, 373 System Administration panel 380
explaining 144 system catalog
INSERT prototyping 147 creating additional indexes 69
maximum length, setting 123 displaying 7
methods for building and running 142 multiple copies 7, 68, 133, 533
reconstructing for objects 171, 503 panels 101, 545
running 143, 144, 152 previously defined 537
SELECT prototyping 147 querying 131
UPDATE prototyping 147 retrieving interpretive information from 115
SQL statements panels 141 selecting copy of 134
SQLSTMT variable 527 System Catalog panel 132, 546
SSID parameter 340 system parameters
SST1RE source system job Archive Log panel 398
performing reverse Engineering in 298 managing 394
SST2UL source system job System Parameters panel 396
unloading data with 298 System Parameters panel 394, 396
SST3CH source system job System Privileges Authorization panel 168
changing unload control data sets in 298 SYSTEM(name) parameter 530
SST4XF
first job in sequence 299
SST5DE
second job in sequence 299
T
table display panels 84, 123, 527
Start All Functions panel 429
Table Space Estimator panel 441
Start All Stored Procedures panel 423
Table Space Maintenance Recommendations panel 209
Start DDF panel 413
Table Space Utilities panel 356
Start RLIMIT panel 386
table spaces
statement list and data, migrating 299
AL line command 245
statement table, creating 376
altering 245, 247
statistics
changing 245
migrating 291
creating 155
reverse engineering 171
estimating space requirements 441
STATUS primary command 96
large number of 629
STOGROUP-defined spaces 439
migrating 291
Stop All Functions panel 429
RDEF command 245, 247
Stop All Stored Procedures panel 423
redefining 245, 247
STOP Check - Action panel 245
restrictions when changing 247
Stop DB2 panel 390
Table Spaces Containing More Than One Table panel 202
Stop DDF panel 413
Table Spaces Exceeding Allocated Primary Quantity
Stop RLIMIT panel 386
panel 205

Index 675
Table Spaces panel 591 tools, invoking 12, 14, 77
Table Spaces With More Than n Percent Dropped Space traces, displaying or managing 384
panel 194 trademarks 660
Table Spaces With More Than n Percent Relocated Rows translation masks 503
panel 192 applying 505
Table Spaces Without RUNSTATS Information panel 189 creating 479
Table Spaces Without SPACE Information panel 202 deleting 482
Table Utilities panel 362 displaying 478
tables editing 481, 504, 505
adding a partition 252, 255 examples 519
adding a partitioning key 252, 255 explained 505
adding a primary key 255 hierarchy 479, 507
AL line command 253 managing with Change Management 477
ALC command 257 specifying 504
ALC line command 253 syntax 507
altering 253, 254 valid names 507
altering a partition 255 triggers 566
altering definitions 11 Triggers panel 566
backing out changes 270 trusted contexts
changing 252 adding an attribute 548
changing multiple 278 adding an ID 548
changing partition boundaries 252 altering 548
clustered 252 creating 548
comments 161 displaying 548
copying 13 line commands 548
creating 156 panel 548
DB2 Admin Alter ALC function 272 TSODELETE
DB2 Admin Smart Alter 269 supplying as input to ADBTEP2 335
Drop Impact Reports 162 TST1CR
dropping 161 creates objects on target system 299
estimating space requirements 441 TST2RLn
labels 160 reloads data; multiple jobs can be created 299
large number of 629 TST3Ck
migrating 291 performs CHECK DATA (optional) 299
recovering 270 TST4RS
redefining 253, 257 runs Runstats (optional) 299
related objects 276 TST51C
restoring changes 270 performs an Image copy (optional) 299
rotating partitions 252, 255 TST6RB
security label columns 253 Rebinds (optional) 299
VOLATILE/NOT VOLATILE clause 252 TST7DE
Tables, Views, and Aliases panel deletes data sets on target system 299
displaying 594 tutorial, navigating 101
tailoring main menu 60 types of panels 527
tailoring summary, DB2 Admin 29
target system
transferring the jobs/work statement and data to 299
target system jobs
U
Unrecognized Macro Parameters panel 398
submitting in order 299
Update CDB panel 405
technotes 15
Update IPNAMES panel 408
TEMP database 32
Update LOCATIONS panel 406
TEMPLATE
Update LULIST panel 410
creating and maintaining 226
Update LUMODES panel 408
supplying as input to ADBTEP2 335
Update LUNAMES panel 407
upgrading control tables for 227
Update MODESELECT panel 409
Template Common Options panel 228
UPDATE prototyping 147
template data set, constructing 231
Update Resource Limit (RLIMIT) Tables Owner panel 386
Template Disk Options panel 228
Update USERNAMES panel 409
TEMPLATE panels 215
upgrading control tables, LISTDEF 218
Template Tape Options panel 228
upgrading control tables, TEMPLATE 227
template, associating with ddname 234
User-defined (U) base version method 449
TEMPLATEs Panel 226
user-defined data types 560
Terminate Utilities panel 383
USERNAMES panel 409
terminology, change management 446
uses of DB2 Admin 12
threads
using alternate forms of syntax 10
cancelling 382
using Space Manager 435
displaying 382, 412
UT line command 356

676 User's Guide and Reference


UTIL command 356 viewsXML table column information
utilities XML table base 594
displaying 383 XML table base 2 594
LISTDEF 368 XML tables 594
running 8, 105, 355 virtual changes 447
space information collection 202, 204 VSAM data sets 369
table spaces 356 VSAM statistics for page sets, displaying 437
terminating 383
utility options
specifying 361
utility template
W
wildcard characters 93, 179
XML 237
work data sets
Utility Template Dataset Name panel, using 231
created when migrating DB2 data 300
Utility Template panel 228
created when redefining table spaces 249, 285
utility template, creating data set name 231
created when redefining tables 271, 273
UTL command 356
created when renaming databases 243
created when restoring table changes 270
work statement
V preparing to run online 68
Validate Work Statement List report 317 work statement list
VALUES command 247 using DB2 High Performance Unload 332
variables Work Statement List Library panel 311
containing column values 532 work statement lists
DB2ACMD 527 cloning 312
DB2AUTH 531 concepts 306
DB2SYS 531 creating 12, 306
DLEVEL 531 creating manually 334
general DB2 Admin 531 interpreting 316, 317
in your application 531 invoking HPU 332
ISPFSTMT 527 jobs that are generated from 323
MAXROWS 531 load summary report 321
PANEL 527 managing 310
processing based on 528 restarting 309, 322
setting on your panels 527 running 309, 320
SQLSTMT 527 running jobs in parallel 334
VCAT-defined spaces 439 sample 323
verification of installation 27 storing of 309
version scope using 305
creating a version from 492 using DB2 Object Comparison Tool 307
Version Scope Objects panel 496, 497 using HPU when not created by DB2 Object Comparison
version scopes Tool, ALTER, or ALC 334
creating 496 using HPU with MIGRATE 333
deleting 498 worklist name used to restart 340
displaying 495 WORKLIST parameter 340
editing 497 WSL
managing with Change Management 494 preparing to run online 68
overview 494 Substitution variables in utility templates for
Version Scopes panel 492, 495 PUNCHDDN 233
versions
creating 492, 493
deleting 494
displaying 491
X
XML
managing with Change Management 489
indexes 600
overview 489
running WSLs 330
Versions panel 491
utility options 362
viewing clone tables 594
utility template 237
views
XML tables
altering 287
viewing 594
changing 287
XP line command 369
creating 109
displaying 600
functions 430
stored procedures 424
updating RUNSTATS information 69
Views panel
See Tables, Views, and Aliases panel 594

Index 677
678 User's Guide and Reference


Program Number: 5697-L90

Printed in USA

SC18-9552-14

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy