Obtaining SQL Statements Querying the MCPSQL Database

The MCPSQL diagnostic software can be used to obtain a list of SQL statements that have queried the MCPSQL database under a specific worker identifier.

To obtain a list of SQL statements that have queried the MCPSQL database under a specific worker identifier, do the following:

  1. Create the UNISYSDB/INI file with the following specifications:

    Note: For more information on the UNISYSDB/INI file, see “Creating an Initialization File.”
    [UnisysDBTrace]
    TraceFile = UNISYSDB/TRACE
    TraceEnable = 1
    TraceLevel = 2
    ProgramDump = 0

    A file is created under the TraceFile setting on the <default family>. The file name is appended with the worker identifier for the query. For example, if the worker identifier for the query is mix number 3414, the file is called:

    UNISYSDB/TRACE-3414 
  2. Using a text editor such as CANDE, search the trace file for szSqlStr.

    All SQL statements that have queried the MCPSQL database under the specific worker identifier are listed.

    For example, in the UNISYSDB/TRACE-3414, the following lines were found:

    - In    : szSqlStr = SELECT * FROM JJDS WHERE ANBR1>5
    - In    : szSqlStr = SELECT * FROM JJDS WHERE ANBR1<1022
    

    Your trace file might contain more SQL statements, depending on the activity of your application.