Programming for the instrumentation facility interface (IFI)

Monitor programs can use the instrumentation facility interface (IFI) to request online trace information from the trace facility. IFI can be accessed through any of the attachment facilities. It gathers trace data that can be written to one or more destinations that you specify.

Begin program-specific programming interface information.
You can use the trace information for the following purposes:
  • To obtain accounting information for online billing.
  • To periodically obtain system-wide information about DB2®, highlight exceptional conditions, or provide throughput information.
  • To learn which processes have been connected to DB2 the longest, or which processes have used the most CPU time.
  • To obtain accounting records as transactions terminate.
  • To determine the access and processing methods for an SQL statement.
  • To capture log buffers online for use in remote recovery.
  • To retrieve SQL changes synchronously from the log, for processing in an application.

IFI uses the standard security mechanisms such as connection authorization, plan authorization, and so forth.

Before using IFI, you should be familiar with the trace facility and instrumentation facility component identifiers (IFCIDs).

Note that where the trace output indicates a particular release level, you see 'xx' to show that this information varies according to the actual release of DB2 that you are using.

You can use IFI in a monitor program (a program or function outside of DB2 that receives information about DB2).

When a trace is active, internal events trigger the creation of trace records. The records, identified by instrumentation facility component identifiers (IFCIDs), can be written to buffers, and a monitor program can read them later by using the IFI READA function. READA requests are asynchronous, because the data is not read by the monitor program at the same time that it was written.

You can trigger the creation of certain types of trace records by using the IFI READS function. READS requests are synchronous, which means that the records are not held in a buffer. Instead, the records are returned directly to the return area for the monitor program.. The data is collected at the time of the request for the data.

End program-specific programming interface information.