Sample user exit programs

Sample user exit programs are provided for all supported platforms. You can modify these programs to suit your particular requirements. The sample programs are well commented with information that will help you to use them most effectively.

You should be aware that user exit programs must copy log files from the active log path to the archive log path. Do not remove log files from the active log path. (This could cause problems during database recovery.) Db2® removes archived log files from the active log path when these log files are no longer needed for recovery.

Following is a description of the sample user exit programs that are shipped with Db2 Data Server.

  • UNIX operating systems

    The user exit sample programs for Db2 Data Server for UNIX operating systems are found in the sqllib/samples/c subdirectory. Although the samples provided are coded in C, your user exit program can be written in a different programming language.

    Your user exit program must be an executable file whose name is db2uext2.

    There are four sample user exit programs for UNIX operating systems:

    • db2uext2.ctsm

      This sample uses Tivoli® Storage Manager to archive and retrieve database log files.

    • db2uext2.ctape

      This sample uses tape media to archive and retrieve database log files .

    • db2uext2.cdisk

      This sample uses the operating system COPY command and disk media to archive and retrieve database log files.

    • db2uxt2.cxbsa

      This sample works with the XBSA Draft 0.8 published by the X/Open group. It can be used to archive and retrieve database log files. This sample is only supported on AIX®.

  • Windows operating systems

    The user exit sample programs for Db2 Data Server for Windows operating systems are found in the sqllib\samples\c subdirectory. Although the samples provided are coded in C, your user exit program can be written in a different programming language.

    Your user exit program must be an executable file whose name is db2uext2.

    There are two sample user exit programs for Windows operating systems:

    • db2uext2.ctsm

      This sample uses Tivoli Storage Manager to archive and retrieve database log files.

    • db2uext2.cdisk

      This sample uses the operating system COPY command and disk media to archive and retrieve database log files.