Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2013
    Posts
    80

    Unanswered: Archive log Generation

    Hi,
    Anyone know how db2 database archivelog generated? In oracle, it will start archivelog upon when redo log switch to new log, the previous redo log will start archiving. how about db2 ? Any else situation will archivelog generated as well ?

    Thanks.

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    look at the Log file allocation and removal topic.
    Regards,
    Mark.

  3. #3
    Join Date
    Aug 2013
    Posts
    80
    Thanks Mark, it seems once the log file full it will automatically archive the log. So it is similar to oracle,the only different is oracle using circular approach which need to ensure the active log get archived before it overwritten. Hence, DB2 will have never encounter waiting for "redo log" to be archived situation as it keep on archive and archive until number of LOGPRIMARY specified. correct me if I wrong.
    Last edited by ckwan123; 05-30-14 at 06:02.

  4. #4
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    Quote Originally Posted by ckwan123 View Post
    Hence, DB2 will have never encounter waiting for "redo log" to be archived situation as it keep on archive and archive until number of LOGPRIMARY specified.
    In theory, yes.
    However, you may encounter a situation when you have a very old transaction that is still not committed that blocks the archiving - an active log cannot be archived until all the transactions written in that file are finished. As a result, you may reach the upper limit of LOGPRIMARY + LOGSECONDARY number of active log files, when DB2 stops
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  5. #5
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Quote Originally Posted by aflorin27 View Post
    ...very old transaction that is still not committed that blocks the archiving - an active log cannot be archived until all the transactions written in that file are finished. As a result, you may reach the upper limit of LOGPRIMARY + LOGSECONDARY number of active log files, when DB2 stops
    Florin, this doesn't block logs archiving - when an active log is full DB2 starts archiving of this log, but this log can be still active.
    The situation you described can lead to the growth of number of active logs, but not to problems with their archiving.
    To avoid such problems you can use max_log and num_log_span db parameters described here: Configuration parameters for database logging
    Regards,
    Mark.

  6. #6
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    You are right. I had the (wrong) impression that DB2 does not archive a log file that contains active transactions. I've just learnt something new.
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

Posting Permissions

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