Transaction log files for the database

Transaction log files provide you with the ability to recover your environment to a consistent state and preserve the integrity of your data. Log file storage must be optimized because log files are written sequentially, and the database manager reads log files sequentially during database recovery.

Put the logs on a file system and they are placed on their own physical disks, separate from the database table spaces and database software. The disks ideally should be dedicated to DB2® logging to avoid the possibility of any other processes that are accessing or writing to these disks. Ideal placement of the logs is on the outer edge of the disk where there are more data blocks per track. It is recommended to protect the log against single disk failures by using a RAID 10 or RAID 5 array.
Table 1. Transaction log files and parameters
Parameter Description

This parameter is used to change the log path to create the transaction log files on a separate partition/volume than the default volume or the one used for database table space containers.

Set it to a directory that is the destination of log files. Make sure that the directory is created before you set it. Make sure that there is enough space on the destination before you set the new log path.

For example: update db cfg for PIMDB using NEWLOGPATH /u02/db2data/logs


This parameter defines the size of each primary and secondary log file. The size of these log files limits the number of log records that can be written to them before they become full and a new log file is required. Set it to 30000 if it is a development/test database otherwise set it to 60000. The size is number of pages each of size 4 KB.

For example: update db cfg for PIMDB using LOGFILSIZ 60000


The primary log files establish a fixed amount of storage that is allocated to the recovery log files. This parameter enables you to specify the number of primary log files to be pre-allocated. Set it to 20 if it is a development database otherwise set it to 40.

For example: update db cfg for PIMDB using LOGPRIMARY 40


This parameter specifies the number of secondary log files that are created and used for recovery log files (only as needed). When the primary log files become full, the secondary log files (of size logfilsiz) are allocated one at a time as needed, up to a maximum number as controlled by this parameter. Set its value to 2.

For example: update db cfg for PIMDB using LOGSECOND 2

Restart the database after you make the db configuration changes with db2stop and db2start commands:
  • db2stop force
  • db2start
The following table has information about values of different configuration parameters that influence the transaction log size and numbers for small, medium, and large InfoSphere® Master Data Management Collaboration Server - Collaborative Edition database implementations:
Table 2. Values of different configuration parameters
Parameter Small Medium Large
LOGFILSIZ 30000 60000 70000
Total Space Required 3.7 GB 9.6 GB 13.8 GB