DB2 Server for VSE & VM: Operation


DB2 Server for VSE & VM Tracing

The trace facility lets you trace functions and subcomponents at varying levels of detail. If tracing is active, the database manager writes trace records to an output file, or to memory and then to an output file, whenever execution reaches an internal trace point.

After tracing is complete, you can use the trace formatter supplied with the database manager to select, format, and display or print records from the trace file. Refer to Formatting DB2 Server for VM Trace Output and Formatting DB2 Server for VSE Trace Output for descriptions of the trace formatter.

To use tracing, you must:

  1. Ensure that your job control to start the application server contains statements that identify the trace output file.
  2. Decide what functions and subcomponents you would like to trace, and at what level of detail.
  3. Start the trace.

Specifying CMS FILEDEF for a DB2 Server for VM Trace

The trace output file is usually on tape, and is created with IBM standard (EBCDIC) tape labels as a default. You can, however, direct tracing to a CMS file as described later in this chapter. IBM provides an application program, the trace formatter, to select and print trace records from the trace file.

The trace facility requires a CMS FILEDEF command for the trace output file. A FILEDEF command for standard label tape processing is provided in the SQLSTART EXEC. You can override the supplied FILEDEF command by issuing your own FILEDEF command before invoking the SQLSTART EXEC. You must specify the PERM option on your CMS FILEDEF commands if you are running single user mode and the program is written in a language other than Assembler.

The trace file can be a standard labeled tape or unlabeled tape or a CMS file. If the trace tape file is to be multivolume, you must use standard labels. The SQLSTART EXEC does not enter a CMS LABELDEF command. The SQLSTART EXEC specifies standard label (SL) processing on the FILEDEF command. If you want to change the tape label processing, enter appropriate CMS FILEDEF and LABELDEF commands before you enter SQLSTART. You must ensure that the ddname for both the FILEDEF and LABELDEF is ARITRAC. For more information on DB2 Server for VM tape support, refer to the DB2 Server for VM System Administration manual. For more information about tape label processing in CMS, refer to the VM/ESA: CMS User's Guide manual.

Specifying Job Control for a DB2 Server for VSE Trace

The output of the trace can be directed to either tape or disk.

To direct the output to tape, include a TLBL statement in your job control for generating a trace. Omit any ASSGN statement for the trace tape unit. The database manager dynamically assigns and unassigns the trace tape unit.

The database manager creates a trace output file on tape with IBM* standard (EBCDIC) tape labels. A block size of 4096 bytes is used.

An example of a TLBL statement for a trace output file is as follows:



// TLBL ARITRAC,'TRACE.FILE2'
Note:The TLBL statement must have the file name parameter specified as ARITRAC. All other parameters are optional.

The trace tape is never rewound except at end-of-volume.

To direct the output to disk, you need a DLBL, an EXTENT, and an ASSGN statement. If the file is managed by the VSE/VSAM Space Management for SAM Feature, the EXTENT statement may be optional, and the ASSGN statement is not applicable. In any case, the file name on the DLBL statement must be ARITRAC.

When the database manager is tracing to DASD, it uses a block size of 4088 bytes for the trace file.

The following is an example of the required job control for a trace output DASD SAM file (not managed by VSAM).



// DLBL ARITRAC,'TRACE.FILE1'
// EXTENT ,VSER01,1,0,301,120
// ASSGN SYS007,195

Notes:

  1. The DLBL file name must be ARITRAC.

  2. The DASD allocation (301,120) is 4 cylinders on 3350 volume VSER01 starting at cylinder 10. The volume is on disk drive 195.

  3. If you run the tracing more than once, you have to specify a new DASD allocation each time unless you want to write over the old file. (You should also specify a different file-id.)

  4. This example uses the default symbolic unit for DB2 Server for VSE DASD output (SYS007).

    If you do not want to use the default symbolic unit (SYS007), you must specify the desired symbolic unit as the first EXTENT parameter and in the ASSGN statement. If you are also using the DB2 Server for VSE & VM accounting facility with output to DASD, either the trace or the accounting file must be directed to a symbolic unit other than SYS007.

The following is an example of the job control required for a trace output DASD SAM file that is managed by the VSE/VSAM Space Management for SAM Feature.



// DLBL ARITRAC,'TRACE.FILE1'0,VSAM,DISP=(OLD,KEEP),           C
               RECORDS=1000,RECSIZE=4088
// EXTENT ,VSER01
Note:Unlike standalone SAM, the VSE/VSAM Space Management for the SAM feature lets you extend the file. It also automatically provides secondary space allocation should you exceed the primary allocation. You can monitor the actual space usage in the file by using the VSAM Access Method Services.
  1. The DLBL file name must be ARITRAC.
  2. The DLBL parameter "VSAM" indicates that this is a VSAM-managed file.
  3. The example assumes you wish to implicitly define the file to VSAM the first time that the file is accessed.
  4. DISP=(OLD,KEEP) indicates that the file is not to be reset at OPEN time (OLD), and is not to be deleted at CLOSE time (KEEP). This allows you to implicitly define the file the first time the file is used. It also lets you extend the file (add records to it) in subsequent runs of the application server.
  5. VSAM uses the RECORDS and RECSIZE parameters when it is implicitly defining the files. The parameters help VSAM determine how much primary and secondary space to allocate for the file.

    In this example, the primary allocation is about 4 million bytes (1000 x 4088). The secondary allocation is about 20% of the primary allocation.

    You should always set RECSIZE to 4088 because the database manager uses VB records with a block size of 4088 when tracing to disk.

  6. Note that VSE/VSAM allows up to 15 secondary allocations to the file if the primary allocation is filled.
  7. An EXTENT statement with the volume serial number (VSER01 in this example) is normally required for implicit define.
  8. No ASSGN statement is required for VSE/VSAM-managed files.
  9. This example omits the "DLBL CAT=" parameter. The example assumes that the file is in the VSAM job catalog.
  10. The VSAM catalog must own sufficient unallocated space on the specified volume to satisfy the space allocation requirements for this file.

Tracing in Multiple User Mode

In multiple user mode, you can start tracing using the following:

Note:If you specify the TRACDRRM or TRACWUM initialization parameters, you receive trace output only if you have users who are operating under the DRDA protocol.

The initialization parameters allow the later parts of initialization to be traced and do not require any operator command entry. The operator command TRACE ON allows tracing to be started at any time after initialization is complete. It also has options to trace only specified agents or a specified authorization ID.

Tracing can be stopped either by allowing the system to end (normally or abnormally) or by issuing the operator command TRACE OFF.

Tracing in Single User Mode

In single user mode, tracing can be started only through the TRACCONV, TRACDBSS, TRACDSC, TRACRDS, TRACSTG initialization parameters. Tracing is stopped only when the application server ends (normally or abnormally).

Tracing to a CMS File

The trace facility, as a default, directs its output to tape. You can, however, direct trace output to memory or to a CMS file. For more information on directing trace output to memory, see Starting a Trace or Appendix A, DB2 Server for VSE & VM Initialization Parameters.

You can direct trace output to a CMS file because the database manager uses the CMS simulation of OS QSAM to process the trace file, and CMS OS QSAM is device independent.

To trace to a CMS file, use the following CMS FILEDEF command before starting the application server.



FILEDEF ARITRAC DISK filename filetype filemode (PERM

Notes:

  1. The ddname for the trace file must be ARITRAC, as shown.

  2. The file mode letter can be any properly accessed CMS minidisk.

  3. The file mode number must be 4. This is required because the trace record format is CMS OS QSAM variable blocked (RECFM VB).

  4. You can always specify the PERM option. It is required if you are running the application server in single user mode, and the application program is written in a language other than the Assembler language.

After issuing the above CMS FILEDEF command, you can start the application server. As usual, depending on whether you are in single or multiple user mode, you can start tracing through the initialization parameters or through the TRACE operator command.

If you start tracing through the TRACCONV, TRACDBSS, TRACDRRM, TRACDSC, TRACRDS, TRACSTG, and TRACWUM initialization parameters, the application server prompts for the cuu of the trace tape. When tracing to a CMS file, specify in the cuu parameter the virtual device number of the CMS minidisk containing the trace file.

Similarly, if initiating tracing with the TRACE operator command, specify the virtual device number of the trace minidisk for the cuu parameter of the TRACE ON command.

Special Considerations for Multiple Activations of Tracing

If you do the following:

the trace CMS output file only contains the trace output of the second or last activation of tracing. This can be avoided in either of two ways:

If the trace fills the CMS minidisk on which the trace file resides, the following occurs:

When the application server is running with tracing active, and the system ends (normally or abnormally), the application server displays message ARI0099I if the trace file is successfully closed. The same situation results if the TRACE OFF command is entered. If this message is not displayed, the file has not been closed and some trace data has been lost.
Note:It is possible to enable tracing but produce no trace output, for example, when you trace only a specified authorization ID. In this situation, the file is opened and closed successfully, but no CMS file is created.

Tracing the DB2 Server for VSE Resource Adapter

See the DB2 Server for VSE & VM Database Administration manual for information on how to trace the VSE resource adapters.

Choosing the Functions to Be Traced

You can trace functions and subcomponents within the following components:

Data Conversion (CONV)
This component performs numeric data conversion and returns data to user host variables when the DRDA protocol is used. It is also responsible for performing data conversion on character and graphic data regardless of the protocol in use.

Database Storage Subsystem (DBSS)
This component is the storage manager. It provides locking mechanisms to ensure that multiple concurrent users do not interfere with each other. It also handles recovery, database I/O, and sorting.

Distributed Relational Resource Manager (DRRM)
This component interprets the data streams used in DRDA protocol. It builds (generates) DRDA data streams from DB2 Server for VSE & VM internal format and it translates (parses) DRDA data streams back into DB2 Server for VSE & VM internal format.

Data System Control (DSC)
This component enables communication. It controls the initialization and termination, and acts as the supervisor of the database machine or partition.

Relational Data System (RDS)
This component supports the relational model of data. It allows users to see data as though it exists in tables containing rows and columns. It also translates all SQL statements into specific tasks for the Database Storage Subsystem.

Storage (STG)
This component will enable tracing of both system and working storage used by DB2 Server for VSE & VM on the application server side.

Work Unit Manager (WUM)
This component controls the flow of DDM requests and replies when the DRDA protocol is used. It is the interface between the DRDA component DRRM and the non-DRDA components RDS and DSC.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]