Db2 Admin Tool primary commands

Primary commands are issued from the command line on Db2 Admin Tool panels.

Each primary command can be categorized as one of the following types:

Global primary commands

The following table lists the available primary commands that you can issue from any panel in Db2 Admin Tool.
Table 1. Primary commands that can be issued from any panel
Command Alias Description
Start of changeAPPLCOMPATEnd of change Start of changeAPPLCEnd of change Start of changeSets the current application compatibility level for dynamic SQL statements.

This command is equivalent to issuing the SET CURRENT APPLICATION COMPATIBILITY statement.

Syntax:

Read syntax diagramSkip visual syntax diagram APPLCOMPAT *compatvalue
compatvalue
The application compatibility level. You can specify one of the following formats
  • V12R1Mmmm
  • FLmmm
  • mmm
where mmm is the function level number, such as 502. If you do not explicitly specify Vxx, the current version is assumed.

Alternatively, you can specify an asterisk (*) to set the application compatibility level to the current function level.

The specified function level must be equal to or less than the current version and function level and the APPLCOMPAT value that was specified for ADBMAIN at bind time. The new value applies to only the current Db2 connection and does not apply to new Db2 connections that might be established during the Db2 Admin Tool session.

Examples:


APPLCOMPAT V12R1M502
APPLCOMPAT FL502
APPLCOMPAT 502
APPLCOMPAT *
APPLC V12R1M502
APPLC FL502
APPLC 502
APPLC *
End of change
Start of changeCAPSEnd of change   Temporarily overrides the Capitalize object names setting on the Admin Defaults (ADB2P2) panel.

For more information about this setting, see Changing defaults.

Syntax:

Read syntax diagramSkip visual syntax diagram CAPS ONOFF
ON
Specifies that all characters are to be translated to uppercase characters.
OFF
Specifies that lowercase characters are not to be translated to uppercase characters.

Specifying CAPS (without ON or OFF) toggles between CAPS ON and CAPS OFF.

CAT ? Navigates directly to an object.

A question mark (?) is the default shortcut character for the catalog navigation command, CAT. You can specify a different character on the DB2 Admin Defaults (ADB2P2) panel in the CAT command character field.

Syntax:

Read syntax diagramSkip visual syntax diagramCAT?xxqualifier.name
xx
The object type from the System Catalog (ADB21) panel. For example, s is for table spaces, v is for views, and x is for indexes.
qualifier
The object qualifier. You can specify any value that is valid in the Owner field on the System Catalog (ADB21) panel.
name
The object name. You can specify any value that is valid in the Name field on the System Catalog (ADB21) panel.

All parameters are optional. However, you must specify xx if you specify qualifier or name.

Examples:
?d MYDB
?s MYDB.TS1
?s TS1
?s MYDB.
CAT s MYDB.TS1

For a demonstration of how to use this command, see Video: Catalog Navigation Command.

Start of changeCATHLQEnd of change   Updates the high-level qualifier that Db2 Admin Tool is to use during the current session for data sets for the Db2 catalog.

This command displays the DB2 Space Manager (ADB2MSPC) panel, where you can specify the qualifier.

CLREST   Start of changeRestores packages that were freed by the collection clean up function.

This command displays the Restore Packages (ADBPBMRE) panel, where you can specify options for restoring the packages. See Restoring packages.

End of change
CMDS   Displays the active user command list.

See Defining your own primary commands.

CMM   Opens the main menu for the Change Management (CM) function.

This command displays the Change Management (CM) (ADB2C) panel, where you can choose which CM function you want to invoke.

CON   Connects to a remote system.

Syntax:

Read syntax diagramSkip visual syntax diagram CON location-name
location-name
The location name for the remote system.
DB2 db2 command Issues a Db2 command.

Syntax:

Read syntax diagramSkip visual syntax diagram DB2 db2-command

DB2 can be omitted from the command.

db2-command
Any valid Db2 command except for START DB2. Start the command with the command recognition character, which is usually a hyphen (-).

Example:

DB2 -DIS THREAD (*)
DGRP   Runs the Db2 DISPLAY GROUP command.
DTT   Displays all threads.
DUTIL   Displays a list of active and stopped utilities.

This list is displayed on the Display or Terminate Utilities (ADB2Z2U2) panel. See Displaying or terminating utilities.

EXIT   Exits Db2 Admin Tool.
EXPLAIN   Changes the value of the Db2 CURRENT EXPLAIN MODE special register.

Depending on your prompt options, you might be asked to confirm the change before the SET statement is executed. See Changing Db2 Admin Tool prompt options.

Syntax:

Read syntax diagramSkip visual syntax diagram EXPLAIN YESNOONLY
YES
Turns EXPLAIN mode on.
NO
Turns EXPLAIN mode off.
ONLY
Turns EXPLAIN mode on and prevents statements from being executed. Do not use this mode with regular Db2 Admin Tool functions.

For more information about these values, see CURRENT EXPLAIN MODE special register (Db2 12 for z/OS documentation) .

Example:

EXPLAIN YES
ISPF   Issues one or more ISPF statements.

Syntax:

Read syntax diagramSkip visual syntax diagram ISPF ;ispf-statement
ispf-statement
A valid ISPF statement. Use a semicolon (;) to separate ISPF statements.

Example:

ISPF SELECT CMD(MYCMD)
LEINFO   Displays Language Environment (LE) options.
OPTIONS OPT Allows you to change your Db2 Admin Tool settings.

This command displays the DB2 Admin Options (ADB2P) panel, where you can select the settings that you want to change.

OPTIONS BP OPT BP Allows you to change the parameters for utility batch jobs.

This command displays the Batch Job Utility Parameters (ADB2UPA) panel, where you can specify parameters for your utility jobs.

OPTIONS DISPLAY OPT DISPLAY Allows you to change the panel display.

This command displays the Panel Display Options (ADBPPDO) panel, where you can select the items that you want displayed on panels.

PANEL   Displays the specified panel.

This command allows you to extend your Db2 Admin Tool installation with your own panels and then use these panels directly with Db2 Admin Tool. You must design your panels to be invoked with this PANEL command. Your panels 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. For more information about creating your own panels, see Db2 Admin Tool application development.

Syntax:

Read syntax diagramSkip visual syntax diagram PANEL panel-ID
panel-ID
The panel ID, such as ADB21D.

Example:

PANEL ADBP7P
PARMS PARM Displays the current Db2 Admin Tool parameters.

This command displays the Admin Defaults (ADB2P2) panel, where you optionally make any changes to these default settings.

PRINT TABLE PRT TABLE Prints the current table to the specified file.

Syntax:

Read syntax diagramSkip visual syntax diagramPRINTPRT TABLE ONFILEddname
ddname
The DD name for the file. The specified file should be allocated exclusively, which means that it has a disposition of OLD, NEW or MOD. For example, tso alloc f(temp1) dsn(temp1.list) old. If you do not specify a file name, the default file with the DD name PRINT is used.
Tip: You can use option P.P to allocate a data set for PRINT TABLE.

Example:

PRT TABLE ON FILE temp1
PROMPT (options) PRMT Changes Db2 Admin Tool prompt options.

Syntax:

Read syntax diagramSkip visual syntax diagramPROMPTPRMTstatement-typeONOFF
statement-type
The statement type for which you want to change the prompt options. Valid values are:
DDL
Data definition language, or definition SQL statements.
DCL
Data control language, or authorization SQL statements.
DML
Data manipulation language, or update SQL statements.
DB2
Db2 commands.
DSN
DSN commands.
ON
Turns the prompt on for the specified statement type. If a statement type is not specified, the prompt is turned on for all statement types.
OFF
Turns the prompt off for the specified statement type. If a statement type is not specified, the prompt is turned off for all statement types.

If no options are specified after PROMPT or PRMT, the Prompt Options (ADB2PRMT) panel is displayed, and you can enter your preferences on that panel.

Example:

PROMPT DB2 OFF
QTAB   Displays open ISPF tables.
REGION   Displays used and available memory (TSO region information).
SAVE   Saves the current selections or report.

When SAVE is issued on the Details for object(s) (ADBPD) panel, the detail report (which is generated by the DET command) is saved in the specified data set.

SCHEMA   Changes the CURRENT SCHEMA special register.

Depending on your prompt options, you might be asked to confirm the change before the SET statement is executed. See Changing Db2 Admin Tool prompt options.

Syntax:

Read syntax diagramSkip visual syntax diagram SCHEMA schema-name
schema-name
The schema name. If no value is specified, CURRENT SCHEMA is set to the SQL ID.

Example:

SCHEMA ISTJE
SHOW LIBRARY SHOW LIB Shows a member list for the specified library on the specified panel.

Syntax:

Read syntax diagramSkip visual syntax diagram SHOW LIBRARYLIB ddname ONPANELpanel-ID
ddname
The library DD name. The data set that is associated with the DD name must be a PDS or PDSE. If you do not specify a library name, the default library ISPTABL is used.
panel-ID
The panel ID. If you do not specify a panel name, the default panel DB2ADL is used.
SHOW TABLE   Shows the specified table.

Syntax:

Read syntax diagramSkip visual syntax diagram SHOW TABLE name ONPANELpanel-ID
name
The table name. The table must be in open status.
panel-ID
The panel ID. If you do not specify a panel name, the default panel ADB2DF is used.
SHOWPAN   Shows the source code for a panel.

Syntax:

Read syntax diagramSkip visual syntax diagram SHOWPAN panel-ID
panel-ID
The panel ID, such as ADB21T. The default is the current panel.
SMPLIST   Generates a job to run SMP/E list commands on the CSI.
SQL + Issues one or more SQL statements.

If an SQL statement returns rows, the default table display panel shows the rows.

Syntax:

Read syntax diagramSkip visual syntax diagramSQL+;SQL-statement
SQL-statement
An SQL statement. Use a semicolon (;) to separate SQL statements.

If you do not specify an SQL statement, the Edit/Run SQL Statement (ADBPMESQ) panel is displayed. You can enter SQL statements on this panel and run them.

Example:

SQL SELECT * FROM MYTABLE
SQLID AUTH, AUTHID Displays or changes the current SQLID.

Syntax:

Read syntax diagramSkip visual syntax diagramSQLIDAUTHAUTHID ID
ID
The authorization ID. If you do not specify an authorization ID, the DB2 Change Current SQL ID (ADB24) panel is displayed. You can select a value from this panel.

Example:

SQLID ISTJE
SSID   Switches to another Db2 SSID.

Syntax:

Read syntax diagramSkip visual syntax diagram SSID ssid
ssid
The subsystem ID.

Example:

SSID DSN9
STATUS STAT Shows the current status of Db2 Admin Tool and execution control statement statistics.
TESTTIME   Runs the TSO command TIME.
WSL   Opens the main menu for the Work Statement List (WSL) function.

This command displays the Manage Work Statement Lists (ADB2W) panel, where you can select the WSL list or list library that you want to view.

ZPARM   Displays the Db2 subsystem parameter (zparm) values for the current subsystem.

Primary commands for table display panels

The following table lists primary commands that you can issue from any table display panel. For more information about these panels, see Table display panels.

Command Alias Description
BROWSE B, BR, BRO, BROW Browses the current ISPF table.

For more information about BROWSE, see BROWSE and VIEW panels.

FIND   Finds a string on a 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.

Syntax:

Read syntax diagramSkip visual syntax diagram FIND string*NEXTPREVfromcolnotocolno
string
The search string. If the string contains special characters, enclose it in quotation marks (").
*
Search for the last string used.
NEXT
Searches forward from the current location.
PREV
Searches backward from the current location.
fromcolno
The number of the column from which the search is to start. Specifying fromcolno limits the search to the specified column and the columns after it.
tocolno
The number of the column at which the search is to end. Specifying tocolno limits the search to the specified column and the columns before it.

To find the column numbers for fromcolno and tocolno, issue the SORT command without any parameters.

You can specify RFIND to repeat the last FIND command.

Examples:

FIND MYUSERID
FIND MYUSERID PREV
FIND MYUSERID 2 4
FIND MYUSERID PREV 2 4
ORDER   Defines or modifies the ORDER BY clause in the SQL statement that retrieves data for the panel.

This command displays the Order By Columns (ADB2SORT) panel, where you can specify the ORDER BY criteria.

REFRESH REF Refreshes the current ISPF table with data from Db2.
SAVE TABLE AS   Saves the current ISPF table with the specified name in the specified library.

Syntax:

Read syntax diagramSkip visual syntax diagram SAVE TABLE AS name INLIBddname
name
The name under which the table is to be saved.
ddname
The library DD name. The data set that is associated with the DD name must be preallocated before you use this command. If you do not specify a library name, the default library ISPTABL is used.
SEARCH SARG Searches the current ISPF table.

This command displays the Search fields (ADB2SARG) panel, which lists all of the columns in the current ISPF table. On this panel you can specify searches on individual columns by entering a search operator and a search value for the columns. See Filtering data on panels.

Syntax:

Read syntax diagramSkip visual syntax diagramSEARCHSARGRESET
RESET
Clears your search specifications.
SORT   Sorts the current ISPF table based on the specified column or columns.

Syntax:

Read syntax diagramSkip visual syntax diagram SORT column-name
column-name
The column name. Instead of specifying a column name, you can place the cursor in the column that you want sorted. If you do not specify a column name, and the cursor is not in a column, Db2 Admin Tool displays a panel on which you can specify your sort criteria. See Sorting display data.
Start of changeVIEWEnd of change Start of changeVIEnd of change Start of changeOpens a VIEW session for the current ISPF table.

For more information about VIEW, see BROWSE and VIEW panels.

End of change

Primary commands for specific panels

The following table lists primary commands that are specific for certain panels.

Table 2. Db2 Admin Tool primary commands
Command Alias Description
ADD   Adds objects.
ADDC   Adds a check constraint.
ADDCOL   Adds a column to an index.
ADDU   Adds a unique or primary constraint.
AE   Displays all authorizations that are explicitly granted.
AI   Displays all authorizations that are held implicitly.
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 displays all tables that are associated with those indexes.
ALTOPT   Lets you specify options to control ALT processing.
AP   Displays all authorizations that are granted to PUBLIC.
ARCHIVE   Archives partitions from an accelerated table.
AU   Displays all authorizations that are held directly.
BALANCE   Sets the size for each partition to the average size.
Start of changeBETEnd of change   Generates a detail report in batch mode for tables and related objects, packages, and accelerated tables.

The report displays the following types of information for tables and their related objects:

  • Table details
  • Column information
  • Index information
  • Information about keys
  • Information about aliases

The package details report displays the following information:

  • Package details
  • SQL information
  • EXPLAIN information from the package owner's plan table

Start of changeThis command is available on the Tables, Views, and Aliases (ADB21T) panel , the Packages (ADB21K) panel), and the Display Accelerated Tables (ADBPZAT) panel.End of change

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.
BINDOPT   Lets you specify bind and rebind options that are not in the Db2 catalog records.
BP   Change the batch parameters that are to be used.
CALL   Calls the procedure.
CAPTURE   Displays START DYNQUERYCAPTURE panel to stabilize cached dynamic SQL statements.
Start of changeCHKNTSEnd of change   Checks whether any of the new table spaces already exist when moving tables from multi-table table spaces to UTS.
Start of changeCHKPDCEnd of change   Checks whether any of the existing table spaces have pending changes.
CLEAR   Deletes all the rows.
COLUMNS   Performs a column lookup when primary, unique, or foreign key constraints are being added.
COMMENT   Toggles between displaying comments and hiding comments.

COMMENT ON displays comments on a second line. COMMENT OFF hides comments. Entering COMMENT without ON or OFF toggles between the two settings.

COMP   Defines individual tracing components whose trace levels deviate from the default trace level.
CONSTRAINTS   Adds, alters, or drops a primary key, unique key, check constraint, or referential constraint for the table.
COPY C Runs the COPY utility on all objects in the list.
COPYALL CA Runs the COPY utility on all partitions in a single step.
CT   Migrates objects by using Db2 Cloning Tool.
DDEF   Displays Db2 definitions for the selected page sets.
DEL   Deletes all listed objects.
DET   Start of changeGenerates a detail report in online mode for tables and related objects, packages, and accelerated tables.

The detail report contains the same information as the report for the BET command and is available from the same panels.

Restriction: The DET primary command is available for only the following table types:
  • C: Clone table
  • G: Created global temporary table
  • H: History table
  • P: Implicit table that was created for XML columns
  • Start of changeR: Archive tableEnd of change
  • T: Table
  • X: Auxiliary table
End of change
DIS   Generates a Db2 command to display information for all listed objects. This command is valid only when databases, table spaces, or indexes are displayed.
DISABLE   Disables the table for acceleration.
Start of changeDISPINFOEnd of change   Start of changeDisplays additional information (replication status and row count) for the table.End of change
DISPOPT   Displays criteria to filter the list of accelerated tables.
Start of changeDISPREFEnd of change   Start of changeRestores the original display on the Display Accelerated Tables (ADBPZAT) panel.End of change
DROP   Drops all of the listed objects.

You are prompted to confirm this DROP operation before it is executed.

DSTAT   Displays Db2 statistics for the selected page sets.
EDIT   Enables editing of the objects that are listed in a panel.
ENABLE   Enables the table for acceleration.
EXPLSTMTCACHE   Extracts EXPLAIN records for all cached statements into the DSN_STATEMENT_CACHE_TABLE table.
EXPORT   Exports the multi-target change information to a file on the target system.
EXPRESSION   Creates a new key-expression.

You can create multiple expressions. This command is available only the Create Index (ADB21XAR) panel.

Start of changeEXTENTSEnd of change   Displays the estimated number of extents needed.
EXTERNAL   Toggles to a view which includes the External Name column.
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.
FREEALL   Frees all stabilized dynamic queries.
FREEINV   Frees all invalid stabilized dynamic queries.
FREEINVCOPY   Frees only copies of stabilized dynamic queries that are invalid.
GEN   Generates SQL for the objects from the Db2 catalog.
GRANT   Generates a GRANT statement for all objects that are listed. The GRANT command is useful on authorization panels when copying authorizations from one user to one or more other users.

This command is valid only when the values in the Grantee column are the same and one of the following types of objects are displayed: databases, tables, views, aliases, packages, plans, sequences, stored procedures, user-defined functions, user-defined data types, or authorizations.

HASH   Enables fast access to a row by hashing a key value and storing the hash value in a unique index.
HINT   Switches panel format to show hint IDs and hints used.
INCCOPY CI Creates an incremental copy (COPY FULL NO) of all objects in the list.
INCCOPYALL CIA Runs COPY FULL NO on all partitions in a single step.
INDEX   Switches panel format to show index name and schema.
JOBINFO   Displays JOBNAME and TIME STARTED values for utility jobs.
LASTPG   Displays the last logical page of statistics for the selected page sets.
LIKE   Switches the LIKE operator ON or OFF for search criteria. This command is valid only on the System Catalog (ADB21) panel.
LOAD   Loads or reloads data into a table.
LONGNAMES   Displays column names of 30 characters.

Use the LONGNAMES and the SHORTNAMES commands to toggle between 30-character and 18-character column names on the panel.

MAKEPBG   Converts the table space to a parition-by-growth (PBG) table space.

This command initializes input fields Numparts=0 and Max Partitions>0 to allow the conversion to a PBG table space.

MAKEPBR   Converts the table space to a parition-by-range (PBR) table space with absolute page numbering.

This command initializes input fields Numparts>0, Max Partitions=0, and SEGSIZE>0 to allow the conversion to a PBR table space with absolute page numbering.

MAKEPBR2   Converts the table space to a parition-by-range (PBR) table space with relative page numbering.

This command initializes input fields Numparts>0, Max Partitions=0, SEGSIZE>0, and PAGENUM=R to allow the conversion to a PBR table space with relative page numbering.

MIG   Migrates the displayed objects. This command is valid only when databases, table spaces, or tables are displayed.
Start of changeMOVETBEnd of change   Moves tables from multi-table table spaces to partition-by-growth (PBG) universal table spaces (UTS).
NEXT   Move to the next panel or generate a batch job.
NEXTCOL   Saves changes for the current column and moves to the next updatable table column.
OBJAUTH   Switch panel format to show system object authorizations.
ORIGINAL   Restores values to their existing state.
PACKAGES   List the packages that are affected by moving the tables.
PLANMGMT   Displays the plan management attributes for the packages.
QUALIFIER   Displays the qualifier for the packages.
RE-SORT   Re-sorts the table to its original sequence.
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.

REFRTS   Retrieves current real-time statistics for all objects in the list.
REORG O Runs the REORG utility on all objects in the list.
REORGALL OA Runs the REORG utility on all partitions in a single step.
REP   Generates a batch job that produces a printable report of the objects in the Db2 catalog.
RESET   Clears or deselects the list.
RESTORE   Restores objects or settings.

When RESTORE is issued on the Restore Partitions (ADBP1ARC) panel, the selected archived partitions are restored.

RESZ   Generates jobs to resize page sets.
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 want to execute the command because of the significant impact of the REVOKE command.
Start of changeRMIMPLEnd of change   Removes rows that represent implicit grants so that only explicitly granted authorizations are displayed. Implicit grants are grants where Grantor is the same as Grantee or GT (Grantee type) is P.

To restore the display to include the implicit grants again, use the REFRESH command.

RO   Restore packages using the original DBRM.
ROTATE   Rotates a partition.
RR   Restore packages using the regenerated DBRM.
RTS   Displays real-time statistics for the tables listed on the panel.
RTSO   Displays real-time statistics for the tables listed on the panel using the user-defined options.
RUNSTATS R Runs the RUNSTATS utility on all objects in the list.
RUNSTATSALL RA Runs the RUNSTATS utility on all partitions in a single step.
SHORTNAMES   Displays column names of 18 characters.

Use the LONGNAMES and the SHORTNAMES commands to toggle between 30-character and 18-character column names on the panel.

SPACE   Shows the amount of space (in KB) that is used for the VSAM page set.
STA   Generates a Db2 command to start all listed objects. This command is valid only when databases, table spaces, or indexes are displayed.
STARTTRACE   Starts a performance trace with IFCID 316, 317 or 318 and enable extraction of EXPLAIN records for all cached statements.
STO   Generates a Db2 command to stop all listed objects. This command is valid only when databases, table spaces, or indexes are displayed.
STOPGROUP   Stops all active capture monitors on all members of the data sharing group.
STOPLOCAL   Stops all active capture monitors on the local subsystem.
SYSAUTH   Switch panel format to show system authorizations.
TABLE   Switches panel format to show table name and schema.
TBLOPTS   Allows you to modify additional table attributes and specify period definitions for the table. You make these modifications on the Alter - Table Options (ADBP7TOP) panel.
TU   Changes the use of Db2 templates.
WSLOPT   Set work statement list (WSL) options.
UTIL   Generates utility JCL for the table spaces in all of the listed databases.
UO   Modifies utility options.
VALUES   Displays current LIMITKEY values for each partition.
VDEF   Displays VSAM definitions for the selected page sets.
VERSION   Toggles to a view which includes the Version and A (Active) columns
VERSIONS   Displays the package version, bind timestamp, and consistency token.
VSTAT   Displays VSAM statistics.
XSPACE   Displays the index space names.
ZOOM   Collapses or expands a section or all sections.