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.

 
Go Back  dBforums > Database Server Software > DB2 > Transaction Log Full

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-06, 17:45
bunzo bunzo is offline
Registered User
 
Join Date: Apr 2005
Posts: 28
Transaction Log Full

I have a table with over 120 million records. In order to keep the number of records down to a minimum, I have to find a way to export summary data and then delete records on a monthly basis from this table. Supporting tables don't have any where near as many records and I only have to delete from this one table. Currently using circular logging.
Records do not get edited.... simply post a record, pull summary data, export summary data and delete records when old.

My Log File Size is set to 50000 and my number of primary logs was set to 25... I just upped it to 50 today. Secondary Log files is set to 0.

My delete query isn't pretty, but it's simple -

Delete
From MetricsData
Where Month(Timekey_dttm) = 11 and Day(Timekey_dttm) < 5;

commit;

My script repeats this and increments the Day(Timekey_dttm) < 10... 15.. etc., until I've covered all days in the month.

Once I'm able to successfully delete records in this manner, I'll clean up the query/script to address year changes, etc.

Can someone explain why I'm still getting Transaction Log File Full msgs? I'm now allocating 10 gig to my Transaction Logs. My backups aren't that big.

Should I look at an alternative delete solution?

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-15-06, 03:29
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
alter table

you could : alter table aCTIVATE NOT LOGGED INITIALLY and delete records in same unit of work and commit...
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
  #3 (permalink)  
Old 01-16-06, 10:22
jthakrar jthakrar is offline
Registered User
 
Join Date: Mar 2004
Posts: 46
It seems you do a periodic(monthly?) purge of records from this table.
Doing it using deletes will certainly log the activity(deletes).

One suggestion for both performance and to reduce logging activity is to export the (required data out) and reload it into the table using db2 load.
e.g.

db2 "export to <file-name> of del select * from <table> where <search-condition-for-data-to-preserve>"
db2 "drop table <table>"
db2 "create table <table>...."
db2 "load from <file-name of del ......(non-recoverable, etc.)"

Another option is to create another (new) table, load that new table with data to be retained. Then drop the current table and rename the new table to the new table.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On