Version 4.2.6 for Mainframes (Update)
 —  Database Management System Interfaces  —

Retrieval of System Tables

Important:
Before you use the Retrieval of System Tables function, refer to LISTSQL and Explain Functions in the section Special Requirements for Natural Tools for DB2.

The DB2 system tables provide information on the contents of your DB2 system. The Retrieval of System Tables function enables you to:

The DB2 objects supported by the Retrieval of System Tables function are database, tablespace, table, index, column, plan, check constraints, statistic tables, package, and DBRM (database request module), as well as access rights to and relationships between these objects.

DB2 objects are presented in one of the following two ways:

The most important browse commands can also be issued via PF keys; see Editing within the Natural Tools for DB2.

This section covers the following topics:


Invoking the Retrieval of System Tables Function

Start of instruction set To invoke the Retrieval of System Tables function

Top of page

List Databases

Start of instruction set To invoke the List Databases function

  1. On the Retrieval of System Tables screen, enter function code D.

  2. Specify the name of the database(s) to be listed.

      16:32:24              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
       DATABASES *                               S 01     Row 0 of 25 Columns 001 059
       ====>                                                        Scroll ===>  PAGE
          DATABASE CREATOR     STOGROUP BPOOL     DBID CREATEDBY ROSHARE TIMESTAMP GR  
       ** ******************************* top of data *******************************
       __ DEMO     DEFAULT     SYSDEFLT BP0        269 DEFAULT           0001-01-0>
       __ DEMODB   SAG2        SYSDEFLT BP0        273 SAG2              0001-01-0>D8
       __ DEVELOP  SAG         DEVELOP  BP0        260 SAG               0001-01-0>DB
       __ ECHDB01  SAG2        SYSDEFLT BP0        272 SAG2              0001-01-0>
       __ EFGDB    SAG         SYSDEFLT BP0        263 SAG               0001-01-0>
       __ HBUTST   SAG2        SYSDEFLT BP0        275 SAG2              0001-01-0>
       __ PLANTAB  SAG2        SYSDEFLT BP0        270 SAG2              0001-01-0>
       __ Predict  SAG2        SYSDEFLT BP0        262 SAG2              0001-01-0>
       __ QA       SAG2        SYSDEFLT BP0        265 SAG2              0001-01-0>
       __ SAGDB04  SYSIBM      SYSDEFLT BP0          4 SYSIBM            0001-01-0>
       __ SAGDB06  SYSIBM                            6 SYSIBM            0001-01-0>
       __ SAGDB07  SAG1        SYSDEFLT BP0          7 SAG1              0001-01-0>
       __ SAGDDF   SAG1        SYSDEFLT BP0        257 SAG1              0001-01-0>
       __ SAGRLST  SAG1        SYSDEFLT BP0        256 SAG1              0001-01-0>
       __ SAG8D22A SAG1        SAG8G220 BP0        258 SAG1              0001-01-0>
       __ SAG8D22P SAG1        SAG8G220 BP0        259 SAG1              0001-01-0>
                                                                                     
      Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
            Help        Exit        Rfind        -     +           <      >   Canc

    The following line commands are available on the database listing screen. Line commands are entered in front of the desired database(s):

    Command Description
    I Displays information on a database.
    S Selects a database to be used with main commands (see below).
    U Unselects a database.
    AU Displays information on access rights to a database.
    TB Displays all tables defined in a database.
    TS Displays all tablespaces defined in a database.

    The listings of tables or tablespaces displayed as a result of the TB or TS command can be used for further processing, whereas the contents of the screens displayed as a result of the AU or I command are for information purposes only.

    A list of all line commands available with the List Database function can be invoked as a window by entering the help character, that is, a question mark (?), in front of any of the listed databases.

    The commands AU, TB, and TS can also be used as main commands. Main commands are entered in the command line of the database list screen and apply to all databases previously selected with the line command S.

    A further main command is the INFO command, which is the equivalent of the I line command, but displays information on all previously selected databases. Instead of being displayed, all information resulting from the I or INFO commands can also be marked for printing. Even if already displayed, information can be printed by issuing the PRINT command.

      16:32:24              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
       DATABASES *                               S 01     Row 0 of 25 Columns 001 059
       ====>                                                        Scroll ===>  PAGE
          DATABASE CREATOR     STOGROUP BPOOL     DBID CREATEDBY ROSHARE TIMESTAMP GR
       ** **** +---------------------------------------------------------+ **********
       I_ DEMO !                                                         ! 01-01-0>
       __ DEMO !                 Select what to display                  ! 01-01-0>D8
       __ DEVE !                                                         ! 01-01-0>DB
       __ ECHD !                                                         ! 01-01-0>
       __ EFGD !                  _ authorizations for database          ! 01-01-0>
       __ HBUT !                  _ tablespaces in database              ! 01-01-0>
       __ PLAN !                  _ tables      in database              ! 01-01-0>
       __ PRED !                                                         ! 01-01-0>
       __ QA   !                                                         ! 01-01-0>
       __ SAGD !                                                         ! 01-01-0>
       __ SAGD !                 Mark  _ to print output                 ! 01-01-0>
       __ SAGD !                                                         ! 01-01-0>
       __ SAGD +---------------------------------------------------------+ 01-01-0>
       __ SAGRLST  SAG1        SYSDEFLT BP0        256  SAG1             0001-01-0>
       __ SAG8D22A SAG1        SAG8G220 BP0        258  SAG1             0001-01-0>
       __ SAG8D22P SAG1        SAG8G220 BP0        259  SAG1             0001-01-0>
                                                                                     
      Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
            Help        Exit        Rfind        -     +            <     >   Canc

    A list of all main commands available with the List Database function can be invoked as a window by entering the help character, that is, a question mark (?), in the command line of the database list screen.

Top of page

List Tablespaces

The function to list tablespaces is not part of the Retrieval of System Tables main menu.

Start of instruction set To list tablespaces

Top of page

List Plans

Start of instruction setTo invoke the List Plans function

Top of page

Commands Allowed on Plans

The following line commands are available on the plan listing screen. Line commands are entered in front of the desired plan(s):

Command Description
I Displays information on a plan.
S Selects a plan to be used with main commands.
U Unselects a plan.
AU Displays information on access rights to a plan.
DR Displays all DBRMs contained in a plan.
IX Displays all indexes used by a plan.
PK Displays the package list of a plan.
SY Displays the systems enabled or disabled for a plan.
TB Displays tables used in a plan.

The listing displayed as a result of the DR, IX, PK, or TB command can be used for further processing, whereas the contents of the screens displayed as a result of the I, AU, or SY command are for information purposes only.

A list of all line commands available with the List Plans function can be invoked as a window by entering the help character "?" in front of any of the listed plans.

The commands AU, DR, IX, PK, SY, and TB can also be used as main commands, which are entered on the command line of the plan listing screen and apply to all plans previously selected with the line command S.

The INFO main command, which is the equivalent of the I line command, displays information on the DBRMs and their SQL statements contained in the plans previously selected. As with the List Database function, information resulting from the I or INFO commands can be printed, too.

  16:37:59              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   PLAN *                                    S 01     Row 0 of 80 Columns 023 075
   ====>                                                        Scroll ===>  PAGE
      PLAN     CREATOR     VALIDATE ISO ACQUIRE REL VALID OPER EXPLAIN   PLSIZE
   ** **** +---------------------------------------------------------+ **********
   I_ CAFP !                                                         !     2472
   __ SAGE !                 Select what to display                  !     1992
   __ SAGE !                                                         !     1992
   __ SAGE !              _ DBRMs of plan                            !     1992
   __ SAGT !              _ package list of plan                     !     1992
   __ SAG8 !              _ systems enabled or disabled for plan     !     2296
   __ SAG8 !              _ tables  referenced in plan               !     4376
   __ SAG8 !              _ indexes used in plan                     !     4264
   __ SAG8 !              _ authorizations for plan                  !     2296
   __ SAGP !                                                         !     2648
   __ TREP !                 Mark  _ to print output                 !     2168
   __ TREP !                                                         !     4560
   __ TREP +---------------------------------------------------------+     8976
   __ TREPLANO SAG2        R        S   U       C   N     Y    N           8976
   __ TREPLANT SAG2        R        S   U       C   Y     Y    N           2472
   __ TREPLAN1 SAG2        R        S   U       C   N     Y    N           3248
                                                                                 
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
        Help        Exit        Rfind        -     +           <     >    Canc

A list of all main commands available with the List Plans function can be invoked as a window by entering the help character, that is, a question mark (?), in the command line of the plan list screen.

DBRMs of Plan

If you issue the DR command on the plan listing screen, a list of all DBRMs bound into the selected plan(s) is displayed.

  16:40:56              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   DBRMS OF PLAN SAGTEST                     S 02      Row 0 of 3 Columns 033 075
   ====>                                                        Scroll ===>  PAGE
      PLAN     DBRM     TIMESTAMP    CREATOR  TIME     DATE     PDS NAME QUOTE CO
   ** ******************************* top of data *******************************
   __ SAGTEST  TEST1    148C251A1>   SAG      16:24:10 07-10-05 DB2.V42.>N     N
   __ SAGTEST  TEST2    148C251A1>   SAG      16:24:42 07-10-05 DB2.V42.>N     N
   __ SAGTEST  TEST3    148C251A1>   SAG      16:25:15 07-10-05 DB2.V42.>N     N
   ** ***************************** bottom of data ******************************

Commands Allowed on DBRMs

The following line commands are available on the DBRM listing screen. Line commands are entered in front of the desired DBRM(s):

Command Description
I Displays information on a DBRM.
S Selects a DBRM to be used with main commands.
U Unselects a DBRM.

A list of all line commands available on the DBRM listing screen can be invoked as a window by entering the help character, that is, a question mark (?), in front of any of the listed DBRMs.

The only main command that applies to DBRMs is the INFO command, which is the equivalent of the I line command, but displays information on all previously selected DBRMs. Instead of being displayed, all information resulting from the I or INFO commands can also be marked for printing. Even if already displayed, information can be printed by issuing the PRINT command.

  16:40:56              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   DBRMS OF PLAN SAGTEST                     S 02      Row 0 of 3 Columns 033 075
   ====>                                                        Scroll ===>  PAGE
      PLAN     DBRM     TIMESTAMP    CREATOR  TIME     DATE     PDS NAME QUOTE CO
   ** **** +---------------------------------------------------------+***********
   I_ SAGT !                                                         ! .>N     N
   __ SAGT !                 Select what to display                  ! .>N     N
   __ SAGT !                                                         ! .>N     N
   ** **** !                                                         !***********
           !                                                         !           
           !                  _ Plans referencing DBRM               !           
           !                  _ SQL statements of DBRM               !           
           !                                                         !           
           !                                                         !           
           !                                                         !           
           !                 Mark  _ to print output                 !           
           !                                                         !           
           +---------------------------------------------------------+           
                                                                                 
                                                                                 
                                                                                 
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
        Help        Exit        Rfind        -     +           <     >    Canc

Indexes Used in Plan

If you issue the IX command on either the plan listing screen or the table listing screen, a list of all indexes used in the selected plan(s) or table(s) is displayed.

  16:40:56              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   INDEXES OF PLAN SAGTEST                   S 02      Row 0 of 3 Columns 033 075
   ====>                                                        Scroll ===>  PAGE
      CREATOR  INDEX NAME    CREATOR  TABLE NAME COLCNT UNIQ CLSTRNG CLSTRD -RATI 
   ** ******************************* top of data *******************************
   __ SAGCRE   XDEPT1        SAGCRE   DEPT            1 P    N       Y         10
   __ SAGCRE   XEMP1         SAGCRE   EMP             1 P    Y       Y         10
   __ SAGCRE   XEMP2         SAGCRE   EMP             1 D    N       N          4
   ** ***************************** bottom of data ******************************

Commands Allowed on Indexes

The following line commands are available on the index listing screen. Line commands are entered in front of the desired index(es):

Command Description
I Displays information on an index.
S Selects an index to be used with main commands.
U Unselects an index.
CO Displays all columns of an index.
PT Displays the partitions of an index.

The listings of columns displayed as a result of the CO or PT command cannot be used for further processing. Like the display resulting from the I command, they are for information purposes only.

A list of all line commands available on the index listing screen can be invoked as a window by entering the help character "?" in front of any of the listed indexes.

The commands CO and PT can be used as main commands, too, and entered in the command line of the index listing screen. If so, all columns of all indexes previously selected with the line command S are displayed.

A further main command is the INFO command, which is the equivalent of the line command I, but displays information on all previously selected indexes. Instead of being displayed, all information resulting from the I or INFO commands can also be marked for printing. Even if already displayed, information can be printed by issuing the PRINT command.

  16:40:56              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   INDEXES OF PLAN SAGTEST                   S 02      Row 0 of 3 Columns 033 075
   ====>                                                        Scroll ===>  PAGE
      CREATOR  INDEX NAME    CREATOR  TABLE NAME COLCNT UNIQ CLSTRNG CLSTRD -RATI 
   ** **** +---------------------------------------------------------+ **********
   I_ SAGC !                                                         !         10
   __ SAGC !                 Select what to display                  !         10  
   __ SAGC !                                                         !          4  
   ** **** !                                                         ! **********
           !                  _ columns  of index                    !           
           !                  _ portions of index                    !           
           !                  _ plans using index                    !           
           !                  _ packages using index                 !           
           !                                                         !           
           !                                                         !           
           !                 Mark  _ to print output                 !           
           !                                                         !           
           +---------------------------------------------------------+           
                                                                                 
                                                                                 
                                                                                 
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
        Help        Exit        Rfind        -     +           <     >    Canc

A list of all main commands available on the index listing screen can be invoked as a window by entering the help character "?" in the command line of the screen.

Package List of Plan

If you issue the PK command on the plan listing screen, a list of all entries in the package list of the selected plan(s) is displayed.

  16:40:56              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   PACKAGE LIST FOR PLAN SAGTEST             S 02      Row 0 of 3 Columns 033 075
   ====>                                                        Scroll ===>  PAGE
      PLANNAME LOCATION COLLID      NAME     SEQNO  TIMESTAMP IBM
   ** *********************** top of data ************************
   __ SAGTEST           SAGCOLLE>   *            1  2007-10-0>N
   __ SAGTEST           SAG_STAT>   *            2  2007-10-0>N
   ** ***************************** bottom of data ***************

Commands Allowed on Package List Entries

The following line commands are available on the package list screen. Line commands are entered in front of the desired package list entry:

Command Description
I Displays information on a package list entry.
S Selects a package list entry to be used with main commands.
U Unselects a package list entry.
PK Displays all packages of a package list entry.

The listing of packages as a result of the PK command can be used for further processing, whereas the display resulting from the I command is for information purposes only.

A list of all line commands available with a package list can be invoked as a window by entering the help character, that is, a question mark (?), in front of any of the listed entries.

The command PK can also be used as main command, which is entered in the command line of the above screen and applies to all package list entries previously selected with the line command S.

Top of page

List Packages

Start of instruction setTo invoke the List Packages function

Commands Allowed on Packages

The following line commands are available on the package listing screen. Line commands are entered in front of the desired package(s):

Command Description
I Displays information on a package.
S Selects a package to be used with main commands.
U Unselects a package.
AU Displays information on access rights to a package.
IX Displays all indexes used by a package.
SY Displays all systems enabled or disabled for a package.
TB Displays all tables used by a package.

The listings of indexes or tables displayed as a result of the IX or TB command can be used for further processing, whereas the displays resulting from the AU, SY, or I command are for information purposes only.

A list of all line commands available with the List Packages function can be invoked as a window by entering the help character, that is, a question mark (?), in front of any of the listed packages.

The commands AU, IX, SY, and TB can also be used as main commands, which are entered in the command line of the table listing screen and apply to all tables previously selected with the line command S.

The INFO main command, which is the equivalent of the I line command, displays information on all tables previously selected. All information resulting from the I or INFO commands can also be printed.

  11:06:11              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   PACKAGE *.*                               S 01    Row 34 of 65 Columns 041 075
   ====>                                                        Scroll ===>  PAGE
      COLLID   NAME        CONTOKEN CONTOKEN (HEX) OWNER    CREATOR  QUALIFIER  
   i_ SAGQ +---------------------------------------------------------+ G      
   __ SAGQ !                                                         ! G      
   __ SAGQ !                 Select what to display                  ! G      
   __ SAGQ !                                                         ! G      
   __ SAGQ !           _ systems enabled or disabled for package     ! G      
   __ SAGQ !           _ tables  referenced in package               ! G      
   __ SAGQ !           _ indexes used in package                     ! G      
   __ SAGQ !           _ statements of package                       ! G      
   __ SAGQ !           _ authorizations on package                   ! G      
   __ SAGQ !                                                         ! G      
   __ SAGQ !                                                         ! G      
   __ SAGQ !                 Mark  _ to print output                 ! G      
   __ SAGQ !                                                         ! G      
   __ SAGQ +---------------------------------------------------------+ G      
   __ SAGQCATV SAGQVTBC    ?   ?d ? 148C40BD1684EC>SAG      SAG      SAG
   __ SAGQCATV SAGQVTBP    ?   ?    148C40BF07AE9D>SAG      SAG      SAG
   __ SAGQCATV SAGQVTBS    ?     ?? 148C40CA034928>SAG      SAG      SAG
                                                                                 
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
        Help        Exit        Rfind        -     +           <     >    Canc

A list of all main commands available with the List Packages function can be invoked as a window by entering the help character, that is, a question mark (?), in the command line of the packages list screen.

Top of page

List Tables

Start of instruction set To invoke the List Tables function

Commands Allowed on Tables

The following line commands are available on the table listing screen. Line commands are entered in front of the desired table(s):

Command Description
I Displays information on a table.
S Selects a table to be used with main commands.
U Unselects a table.
AU Displays information on access rights to a table.
CO Displays all columns of a table.
IX Displays all indexes on a table.
CC Checks constraints.

The listings of indexes displayed as a result of the IX command can be used for further processing, whereas the listings of columns resulting from the CO command, as well as the displays resulting from the AU or I command, are for information purposes only.

A list of all line commands available with the List Tables function can be invoked as a window by entering the help character, that is, a question mark (?), in front of any of the listed tables.

The commands AU, CO, and IX can also be used as main commands, which are entered in the command line of the table listing screen and apply to all tables previously selected with the line command S.

The INFO main command, which is the equivalent of the I line command, displays information on all tables previously selected. All information resulting from the I or INFO commands can also be printed.

  16:42:58              ***** NATURAL TOOLS FOR DB2 *****             2007-10-05
   TABLE SAG*.*                              S 01   Row 34 of 361 Columns 036 075
   ====>                                                        Scroll ===>  PAGE
      CREA +---------------------------------------------------------+          C
   ** **** !                                                         ! **********
   I_ SAGC !                                                         !   
   __ SAGC !                 Select what to display                  ! S2
   __ SAGC !                                                         ! S2
   __ SAGC !  _ columns  of table/view    _ referential constraints  ! S2
   __ SAGC !  _ synonyms of table/view    _ authorized  users        ! S2
   __ SAGC !  _ plans    using table/view                            ! S2
   __ SAGC !  _ packages using table/view _ indexes  of table        ! S2
   __ SAGC !  _ views    using table/view _ columns  of indexes      ! RO
   __ SAGC !  _ base tables of view       _ plans using indexes      ! S2
   __ SAGC !  _ definition  of view       _ packages using indexes   ! S2
   __ SAGC !  _ check conditions of table                            !   
   __ SAGC !                                                         ! AC
   __ SAGCR!                 Mark  _ to print output                 ! S2
   __ SAGCR+---------------------------------------------------------+ S2
   __ SAGCRE   TOPTVAL       T          11       0    354 SAG8D22P SAG8S2
   __ SAGCRE   VACT          V           3       0      0 SAG8D22A ACT   
                                                                                 
  Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
        Help        Exit        Rfind        -     +           <     >    Canc

A list of all main commands available with the List Tables function can be invoked as a window by entering the help character, that is, a question mark (?), in the command line of the table listing screen.

Top of page

User Authorizations

Start of instruction set To invoke the User Authorization function

Top of page

List Statistic Tables

Start of instruction set To invoke the List Statistic Tables function

Top of page