Running Db2 utilities on table spaces
Many Db2 utilities run against table spaces. You can use Db2 Admin Tool to specify the utility options and generate the JCL to run these utilities.
About this task
If you want to run a utility against a LISTDEF list of table spaces, see Running utilities on LISTDEF lists.
If you want to run redirected recovery, see Running a redirected recovery on a table space.
Procedure
To run Db2 utilities on table spaces:
-
Select the table spaces on which you want to run the utility:
- On the DB2 Administration Menu (ADB2) panel, select option 1.
- On the System Catalog (ADB21) panel, if you want to select all table spaces in one or more databases, select option D. Otherwise, select option S. Optionally specify any filtering criteria at the bottom of the panel, and press Enter.
- If the Databases (ADB21D) panel is displayed, filter the list as needed, and specify the UTIL primary command.
-
If the Table Spaces
(ADB21S) panel is displayed, select
one or more table spaces:
- If you want to select one table space, issue the UT line command next to the table space name, and press Enter.
- If you want to select more than one table space, filter the list as needed, specify the UTIL primary command, and press Enter.
The Table Space Utilities (ADB2US) panel is displayed: - Optional:
Specify the following options as needed:
- BP
- If you plan to generate a batch utility job stream and want to change the JOB statement or other system parameters, specify BP and press Enter. On the resulting Batch Job Utility Parameters (ADB2UPA) panel, specify the options that you want to change. Then, press PF3 to save your changes and return to the Table Space Utilities (ADB2US) panel.
- TU
- If you plan to use templates and want to specify which template to use for a given
utility option, specify TU. Then, follow the instructions in Associating data set templates with keywords.Tip: When you run the COPY utility, by default one copy is written to the data set that is defined by the SYSCOPY DD statement. If you want more than one copy of the output, you can create and use templates for COPYDDN 1, COPYDDN2, RECOVERYDDN1, and RECOVERYDDN2.
- SM
- If you want to run the listed series of utilities, specify the SM
command. The utilities are processed in the order specified in this field. For example, the
following field shows that COPY (C), REORG (O), and RUNSTATS (R) will be run in that
order.
SM - Standard Maintenance C O R
If you specify SM, you cannot set List/Customize DB2 Utility options to YES.
- In the Option field, specify a utility to run on the selected table. For example, specify O to run the REORG utility.
-
Change any of the following control options, and press Enter:
- List/Customize DB2 Utility options
- Specify whether you want to review and edit the utility options. If the value is NO, the
default options for the selected utility are used.
For the REPAIR utility (option N), you must select which REPAIR function you want to run. Therefore, Db2 Admin Tool always uses a value of YES for this field and displays a subsequent option panel, Specify Utility Options - REPAIR TABLESPACE (ADB2USN) panel, even if you set this field to NO.
- Generate work statement list
- Specify whether you want the utility control statements to be added to a work statement
list (WSL). If the value is NO, an executable utility job stream is generated instead.
When you specify the CHECK utility, a batch statement list, which is similar to a WSL, is generated by default, regardless of the value of the Generate work statement list field. The batch statement list is required as an input file to the Batch Restart program (ADBTEP2), which manages the CHECK utility function.
- Generate template statements
- Specify whether you want templates to be used. If the value is YES, Db2 Admin Tool uses the active templates that are
defined. (If you want to change these templates, specify the TU
option.)
Db2 Admin Tool does not generate any TSODELETE statements to delete any existing data sets for the template first. To ensure that any existing data sets are deleted, consider using one of the following techniques when you define the template:
- 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 causes 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).
- Specify a DISP option of NEW, DELETE, DELETE for the data set, if appropriate.
When you specify the CHECK utility, templates are used regardless of the value of the Generate template statements field, because the CHECK utility function requires the use of templates. Either the default templates or the templates that you specify are used.
Tip: If you want the generated REORG and COPY jobs to use LISTDEF lists and the use of LISTDEF is enabled (see Specifying whether LISTDEF is used in generated utility jobs), templates must be set up for these utilities, and the Generate template statements field must be set to YES. - Generate modify after copy
- Specify whether the generated JCL includes a job step to run the MODIFY utility after a full image copy.
-
If the Specify Utility
Options panel is displayed, specify any
additional options, and press Enter.
This panel is displayed if List/Customize DB2 Utility options = YES or if the utility selected is N (REPAIR) or LC (Load with Cross loader).
You must specify the options according to the Db2 syntax rules for utilities. For additional information, restrictions, and recommendations on various utility options, see Db2 online utilities (Db2 13 for z/OS).
-
If you requested a work statement list (WSL): On the Specify Work Statement List
(ADB2WLDA) panel, specify the WSL information, and press
Enter.
The utility statements are added to the WSL.
-
If you requested a batch job stream: On the ISPF edit session, change the generated
job as needed or copy it to another it to another data set.
You can use standard ISPF editor commands to manually modify the JCL.
Db2 Admin Tool supports unloading tables or table spaces that produce a record length that is less than 32 KB. When a table or table space with LOB objects is unloaded, the required record length might exceed 32 KB. In this case, modify the unload job or work statement list (WSL) to specify the utility parameters that allow unloading the table or table space.
The following figure shows an example of the generated JCL. In this example, the C - Copy full option was chosen on the Table Space Utilities (ADB2US) panel.
- Submit the generated JCL job or run the specified WSL to run the utility.