Db2 traces used in Accounting
The Accounting report set requires the following Db2 trace classes and Db2 trace types to be active.
Accounting uses the DB2 IFCIDs 3 and 239 (Db2 trace type Accounting, Db2 trace class 1) as input for the reports and traces. Timing data is taken from all classes:
- Application times (class 1)
- DB2 times (class 2)
- Suspension times (class 3) and counts
- IFI times (class 5)
- DB2 times on a per package/DBRM basis (class 7)
- Suspensions times on a per package/DBRM basis (class 8) and counts
If an Accounting record represents an allied-distributed thread, additional time fields for DDF data are reported. These DDF times are obtained from Accounting class 1.
Accounting trace classes are started either at DB2 start time, by using the installation panel DSNTIPN, or by entering the DB2 START TRACE command at the terminal. For example:
-START TRACE(ACCTG) CLASS(1,2,3,5,7,8) DEST(SMF)
The Accounting classes 1 and 3 should always be active. The overhead is not significant, whereas the information they provide is crucial for all aspects of performance monitoring. It is also useful to always have class 2 active. If you do not always have class 3 active, activate class 3 when you activate class 2.
Classes 7 and 8 provide valuable information on a per package or per DBRM basis. They are equivalent to classes 2 and 3. Package or DBRM Accounting is probably most beneficial for a DB2 server of a non-DB2 requester or when an application plan can execute many packages or DBRMs, but actually executes 10 or less for a given Accounting record. If class 2 is active, also activate class 7 if package Accounting is needed. If class 3 is active, also activate class 8 if package Accounting is needed. More than 10 packages or DBRMs introduce additional overhead in data collection reducing the benefit versus cost. However, this cost is still significantly less than a DB2 performance class trace.