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 > Logging at DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-08-08, 04:46
linakichi linakichi is offline
Registered User
 
Join Date: Aug 2008
Posts: 45
Logging at DB2

Hello, I'm kinda confused in logging method at DB2. There is circular logging and archive logging, but, when I searched archive logging, there's not much info I could get.

Does archive logging have the same mechanism as circular logging, which is constantly writing online logs in circular mode ?

And, I don't understand the meaning of the archive log, since I saw the manual which explains that archive logs contain changes after the backup was taken, but when I searched it again, an article tells me that archive logs contain old data that aren't fit on the active log, which means, it's old data that doesn't contain changes, right ?

Oh yeah, log buffer has to do something with those mechanisms, right ? When exactly data from log buffer transferred to the log files ? Which one is the log buffer's writing destination ? Active log ? Or online log ?

I'm so confused by the logging mechanism in DB2...

Last edited by linakichi; 08-08-08 at 05:00.
Reply With Quote
  #2 (permalink)  
Old 08-08-08, 05:46
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
active/online log is the same
whenever there is a commit or logbuffer full data gets flushed to logfiles
for circular logging, the log files are re-used and forward recovery after restore is not possible. with archive logging, whenever a log file is closed, this file will be copied to disk/tape/tsm.. with this archived copy, you can always rollforward after restore to recover data
check some admin guides for details..
__________________
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
Reply With Quote
  #3 (permalink)  
Old 08-08-08, 17:48
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
For "archive logging" (aka "log retain") you define how many active logs will be kept (primary and secondary). Secondary active logs are only used when a UOW goes beyond the primary log allocation without a commit.

Once the active logs are filled, they are archived to the archive log location (specified in an exit program or using LOGARCHMETH1 & 2 (spelling may be wrong). Certain other kinds of events may cause the logs to be truncated (start a new log file) or archived.

You must manually prune the archive logs or they will stay on the archive log path forever.

The log buffer is not specifically associated with archiving or circular logs (all logs are written to a memory buffer before they are written to disk). Logs are flushed to disk when:
  1. A commit is issued (so that DB2 gurantees UOW recovery),
  2. The log buffer is full, or
  3. About one second has elapsed since the last logs were flushed to disk.
There are some exceptions to what is said above, especially with TSM, but given that you are apparently new to DB2 internals, don't try to understand everything at once. Also, I would suggest you read the Administraton Guides for more information.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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