Results 1 to 14 of 14
  1. #1
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655

    Unanswered: Turn On Logs Archieving

    Hello,

    On one of DB2 V9.5.5 on Win2k3 systems I need to turn log archieve on.
    That will be used to replicate logs to DRP server.

    I understand that I need to update db cfg for the database with DISK:H:\archieves value.

    Anything else needed to be taken care of. This is our production server and I am doing this first time.

    Please advise, I have tested on spare server where it seems to have turned on, but could not see a log archieved, may be because of no activity.

    Regards

    DBFinder

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Yes, you need activity for a log to be archived. How much depends on the size of the log files.

    After you set LOGARCHMETH1, you will need to bounce the database. You may have to do an offline backup also.

    ANdy

  3. #3
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Alright, I agree.

    Well, may be it will ask for Restart and/or OFFLINE backup, but with my test system it did not require any restart or offline.

    Could this be beacuse it is not heavily used (test system). I was expecting need to restart DB2. But change was adapted without a requirement !

    Any body may have a condradicting experience ??

    Thanks Winner,

    Regards

  4. #4
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Winner,

    I might be missing some other setting. The test database where I have set up archieving does not seem to be acrcieving.

    Regards

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    1. Connect to the database.
    2. do: "db2 get db cfg show details". Look to see whether it has taken affect or is still pending.


    You will need to take a backup before you can have full use of the database. The change to logarchmeth1 takes place when the database is deactivated (no connections to the database), and then do a backup after that.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  6. #6
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Yes,
    I had checked, the value had changed. So I assume that we do not need to take offline backup. Because I need to plan this for production, I must confirm this. On test database, I have restarted db2, still archieving did not show started.

    Still surprised

    regards

  7. #7
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    What do you mean that "archiving did not show started"?

    When you turn on archiving, DB2 needs a reference point to begin the rollforward capabilities for the DB. It needs an offline backup for this.

    Since turning it on, have you tried doing anything to the DB? It should be in a backup pending state.


    Andy

  8. #8
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Not Really,

    I tested, even took offline backup. Did not work.

    Then I used Logging wizard. This turned logging on effectively, without having to anything, restart or backup.

    I compared the CFGs , the only difference is user exit for logging. The wizard had set user exit for logging to YES.

    Can some one explain me what user exit for logging is meant for.Basically I did not understand it. How do I change this setting.

    Thanks a lot for help

    Regards

  9. #9
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Quote Originally Posted by ARWinner View Post
    What do you mean that "archiving did not show started"?


    Since turning it on, have you tried doing anything to the DB? It should be in a backup pending state.


    Andy
    Archieving did not start means that logs were not transfered to specified folder automatically !!

    Since turning it on, I am trying doing everything with it. I mean this is my test system, I can make it work hard with any simple script. For instance, I created a test table and inserted about 5 million rows and deleted the same.


    Since now it is on, it takes few thousand rows to show archieveing in action. I can see the Logs being archieved to target.

    Regards


    PS: DB was not in backup pending state
    Last edited by DBFinder; 03-30-10 at 17:46. Reason: PS: DB was not in backup pending state

  10. #10
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by DBFinder View Post
    Archieving did not start means that logs were not transfered to specified folder automatically !!
    Check you db2diag.log file. Whenever an attempt to archive a log is performed, there is usually an entry in there about it. So if you had it turned on properly, you should have gotten the messages.

    Andy

  11. #11
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    I had checked. Update was logged in but nothing other than that.

    Because currently it is on, I am trying to figure out why. I am trying to replicate the problem, so that if this happens with production, I should be able to handle it.

    Thanks for you time anyway,

    regards

  12. #12
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Issue
    ARCHIVE LOG FOR DATABASE
    command.. this will close the log file and archive it to the defined directoyr
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  13. #13
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Was this db using circular logging to begin with?

    If you modify logging from circular to archival (via logarchmeth/userexit/logretain), the db will be placed in backup pending state. Try creating a new db and then enable archival logging - db will be in backup pending state after you restart it.

    In prod, modify logarchmeth1 using command line, terminate all connections and then perform an offline db backup.

  14. #14
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Thanks everyone, I have completed the test study.

    Exactly as Bella said, Switching from circular to archival will need OFFLINE BACKUP.

    Because the subject database is already configured for LOGRETAIN , online backups are done everyday, we won't be required to perform OFFLINE backup.

    Also, tested , DB2 does not require recycle when we change logarchmeth to DISK:. This sets userexit to ON.

    Thousands of thanks for time,

    DBFinder

Posting Permissions

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