Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to empty the transaction logs -- DB2 V7.1 (in Linux)

654 views
Skip to first unread message

Carlos Oliva

unread,
Jan 28, 2002, 12:16:36 PM1/28/02
to
How can I empty the transaction logs of a database? When I try to delete
the records of a table that has several thousands of records I get the
error, "SQL0964C The transaction log for the database is full.
SQLSTATE=57011". I get this error when I issue the command from the command
line of DB2 and after 300 records have been deleted.

I looked at the size of the logs but they can use anywhere between 12MB and
20MB of space (logfilsiz=1000, logprimary=3, and logsecondary=2).


Pierre Saint-Jacques

unread,
Jan 28, 2002, 2:52:07 PM1/28/02
to Carlos Oliva
Carlos, you can't empty the logs. Best you can do is delete them if
they're not in use and that's not your problem here.
When you use the command line, auto commit is on and the delete will
commit when the last row is deleted in this case.

So, your deletes are logged and since DB2 hasn't committed, it keeps
asking for log space. With 3 primary files and only two secondary, your
log space fills up and runs out of files to be assigned.

Quick fix is to get all apllications off and then:
db2 update db cfg for <dbname> using logsecond 100
db2 connect to <dbname>
db2 delete from <tablename>

This should give you 100 x 4MB of additional logging space and work.
Note that DB2 will assign only as many of the secondary files as it need.

HTH, Pierre.

Mike Logue

unread,
Jan 28, 2002, 6:05:36 PM1/28/02
to
you need to A. commit more often, B create more log space - with the
settings you show that is the MAXIMUM space for ALL open transactions if
doing circular logging. (LOGRETAIN=off USEREXIT=off). Remember updates and
deletes make before AND after images of the records to facilitate rollbacks.

Regards,
Mike
"Carlos Oliva" <car...@pbsinet.com> wrote in message
news:u5b1r04...@corp.supernews.com...

Carlos Oliva

unread,
Jan 29, 2002, 10:52:37 AM1/29/02
to
Thank you very much for your responses. I increased the size of the
secondary logs to attain the maximum (128) and I commited data more often.
These two things helped.

"Mike Logue" <mdl...@alltel.net> wrote in message
news:a34lih$6ti$1...@iac5.navix.net...

0 new messages