DB2 10.5 for Linux, UNIX, and Windows

diagsize - Rotating diagnostic and administration notification logs configuration parameter

This parameter helps control the maximum sizes of the diagnostic log and administration notification log files.

Configuration type
Database manager
Parameter type
Not configurable online
Default
0
Minimum value for specifying the size of rotating logs:
2
Maximum value for specifying the size of rotating logs:
The amount of free space in the directory specified by diagpath
Unit of measure
Megabytes

If the value of this parameter is 0, the default, there is only one diagnostic log file, called the db2diag.log file. There is also only one administration notification log file, called the <instance>.nfy file, which is used only on Linux and UNIX operating systems. The sizes of these files can increase indefinitely.

If you set the parameter to a non-zero value and restart the <instance>, a series of rotating diagnostic log files and a series of rotating administration notification log files are used. These files are called the db2diag.n.log and <instance>.n.nfy files, where n is an integer; <instance>.n.nfy files apply only to Linux and UNIX operating systems. The number of db2diag.n.log files and <instance>.n.nfy files cannot exceed 10 each. When the size of 10th file is full, the oldest file is deleted, and a new file is created.

For example, on Linux and UNIX operating systems the rotating log files under diagpath might look like the following output:

db2diag.14.log, db2diag.15.log, ... , db2diag.22.log, db2diag.23.log
<instance>.0.nfy, <instance>.1.nfy...,<instance>.8.nfy,<instance>.9.nfy

If db2diag.23.log is full, db2diag.14.log will be deleted, db2diag.24.log will be created for db2diag logging

If <instance>.9.nfy is full, <instance>.0.nfy is deleted , <instance>.10.nfy will be created for administration notification logging.

Note that the messages are always logged to rotating log file with the largest index number db2diag.largest n.log, <instance>.largest n.nfy

The total size of the db2diag.n.log and <instance>.n.nfy files are determined by the value of the diagsize configuration parameter. By default, except on Windows operating systems, 90% of the value of diagsize is allocated to the db2diag.n.log files, and 10% of the value of diagsize is allocated to the <instance>.n.nfy files. For example, if you set diagsize to 1024 on a Linux or UNIX operating system, the total size of the db2diag.n.log files cannot exceed 921.6 MB, and the total size of the <instance>.n.nfy files cannot exceed 102.4 MB. On Windows operating systems, the total value of diagsize is allocated to the db2diag.n.log files. The size of each log file is determined by the total amount of space allocated to each type of log file divided by 10. For example, if the total size of the db2diag.n.log files cannot exceed 921.6 MB, the size of each db2diag.n.log file is 92.16 MB.

The maximum value that you specify for the diagsize configuration parameter cannot exceed the amount of free space in the directory that you specify for the diagpath configuration parameter. The diagnostic and administration notification log files are stored in this directory. To avoid losing information too quickly because of file rotation (the deletion of the oldest log file), set diagsize to a value that is greater than 50 MB but not more than 80% of the free space in the directory that you specify for diagpath.

For example,
  • To set the diagsize to 1024 MB, that will switch to rotate logging behavior when DB2® gets restarted, use the following command:
    db2 update dbm cfg using diagsize 1024
  • To set the diagsize to 0 that will switch to default logging behavior when DB2 gets restarted, use the following command:
    db2 update dbm cfg using diagsize 0

If you change the value of the diagsize configuration parameter and do not restart the instance, the instance and existing processes continue to use the old value. Any new processes that are created after the value is changed uses the new value. This might result in 2 log files being written to until the instance is restarted.

Note: Starting with DB2 Version 9.7 Fix Pack 1, if the diagsize configuration parameter is set to a non-zero value and the diagpath configuration parameter is set to split the diagnostic data into separate directories, then the non-zero value of the diagsize configuration parameter specifies the total size of the combination of all rotating administration notification log files and all rotating diagnostic log files contained within a given split diagnostic data directory. For example, if a system with 4 database partitions has diagsize set to 1 GB and diagpath set to "$n" (split diagnostic data per database partition), the maximum total size of the combined notification and diagnostic logs can reach 4 GB (4 x 1 GB).