Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

10.1.5 Command trace facility

The command trace facility outputs a client's trace information to the command trace file when a command is executed by a UAP (during the execution of the COMMAND EXECUTE SQL statement).

When the command trace file becomes full, the facility overwrites the oldest information.

Organization of this subsection
(1) How to obtain command trace information
(2) Interpreting command trace information
(3) Backing up the command trace file

(1) How to obtain command trace information

You can obtain command trace information by specifying appropriate values in PDCLTPATH and PDCMDTRACE in the client environment definitions. For details about each client environment definition, see 6.6 Client environment definitions (setting environment variables).

Two command trace files named pdccmd1.trc and pdccmd2.trc are output to the specified directory.

(2) Interpreting command trace information

Command trace information is output when a command is executed by a UAP. The following shows sample command trace information and explains each item:

Output example
** COMMAND TRACE (CLT:06-00:Jan 11 2001) HP32 **  [1]
 
  USER APPLICATION PROGRAM FILE NAME : TESTAP  [2]
  COMMAND START TIME : 2001/01/11 10:55:27  [3]
  COMMAND EXECUTE ENVIRONMENT & STATUS :  [4]
    PDASTHOST(dcm3500)
    PDASTPORT(20266)
    PDSYSTEMID("HRD1")
    PDUSER("hirdb")
    PDASTUSER("hirdb ")
    PDCMDWAITTIME(0)
    ENVGROUP("")
    CLTPID(9155) CLTTID(0)
  [5]  [6]    [7]        [8]    [9]
  9155  0  2001/01/11 10:55:27   0  pdhold -r RDDATA01
  9155  0  2001/01/11 10:55:27   1  KFPZ02444-E Communication error,
                                    func=connect, errno=2

Explanation
  1. Command trace header
    The header contains the following information:
    • Version of the linked library
    • Library creation date (in the format Mmm dd yyyy)
    • Platform in use (For details about the character strings that are displayed for the platforms, see the Explanation section in 10.1.1(2) Examining SQL trace information.)
  2. UAP name
    This is the value of PDCLTAPNAME specified in the client environment definition.
  3. Command start date and time
    This is the date and time the command execution began.
  4. Command execution environment and status
    This is the value of the client environment definition and status during command execution.
  5. UAP process number
    This is the UAP process number. If the correct process number cannot be obtained, an invalid value may be displayed (Windows).
  6. UAP thread number
    If the UAP is running with multi-thread, this indicates the UAP thread number; otherwise, a value of 0 is displayed. Note that the facility may display an invalid numeric value if it is unable to obtain the correct thread number.
  7. Command trace acquisition date and time
    This is the date and time the command trace information was acquired.
  8. Command trace counter
    This is the count that was incremented each time a command trace was accepted. The value range is from 0 to 65535.
  9. Trace data
    This is the trace data.

(3) Backing up the command trace file

If the command trace file becomes full while writing command trace information, HiRDB continues output using another command trace file. In this case, existing contents of the command trace file are overwritten, beginning with the oldest information. Therefore, you should make a backup copy of a command trace file when the UAP is terminated.

To determine the command trace file that is being used currently, check the most recent update dates/times of the files. The command trace file that was updated most recently is the current file.

For a Windows version HiRDB client, you use the dir command or the Explorer to check the file update dates/times.

For a UNIX version HiRDB client, you use the OS's 1s -1 command to check the file update dates/times.