sql0946n error and DB2 transaction log

Source: Internet
Author: User
Tags db2 transaction

In the case of bulk additions and deletions to the DB2 database, if the amount of data is large will cause sql0964n error, DB2 Knowledge Center (http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/ topic/com.ibm.db2.luw.messages.sql.doc/doc/msql00964c.html) The error is interpreted as "the transaction log for the database was full", That is, the transaction log is full. This error occurs because the database needs to record the transaction log in order to be able to roll back when an exception occurs, when the volume of the batch is larger than the capacity of the transaction log space.

There are two main ways to solve this problem

1, cancels the transaction log for the action performed

The auto-commit function of the database is canceled first, and the command line can be canceled by the +c parameter, and then the table tbl that causes the transaction log to be modified.

ALTER TABLE tbl ACTIVATE not logged initially;

It is now possible to execute the SQL statement that caused the transaction log to be full before, for example

DELETE from TBL

Now you can see that there are no transaction log full errors, and then commit. This is the simplest and fastest way. But the disadvantage is also obvious, that is, when a transaction fails, it cannot be rolled back.

2, increase log space

The size of the log space = (logpriimary + LOGSECOND) * LOGFILSIZ * 4 K, so you can increase the transaction log space by modifying the database's configuration file Logpriimary, LOGSECOND, and LOGFILSIZ. The easiest way to change logsecond without disconnecting the DB is to

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.