IBM Support

onmode -I: How to trap an Informix error to collect additional information for diagnostics

Question & Answer


Question

This document describes how to use onmode -I to collect additional information about an error.

Answer


onmode error trapping tells Informix to take a snapshot of the database server when the specified error or errors occur. The snapshot is placed in an af.* file with the specific name and location listed in the online.log when the problem occurs. When the af file is created the server can hang momentarily. The hang duration depends on the speed of the computer and the size of the shared memory Informix is using. It is generally not even noticed by users and could easily look like a slight network hiccup from the user viewpoint.

STEPS

    1. From the command line run the onmode utility to enable the trap for a given error code.
      onmode -I error_number
      Example:

      The example below enables the trap for error -271 should it occur in any session.
        $ onmode -I 271

    Verify the command was successful by reviewing your message log after running the command. The message log file should indicate the trap was enabled.

      Example:

      10:52:45  TrapError set, errno = 271, session_id = -1

    2. Take the required action or actions to reproduce the error you are trapping. The database server will generate an assertion failure file when the error occurs. Check the message log file for the complete path to the file.

      Example:

      16:41:22  TrapError set, errno = 271, session_id = -1
      16:41:59  Assert Failed: found errno 131 in session 23
      16:41:59  Informix Dynamic Server Version 11.70.FC2
      16:41:59   Who: Session(23, informix@test, 15625, 169244012)
                      Thread(41, sqlexec, a142adc, 1)
                      File: rsdebug.c Line: 3614
      16:41:59  Action: Use onmode -i to allow Dynamic Server to continue
      16:43:17  See Also: /tmp/af.4113c17, shmem.4113c17.0

    3. To disable the trap run onmode -I without providing any arguments. An informational message will appear in the message log file to indicate the trap cleared.
        Example:

        16:44:50  TrapError cleared

        Additionally, a session id can be provided to limit the error trapping to a specific user session. Use the following syntax to trap for a given session id.

        onmode -I error_number,session_id

            Example:

             The example below enables the trap for error -271 for session 23 only.

             $ onmode -I 271,23

        The message log for this example will will indicate the trap was enabled for session 23 only.

            Example:

             10:52:45  TrapError set, errno = 271, session_id = 23

        For more information regarding onmode -I follow this link:
        onmode -I: Control diagnostics collection

        [{"Product":{"code":"SSGU8G","label":"Informix Servers"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF022","label":"OS X"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"11.1;11.5;11.7;12.1","Edition":"","Line of Business":{"code":"","label":""}}]

        Document Information

        Modified date:
        16 June 2018

        UID

        swg21155532