Invoking IFI from a monitor program
You can issue calls to IFI functions from a program or function outside of Db2 to submit commands, obtain trace data, and pass data to Db2 through IFI.
Procedure
To invoke IFI from a program:
What to do next
A monitor program has the following requirements:
- Connection
- A monitor program that issues IFI requests must be connected to Db2 at the thread level. If the program contains SQL statements, you must precompile the program and create a Db2 plan using the BIND process. If the monitor program does not contain any SQL statements, it does not have to be precompiled. However, as is the case in all the attachment environments, even though an IFI only program (one with no SQL statements) does not have a plan of its own, it can use any plan to get the thread level connection to Db2
- Bit mode
- The monitor program can run in either 24- or 31-bit mode.
- Authorization
- On the first READA or READS call from a user, an authorization
is checked to determine if the primary authorization ID or one of
the secondary authorization IDs of the plan executor has MONITOR1
or MONITOR2 privilege. If your installation uses the access control
authorization exit routine, that exit routine might control the privileges
that can use the monitor trace. If you have an authorization failure,
an audit trace (class 1) record is generated that contains the return
and reason codes from the exit. This is included in IFCID 0140.