| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |
|

01-05-12, 05:15
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 14
|
|
db2 - transaction log is full
|
|
Hi,
in my db2 database, in a table i have 80,000 rows, when i try to delete programmatically
"delete from table"
This end up with error - "SQL0964C The transaction log for the database is full"
In my config files,
i have LOGRETAIN = OFF and
USEREXIT = OFF
already i have used enough space to allocate log path.
What else i need to do, to make log off...?
any idea..?
|
|

01-05-12, 05:24
|
|
Registered User
|
|
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
|
|
2 options
alter table xx not logged initially
delete from table
both operation in the same uow
or try to call db2admin stored proc to execute import from /dev/null of del replace into xx
from application
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
|
|

01-05-12, 07:14
|
|
Registered User
|
|
Join Date: Nov 2011
Posts: 124
|
|
|
|
another option:
increase log file size or/and log file number....
|
|

01-05-12, 07:14
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 14
|
|
Quote:
Originally Posted by przytula_guy
2 options
alter table xx not logged initially
delete from table
both operation in the same uow
or try to call db2admin stored proc to execute import from /dev/null of del replace into xx
from application
|
I tried the first option,
"Alter table xxx activate not logged initially" executed this command, But didnt work....
second option is like changing the query... if i do this..i need to make alot of changes in my app. so envt config settings would be better to do... and which handle future scenarios as well
|
|

01-05-12, 07:20
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 14
|
|
Quote:
Originally Posted by fengsun2
another option:
increase log file size or/and log file number....
|
Increase the log file size is allowing to write more log...
But this could impact in Hard disk space... i dnt want to to do that....
|
|

01-05-12, 07:32
|
|
Registered User
|
|
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
|
|
|
|

01-05-12, 07:47
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 14
|
|
"Alter table" and "delete records" these both operation should we use in same unit of work... ? is this what you meant...?
I am not sure how to make it same unit of work....?
Could you give me the comments in this....
|
|

01-05-12, 08:09
|
|
Registered User
|
|
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
|
|
if started from a file in command line - look at command options and autocommit
LIST COMMAND OPTIONS
if from an application : no commit in between
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
|
|

01-05-12, 08:15
|
|
Registered User
|
|
Join Date: Nov 2011
Posts: 124
|
|
basically that means "Alter table" and "delete records" should be in the same transaction.....
Do not commit work between the operation of alter table and delete records。
PLZ turn off the autocommit option/attributes in your program if it is on....
|
Last edited by fengsun2; 01-05-12 at 08:20.
|

01-06-12, 05:28
|
|
Registered User
|
|
Join Date: Nov 2011
Posts: 13
|
|
Hope this would work.
alter table XXX activate not logged initially;
delete from XXX;
commit work;
|
|

01-09-12, 05:11
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 14
|
|
Quote:
Originally Posted by thawfii88
Hope this would work.
alter table XXX activate not logged initially;
delete from XXX;
commit work;
|
Hi,
i have turned off my autocommit options, and in program i applied the above queries.....
alter table xxxx activate not logged initially;
and then
delete from xxxx
But it throws exception during delete query execution..... says Transaction log is full.....
am i missing any thing.. ?
|
|

01-09-12, 05:22
|
|
Registered User
|
|
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
|
|
have you started the script with +c option
otherwise it is autocommitted and alter table is committed and not used
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
|
|

01-09-12, 07:06
|
|
Registered User
|
|
Join Date: Jan 2012
Posts: 14
|
|
Quote:
Originally Posted by przytula_guy
have you started the script with +c option
otherwise it is autocommitted and alter table is committed and not used
|
This change adding +c with query , will be like modifying queries everywhere i needed... If i have 200+ places, changing it to all the area is not good way of solution. I am trying to make it config level itself.... So that in future the same problem will not happen in any other areas.....
|
|

01-09-12, 11:19
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 294
|
|
|
|

01-09-12, 11:50
|
|
Registered User
|
|
Join Date: Aug 2011
Posts: 1
|
|
if you are on db2 9.7 try below command to delete all the rows from the table...hope you already have the backup, just in case...
db2 "truncate table schema.table reuse storage immediate"
If you want to reclaim the space try the below command on the tablespace under which this table resides.
db2 "alter tablespace TSNAME reduce max"
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|