DB2 Environment Commands

 <  Day Day Up  >  

DB2 environment commands usually are issued either through the DB2I ISPF panels or by batch TSO under the control of the DSN command. However, they can be issued from an MVS console, from IMS/TM using the specialized command /SSR , or from CICS using the specialized CICS command DSNC . The DB2 environment commands can be used to monitor and control DB2 databases, resources, and processing. There are three types of environment commands:

  • Information gathering commands

  • Administrative commands

  • Environment control commands

All DB2 environment commands have a common structure, as follows :

 

  cp  command operand 

The cp is the command prefix assigned when DB2 is installed. The command prefix identifies a single DB2 subsystem, targeting the command as a DB2 command for a specific DB2 subsystem. The command prefix is built from a combination of the subsystem recognition character concatenated to the DB2 subsystem name . Prior to DB2 V4, only the single character subsystem recognition character was available to identify subsystems. The multi-character command prefix enables more meaningful names to be used. A subsystem recognition character is assigned when DB2 is installed. The default recognition character is a hyphen, but it can be changed by each installation depending on the environment from which the command is issued. The following characters can be used as subsystem recognition characters :

¢

+

;

?

.

-

:

<

!

/

#

(

$

,

@

*

)

%

"

'

=

   

A sample DB2 command might be

 

 -DB2A DISPLAY DATABASE(DSNDB07) 

The command specifies that the DSNDB07 database in the DB2A subsystem is to be displayed.

The command portion of the environment command is the DB2 command verb. The operand is the combination of optional and required keywords and values necessary to successfully issue the command.

Figure 36.1 shows a DB2 environment command, -DISPLAY DATABASE , issued through option 7 of the DB2I panel. The response to that command is shown in Figure 36.2. Listing 36.1 is the JCL needed to issue the same command in a batch job.

Listing 36.1. JCL to issue I DB2 Command in Batch
 //DB2JOBC  JOB (COMMAND),'DB2 COMMAND SQL',MSGCLASS=X,CLASS=X, //          NOTIFY=USER //* //**************************************************************** //* //*        JCL TO ISSUE DB2 COMMAND //* //**************************************************************** //* //JOBLIB DD DSN=DSN810.DSNEXIT,DISP=SHR //       DD DSN=DSN810.DSNLOAD,DISP=SHR //BATCHCOM EXEC PGM=IKJEFT01,DYNAMNBR=20 //SYSTSPRT DD  SYSOUT=* //SYSPRINT DD  SYSOUT=* //SYSUDUMP DD  SYSOUT=* //SYSTSIN  DD  *    DSN SYSTEM(DSN)    - DISPLAY DATABASE (DSNDB06)    END /* // 

Figure 36.1. Issuing a DB2 command through DB2I.
graphics/36fig01.gif

Figure 36.2. Response to the DB2 command issued in Figure 36.1.

graphics/36fig02.gif


The three types of DB2 environment commands are presented in the following sections.

 <  Day Day Up  >  


DB2 Developers Guide
DB2 Developers Guide (5th Edition)
ISBN: 0672326132
EAN: 2147483647
Year: 2004
Pages: 388

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net