Increasing the transaction logs for a DB2 database

If the DB2® database transaction log becomes full, issues with database operation can result. To proactively prevent errors that can result when your DB2 transaction log is full, increase the size and number of log files.

The transaction log contains a record of each completed change made in the database so that changes can be reversed, if necessary.
  1. Determine your current database configuration by entering the following command:
     db2 get db cfg for your_Database_Name

    The current database configuration is displayed. Log entries are in the approximate middle of the file:

    Log file size (4KB)             (LOGFILSIZ) = 1000  (note: 1000 x 4KB pages = 4MB)
    Number of primary log files     (LOGPRIMARY) = 3 
    Number of secondary log files   (LOGSECOND) = 10
    where
    LOGFILSIZ
    Defines the size of each primary and secondary log file and is specified in 4 KB pages. Valid values: 4 - 1048572. Default: 1000

    Suggested minimum log file size: 3000.

  2. To increase the size or number of log files, enter the following command:
    db2 update db cfg for your_Database_Name using logfilsiz nnnn logprimary nn logsecond nn
    Suggested minimum values:
    • logfilsiz 3000
    • logprimary 100
    • logsecond 100
    Importing large files: If you encounter errors when importing large code lists, you might need to increase the number of logs, the log file size, or both parameters even further.
  3. Restart the database by entering the following commands:

    db2stop

    db2start