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 > Transation log issue

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-28-08, 12:30
ani_dbforum ani_dbforum is offline
Registered User
 
Join Date: Nov 2007
Posts: 32
Transation log issue

Hi,
I'm using Db2V8.1 on AIX.

I've a shell script that contains delete operations on 5 tables.
each table has around 1 million records on average to delete.
I applied commit statement on each db2 delete statement.

After executing 4 statements, there is an error "Transacton log for the database is full".
I've seen the path by using command "db2 get db cfg" and found the below path for transaction log
"/u02/db2inst1/NODE0000/SQL00001/SQLOGDIR/"

I asked DBA either to increase the log filesize or increase number of logs or clean up old log files.
He said there is no error in the file db2diag.log.

Am I looking in the correct path? How to fix this issue?
Is there any option to have auto commit after x number of records deleted?
Reply With Quote
  #2 (permalink)  
Old 08-28-08, 12:49
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
You have two options.

1) beat you DBA over the head and tell him to increase the size of number of logs or both.

2) change your script to break up the statements into smaller data chunks. This will not use as much log space, and also perform faster.

I personally would go with number 2.

Andy
Reply With Quote
  #3 (permalink)  
Old 08-28-08, 13:27
ani_dbforum ani_dbforum is offline
Registered User
 
Join Date: Nov 2007
Posts: 32
Thanks for information.

Below is the Logfile configuration.

Log file size (4KB) (LOGFILSIZ) = 10000
Number of primary log files (LOGPRIMARY) = 10
Number of secondary log files (LOGSECOND) = 50
Changed path to log files (NEWLOGPATH) =
Path to log files =/u02/db2inst1/NODE0000/SQL00001/SQLOGDIR/

I went in to the location and below are the logs

-rw------- 1 db2inst1 db2iadm1 512 Jul 23 15:42 SQLLPATH.TAG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 03:41 S0133167.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 04:03 S0133170.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 04:03 S0133169.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 04:03 S0133168.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 04:03 S0133171.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 04:05 S0133172.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 04:07 S0133173.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 04:10 S0133174.LOG
-rw------- 1 db2inst1 db2iadm1 40968192 Aug 28 08:18 S0133175.LOG
-rw------- 1 db2inst1 db2iadm1 38760448 Aug 28 08:18 S0133166.LOG


It shows that only 10 log files are there. There are no secondary logs are created. DBA tells that only 10% of the space is used. But we are still getting transaction log full error.

How to know whether all the space is used when there is only 10 log files are created?

We will be splitting the data to delete but how to rectify the space is used 100%?
Reply With Quote
  #4 (permalink)  
Old 08-28-08, 13:58
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Look at the monitor elements sec_log_used_top, tot_log_used_top, sec_logs_allocated, uow_log_space_used. This might give you more info.

Also look here for log related config parameters:

http://publib.boulder.ibm.com/infoce...n/r0006082.htm

Andy
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