Adsense

Tuesday, October 28, 2014

Solution for DB2 transaction log for the database is full. SQLSTATE=57011 .

Before go to the solution, Please go through the post to understand the LOGFILSIZ parameter and how to change the log file size. In DB2 ,Some times you may get the following error,when any transaction like Insert, Update or Delete occurs on a database.

DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0964C The
transaction log for the database is full. SQLSTATE=57011.

The above error may be caused due to the database log file is not large enough for the application or due to the transaction to delete / update rows in the table is overfilling the transaction logs. This error can be solved by increasing of LOGFILSIZ, LOGPRIMARY, and LOGSECOND .

To get the DB2 log file configuration, from a DB2 command prompt, run the following command

db2 get db cfg for database name

The output related to log file is displayed as follows .

Log file size (4KB) (LOGFILSIZ) = 1000
Number of primary log files (LOGPRIMARY) = 3
Number of secondary log files (LOGSECOND) = 2


In the above configuration , number of Primary Logs are 03 and Number of Secondary Logs are 02 .

Steps to increase number of Primary Logs / Secondary Logs

1. Stop all the DB2 UDB applications. The following command is used to stop all the applications

db2 force applications all

2) Increase LOGPRIMARY, LOGSECOND as per your requrement, if need, increase size of  LOGFILSIZ. The fllowing commands are used to update the logprimary & logsecond.




db2 update db cfg for dbname using logprimary N



db2 update db cfg for dbname using logsecond N



db2 update database config for db2name using LOGFILSIZ filesize

          -where N is greater than what is currently defined

eg.
  db2 update database config for ldapdb2 using LOGFILSIZ 5000

db2 update database config for ldapdb2 using LOGPRIMARY 5

db2 update database config for ldapdb2 using LOGSECOND 10
       

3) Restart DB2 using db2stop and db2start.

Now the problem is  solved..

0 comments:

Post a Comment