Db2 diagnostic (db2diag) log files

The Db2 diagnostic db2diag log files are primarily intended for use by IBM Software Support for troubleshooting purposes. The administration notification log is primarily intended for troubleshooting use by database and system administrators. Administration notification log messages are also logged to the db2diag log files using a standardized message format.

Overview

With Db2 diagnostic and administration notification messages both logged within the db2diag log files, this often makes the db2diag log files the first location to examine in order to obtain information about the operation of your databases. Help with the interpretation of the contents of these diagnostic log files is provided in the topics listed in the "Related links" section. If your troubleshooting attempts are unable to resolve your problem and you feel you require assistance, you can contact IBM Software Support (for details, see the "Contacting IBM Software Support" topic). In gathering relevant diagnostic information that will be requested to be sent to IBM Software Support, you can expect to include your db2diag log files among other sources of information which includes other relevant logs, storage dumps, and traces.

The db2diag log file can exist in two different forms:
Single diagnostic log file
One active diagnostic log file, named db2diag.log, that grows in size indefinitely. This is the default form and it exists whenever the diagsize database manager configuration parameter has the value of 0 (the default value for this parameter is 0).
Rotating diagnostic log files
A single active log file (named db2diag.N.log, where N is the file name index that is a continuously growing number starting from 0), although a series of diagnostic log files can be found in the location defined by the diagpath configuration parameter, each growing until reaching a limited size, at which time the log file is closed and a new one is created and opened for logging with an incremented file name index (db2diag.N+1.log). It exists whenever the diagsize database manager configuration parameter has a nonzero value.

You can choose which of these two forms exist on your system by appropriately setting the diagsize database manager configuration parameter.

Configuration

The db2diag log files can be configured in size, location, and the types of diagnostic errors recorded by setting the following database manager configuration parameters:
diagsize
The value of diagsize decides what form of diagnostic log file will be adopted. If the value is 0, a single diagnostic log file will be adopted. If the value is not 0, rotating diagnostic log files will be adopted, and this nonzero value also specifies the total size of all rotating diagnostic log files and all rotating administration notification log files. The instance must be restarted for the new value of the diagsize parameter to take effect. See the "diagsize - Diagnostic log file size configuration parameter" topic for complete details.
diagpath
Diagnostic information can be specified to be written to db2diag log files in the location defined by the diagpath configuration parameter. See the "diagpath - Diagnostic data directory path configuration parameter" topic for complete details.
alt_diagpath
The alt_diagpath database manager configuration parameter provides an alternate diagnostic data directory path for storing diagnostic information. If the database manager fails to write to the path specified by diagpath, the path specified by alt_diagpath is used to store diagnostic information.
diaglevel
The types of diagnostic errors written to the db2diag log files can be specified with the diaglevel configuration parameter. See the "diaglevel - Diagnostic error capture level configuration parameter" topic for complete details.
Note: If the diagsize configuration parameter is set to a non-zero value, that value specifies the total size of the combination of all rotating administration notification log files and all rotating diagnostic log files contained within the diagnostic data directory. For example, if a system with 4 database partitions has diagsize set to 1 GB, the maximum total size of the combined notification and diagnostic logs can reach is 4 GB (4 x 1 GB).