Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2011
    Posts
    29

    Unanswered: Online Archive Log vs Offline Archive Log DB2 (V9) LUW

    My understanding is that when an active log no longer has any 'in flight transactions' meaning all the transactions in the log file have been either been committed or rolled backed then file because inactive as well as an online archive log yet still resides in the active log path. It will eventually makes it way to the offline archive log path

    What I'm confused about is that since an active log is immediately archived once the active log is full then the archive log can possibly contain uncommitted transactions, however, an online archive log is basically an inactive log that contains committed transactions only.

    How is possible that an archive log must contained committed transactions only yet at the same time contradict itself by stating that archive logs can also contain uncommitted transactions?

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by sanchez786 View Post
    an archive log must contained committed transactions only
    This is not true.

  3. #3
    Join Date
    Jul 2011
    Posts
    29
    If it's not true then why is that online archive logs only contain committed transactions?

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    I think there is confusion is using the term "archive" the way you are using it. Logs are either active (in the active log directory) or archived (moved to the archive directory). They get moved to the archive log when they are full or truncated, whether they have active transactions are not. They stay in the active directory until they are full or truncated, whether they have inactive transaction or not. If a log that has been archived and had an active transaction that needs to be rolled back, the archive log will be retrieved so that it can be read.

    Andy

  5. #5
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by sanchez786 View Post
    If it's not true then why is that online archive logs only contain committed transactions?
    Sorry, I don't know what that means. There are two aspects to log management, and you seem to be mixing up the two:
    - log files can be active (contain open transactions) or inactive (contain only committed transactions);
    - logs can be archived (moved to archive storage) or not.

    These are independent concepts. Logs become candidates for archiving when they are full or explicitly closed (e.g. by the database deactivation). However, if they still contain open transactions, which may happen in the former case, they still remain active and cannot (should not) be reused (removed).

  6. #6
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    I remember from DB2 LUW V5 (long ago!) that DB2 would not archive active log files. It seems that his has changed and improved since then. Good to know!
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  7. #7
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Another explanation is here:
    http://www.dbforums.com/db2/1659142-pruge-logs.html


    Replace userexit with logarchmeth1 (or whatever you set to enable archival logging). In case if you have infinite logging setup, db2 may rename the active log in the active log dir, if needed (after this active log has been copied to the archive location).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •