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 logs full issue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-11-11, 15:20
redwolf redwolf is offline
Registered User
 
Join Date: Apr 2004
Posts: 179
transaction logs full issue

I have a situation where a developer's code does the following:

1. Declare temp table
2. Insert data into temp table (no commit).
3. Using common table expressions and lots of joins, a long running query is run.

Now the part I'm not sure about. Several hours into the long running query, I get a SQL0965C transaction full msg pointing to this process. This process is only running a select statement at this point. My question is would this process be pointed to by db2 as the culprit, even though it only had a small number of inserts before the select statement, but didn't do a commit for about 2 hours? If this is now the case, why would I get a SQL0965C on a process performing a select statement (a long running query). I would expect to run out of temp space in this case.

DB21085I Instance "db2inst3" uses "64" bits and DB2 code release "SQL09053"
with level identifier "06040107".
Informational tokens are "DB2 v9.5.0.3", "special_22945", "U818976_22945", and
Fix Pack "3".
Product is installed at "/cs/IBM/db2/V9.5".


Thanks
Reply With Quote
  #2 (permalink)  
Old 04-11-11, 16:29
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
Here is what may be happening. As an example, I will use 3 Primary and 2 Secondary logs (and assume you have archive logging and it is not infinite).

Start with Log 1.
Problem user does Insert without a Commit. There is an open transaction in the Log 1.
Other processes do Changes and commits and the Log 1 fills up.
DB2 goes to Log 2.
Other processes do Changes an commits and Log 2 fills up.
DB2 goes to Log 3.
Other processes do Changes an commits and Log 3 fills up.
At this point DB2 would close Log 1 as it should have 3 Primary logs open but it can't since there is still an uncommitted transaction in it.
DB2 goes Log 4 (as Secondary 1).
Other processes do Changes an commits and Log 4 (Secondary 1) fills up.
DB2 still can't close Log 1.
DB2 goes to Log 5 (as Secondary 2).
Other processes do Changes an commits and Log 5 (Secondary 2) fills up.
DB2 still can not close Log 1 because of the uncommitted transaction.
But it has run out of Primary and Secondary logs.

You now have a Transaction logs full situation.
Reply With Quote
  #3 (permalink)  
Old 04-11-11, 18:16
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
I have encountered the scenario stealth_dba describes a number of times.
You can use the database snapshot to understand which application is holding the oldest transaction etc.

db2 get snapshot for database on <dbname>

Look up for
Log space used by the database (Bytes)
Secondary logs allocated currently
Appl id holding the oldest transaction

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 04-13-11, 05:43
Mathew_paul Mathew_paul is offline
Registered User
 
Join Date: Oct 2007
Posts: 200
to be more sure on ur question you can post the user temp tablespace describe
like why the temp space was not full and when you got this error related to transaction log was there enought space in your temp tablespace file system.
regds
Paul
Reply With Quote
  #5 (permalink)  
Old 04-19-11, 15:18
redwolf redwolf is offline
Registered User
 
Join Date: Apr 2004
Posts: 179
Will this scenario happen as described, if using a temp table created with the NOT LOGGED statement.
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