Previous Topic Next topic Print topic


Creating a CTF Trace for DB2 LUW Stored Procedures

Use this procedure to get a CTF trace for a PL/I DB2 stored procedure.

  1. Create a CTF configuration file with appropriate commands. For example:

    Windows:

    ## MFTRACE configuration file
    mftrace.emitter.textfile#Format = $(TIME) $(COMPONENT) $(EVENT) $(LEVEL) :$(DATA)
    mftrace.dest=textfile
    mftrace.emitter.binfile#location=c:\ctflogs
    mftrace.emitter.textfile#location=c:\ctflogs
    #  CTF Configuration Starting point for Open PLI Problem Determination
    #  (Maximum amount of Open PL/I CTF tracing  )#
    mftrace.emitter.es#level = 9999
    # Maximum file size in "k" bytes
    mftrace.emitter.textfile#MaxFilesize = 26000
    # Maximum number of log files to keep.
    mftrace.emitter.textfile#MaxGeneration = 6
    ################################################
    # PL/I RTS Tracing
    ################################################
    mftrace.level.mf.rts                    = info
    mftrace.comp.mf.rts#api                 = true
    mftrace.comp.mf.rts#syspgm              = true
    mftrace.comp.mf.rts#pgm                 = true
    mftrace.level.mf.rts.pli                = debug
    mftrace.comp.mf.rts.pli#all             = true
    mftrace.level.mf.pli.macropp            = info
    mftrace.comp.mf.pli.macropp#compsrc     = true

    UNIX:

    ## MFTRACE configuration file
    mftrace.emitter.textfile#Format = $(TIME) $(COMPONENT) $(EVENT) $(LEVEL) :$(DATA)
    mftrace.dest=textfile
    mftrace.emitter.binfile#location=/tmp/ctflogs
    mftrace.emitter.textfile#location=/tmp/ctflogs
    #  CTF Configuration Starting point for Open PLI Problem Determination
    #  (Maximum amount of Open PL/I CTF tracing  )#
    mftrace.emitter.es#level = 9999
    # Maximum file size in "k" bytes
    mftrace.emitter.textfile#MaxFilesize = 26000
    # Maximum number of log files to keep.
    mftrace.emitter.textfile#MaxGeneration = 6
    ################################################
    # PL/I RTS Tracing
    ################################################
    mftrace.level.mf.rts                    = info
    mftrace.comp.mf.rts#api                 = true
    mftrace.comp.mf.rts#syspgm              = true
    mftrace.comp.mf.rts#pgm                 = true
    mftrace.level.mf.rts.pli                = debug
    mftrace.comp.mf.rts.pli#all             = true
    mftrace.level.mf.pli.macropp            = info
    mftrace.comp.mf.pli.macropp#compsrc     = true
    See the help topic "Configuration File for CTF" for more information on creating a CTF configuration file.
  2. Open a DB2 administrative command prompt and stop DB2 LUW by issuing one of these commands:
    db2stop
    or
    db2stop FORCE
  3. Enable CTF by setting the MFTRACE_CONFIG environment variable to the configuration file you just created. For example:

    Windows:

    SET MFTRACE_CONFIG=C:\CTFLOGS\CHKCTF.CFG

    UNIX:

    MFTRACE_CONFIG=/tmp/CHKCTF.CFG
    export MFTRACE_CONFIG
    
  4. Restart DB2 LUW by executing this command in a DB2 administrative command prompt:
    db2start
  5. Run program that calls the PL/I DB2 stored procedure.

    A CTF trace file generates, and the trace filename starts with the characters db2fmp.

Previous Topic Next topic Print topic