SoFunction
Updated on 2025-04-14

Detailed explanation of the solution to the problem that the db2 transaction log is full and the log disk space is full

Transaction log full means that the current transaction cannot be written to the activity log (the main log file and auxiliary log file are all used up or there is not enough space for the current transaction to be written to)

Log disk space is full means that the auxiliary log file has not been used yet and the disk space is full.

The db2 database transaction log file is divided into primary log file and secondary log file. The main log file has been allocated space and is redistributed when the auxiliary log file is used.

Check the transaction log configuration (mid is the database name):

db2 get db cfg for mid

Running results:

Log File Size (4KB)
Number of main log files
Number of auxiliary log files
Change path to log file
Log file path

Total transaction log capacity size = (LOGPRIMARY+LOGSECOND)*LOGFILSIZ*4k

ps:(13+4)*1024*4kb=68mb

Solution to full DB2 transaction log:

(1) Increase the log file size:

db2 udpate db cfg for mid using LOGFILSIZ 8192

Or increase the number of main log files:

db2 update db cfg for mid using LOGPRIMARY 15

Or increase the number of auxiliary log files:

db2 update db cfg for mid using LOGSECOND 10

(2) Stop the application that caused this error or stop all applications, and then restart the database

db2 force applications all
db2 force application (application handle is obtained through db2 list applications)
db2stop
db2start

The above two solutions to solve the problem that the db2 transaction log is full and the log disk space is full. I hope it can help you