DBDIAGLOGSIZE

This option helps to control the amount of space that is used by diagnostic log files.

The database manager uses diagnostic log files to log messages. You must control the size of the log files so that they do not fill the file system. Use the DBDIAGLOGSIZE option to set the amount of space that is used by the log files.
If you set a value in the range 2 - 9999, a maximum of 10 rotating diagnostic log files are retained. Each file name indicates the order in which the file was created. After a file is full, the next file is created. When the 10th file is full, the oldest file is deleted, and a new file is created. The following example shows how the rotating log files might look:
db2diag.14.log, db2diag.15.log, ... , db2diag.22.log, db2diag.23.log
When db2diag.23.log is full, db2diag.14.log is deleted, and db2diag.24.log is created.
The server checks the file space that contains the diagnostic log files every hour. Messages are displayed every 12 hours if either of the following conditions occur:
  • The available space in the file system where the diagnostic log files are located is less than 20% of the total file system space.
  • The available space in the file system where the server instance directory is located is less than 1 GB.
If you specify a value of 0, only one log file, db2diag.log, is used for all diagnostic messages. No limits are imposed on the size of the log file.
Restriction: You must monitor the size of the diagnostic log files to ensure that they do not use all the available space in the file system. If there is not enough available space, the server might fail to respond.

Syntax

Read syntax diagramSkip visual syntax diagram
                  .-1024------.   
>>-DBDIAGLOGSize--+-megabytes-+--------------------------------><

Parameters

megabytes
Specifies the amount of space that is used by diagnostic log files in megabytes. Specify a value in the range 2 - 9999, or a value of 0. The default value is 1024.

If you specify a value in the range 2 - 9999, rotating log files are used, and the value specifies the total size in megabytes of all 10 log files. The value is reset to 1024 whenever the server is restarted.

If you specify a value of 0, one log file is used, and no limits are imposed on the size of the log file.

If you want to archive messages, specify a value of 0 to ensure that the db2diag.log file can use all the available space without using rotating log files.

After you set the value of the megabytes parameter to 0 by using the DBDIAGLOGSIZE option, messages are initially written to rotating log files. After the server is restarted, messages are written to the db2diag.log file.

Tip: If you specify a value in the range 2 - 9999 by using the server options file, dsmserv.opt, the value is not reset automatically at server startup. The value remains the same until it is changed or removed from the dsmserv.opt file, by using the SETOPT command.

Example: Specify a maximum size of 5120 megabytes

Specify the size of the diagnostic log files as 5120 megabytes (5 GB):

dbdiaglogsize 5120

Example: Archive messages in a single log file

Archive messages by specifying that the messages are written to the db2diag.log file:

dbdiaglogsize 0