Unix Technical Forum

Transaction Logs

This is a discussion on Transaction Logs within the DB2 forums, part of the Database Server Software category; --> Hi. I have a problem with many transaction logs generated by DB2 Version 7.2 on Redhat 7.3. Log file ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 02:13 AM
Wolfgang B.
 
Posts: n/a
Default Transaction Logs

Hi.

I have a problem with many transaction logs generated by DB2 Version
7.2 on Redhat 7.3.

Log file size (4KB) (LOGFILSIZ) = 1000
Number of primary log files (LOGPRIMARY) = 25
Number of secondary log files (LOGSECOND) = 25
Group commit count (MINCOMMIT) = 1
Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
Log retain for recovery enabled (LOGRETAIN) = RECOVERY
User exit for logging enabled (USEREXIT) = OFF


I know that the Logs are generated every time a PERL-script starts and
perfomrs some operations on the database. This script syncronizes the
contents of tables with tables from a different DB and uses DB2
federated System features to access them.
The LOGFILES have most the time a size of 16384 bytes. I guess in this
case no data changed.

Please could you help me with 3 question about this:

1) When is a new LOGFILE generated in DB2 or when does a LOG-Switch
occur.
2) How can i prevent DB2 generating those LOGFILES.
3) Is there some tool available that shows the contents of the LOGFILE

Is there perhaps some good documentation available for this questions?



Thanks
Wolfgang
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 02:13 AM
Pierre Saint-Jacques
 
Posts: n/a
Default Re: Transaction Logs

Your logfiles (25 primary) are allocated and opened at first connect or
activate db command.
A log file is closed at whatever size (your 16k which is two pages)
whenever a db2 archive log command is issued or caused to be issued by db2.
DB2 will start to open new log files on demand when your ten primaties
have been used and will keep on doing so until the db is deactivatd.
Then it will start anew by allocating 10 empty primaries, fill them up,
then start allocating, one by one, on demand new log files.
DB2 will switch to a new log when the one currrently used fills up, or
id a db2 archive log command is issued.
Bear in mind that db2 archive log command makes sense when the userexit
is activated.

Obviously, something in your PERL scripts does not acticvate the db and
becomes the sole connection to the db. Should the script connect reset,
then the db is in disconnected state and log files are closed. The on
in use is chopped at its end (your 16K) and the others stay assigned,
empty waiting for the next connect or activate; and so on....

I'd try to issue an activate command and then deactivate the db when you
the dba needs to take it offline. This way logs will stay assigned and
ready for whenever you run your scripts.
HTH, Pierre.

Wolfgang B. wrote:
> Hi.
>
> I have a problem with many transaction logs generated by DB2 Version
> 7.2 on Redhat 7.3.
>
> Log file size (4KB) (LOGFILSIZ) = 1000
> Number of primary log files (LOGPRIMARY) = 25
> Number of secondary log files (LOGSECOND) = 25
> Group commit count (MINCOMMIT) = 1
> Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
> Log retain for recovery enabled (LOGRETAIN) = RECOVERY
> User exit for logging enabled (USEREXIT) = OFF
>
>
> I know that the Logs are generated every time a PERL-script starts and
> perfomrs some operations on the database. This script syncronizes the
> contents of tables with tables from a different DB and uses DB2
> federated System features to access them.
> The LOGFILES have most the time a size of 16384 bytes. I guess in this
> case no data changed.
>
> Please could you help me with 3 question about this:
>
> 1) When is a new LOGFILE generated in DB2 or when does a LOG-Switch
> occur.
> 2) How can i prevent DB2 generating those LOGFILES.
> 3) Is there some tool available that shows the contents of the LOGFILE
>
> Is there perhaps some good documentation available for this questions?
>
>
>
> Thanks
> Wolfgang


--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot net
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 02:13 AM
Wolfgang B.
 
Posts: n/a
Default Re: Transaction Logs

Great.
That is the problem and what i needed to know about Logging. Files
with the size of 16K are created by truncating the Logfiles to its
actual size of 16K during reconnection.
With this information, I am able to solve the problem.

The Logs are moved by another program not using USEREXIT.

Thank you very much Pierre.

Wolfgang

Pierre Saint-Jacques <sescons@attglobal.net> wrote in message news:<419118F9.1040909@attglobal.net>...
> Your logfiles (25 primary) are allocated and opened at first connect or
> activate db command.
> A log file is closed at whatever size (your 16k which is two pages)
> whenever a db2 archive log command is issued or caused to be issued by db2.
> DB2 will start to open new log files on demand when your ten primaties
> have been used and will keep on doing so until the db is deactivatd.
> Then it will start anew by allocating 10 empty primaries, fill them up,
> then start allocating, one by one, on demand new log files.
> DB2 will switch to a new log when the one currrently used fills up, or
> id a db2 archive log command is issued.
> Bear in mind that db2 archive log command makes sense when the userexit
> is activated.
>
> Obviously, something in your PERL scripts does not acticvate the db and
> becomes the sole connection to the db. Should the script connect reset,
> then the db is in disconnected state and log files are closed. The on
> in use is chopped at its end (your 16K) and the others stay assigned,
> empty waiting for the next connect or activate; and so on....
>
> I'd try to issue an activate command and then deactivate the db when you
> the dba needs to take it offline. This way logs will stay assigned and
> ready for whenever you run your scripts.
> HTH, Pierre.
>
> Wolfgang B. wrote:
> > Hi.
> >
> > I have a problem with many transaction logs generated by DB2 Version
> > 7.2 on Redhat 7.3.
> >
> > Log file size (4KB) (LOGFILSIZ) = 1000
> > Number of primary log files (LOGPRIMARY) = 25
> > Number of secondary log files (LOGSECOND) = 25
> > Group commit count (MINCOMMIT) = 1
> > Percent log file reclaimed before soft chckpt (SOFTMAX) = 100
> > Log retain for recovery enabled (LOGRETAIN) = RECOVERY
> > User exit for logging enabled (USEREXIT) = OFF
> >
> >
> > I know that the Logs are generated every time a PERL-script starts and
> > perfomrs some operations on the database. This script syncronizes the
> > contents of tables with tables from a different DB and uses DB2
> > federated System features to access them.
> > The LOGFILES have most the time a size of 16384 bytes. I guess in this
> > case no data changed.
> >
> > Please could you help me with 3 question about this:
> >
> > 1) When is a new LOGFILE generated in DB2 or when does a LOG-Switch
> > occur.
> > 2) How can i prevent DB2 generating those LOGFILES.
> > 3) Is there some tool available that shows the contents of the LOGFILE
> >
> > Is there perhaps some good documentation available for this questions?
> >
> >
> >
> > Thanks
> > Wolfgang

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:18 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com