Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Location
    Calgary, AB Canada
    Posts
    38

    Unanswered: Managing Archival Logfiles within HA cluster

    First off thanks for my questions about backing up. Now to the next step!

    The best way of removing archived logfiles.....

    I know there are a few ways of doing this out there and I'm still trying to determine the best way to go.

    --Brute force
    --Let DB2 manage it through AUTO_DEL_REC_OBJ/REC_HIS_RETENTN

    I've tested out using AUTO_DEL_REC_OBJ = ON and the PRUNE HISTORY command, but it's not deleting the logfiles associated with the history that is removed. I was under the impression this was the case. The only way I saw it happen was to go to into the history of the recent backup, note the beginning logfile and the explicitly PRUNE LOGFILE PRIOR TO....

    Does DB2 effectively manage the archive logfiles? I've read that it did, but I'm not seeing it...

    Also, any idea on how to replicate the deletion of the archive logfiles on the STANDBY server (within a HA cluster)? In order to use PRUNE you must be connected to the database, which is this case can't be done. Looks like the only alternative would be the brute force method: find . -name S*.log -mtime <n days> | xargs rm

    Any suggestions?

  2. #2
    Join Date
    Oct 2009
    Location
    Calgary, AB Canada
    Posts
    38
    Also....

    Can someone explain why these log files are being accessed out of order?

    ll /db2i1_home/db2i1/NODE0000/SQL00001/SQLOGDIR
    total 2566448
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:26 S0000040.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:32 S0000041.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:40 S0000042.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:42 S0000043.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:47 S0000044.LOG
    -rw------- 1 db2i1 db2admin 75104256 2009-10-19 08:13 S0000045.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-19 10:52 S0000046.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:21 S0000047.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:23 S0000048.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:25 S0000049.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:28 S0000050.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:37 S0000051.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:37 S0000052.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:37 S0000053.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-16 17:37 S0000054.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-19 08:09 S0000055.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-19 08:09 S0000056.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-19 08:09 S0000057.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-19 08:09 S0000058.LOG
    -rw------- 1 db2i1 db2admin 134225920 2009-10-19 08:14 S0000059.LOG

    I backed up the database this morning, and included logs, so that's why #45 is small. So the new active log file is #46, so...why are there files in 50s that were created last Friday?

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I am completely confused about your questions. DB2 archives log files (when not using circular logs) using LOGARCHMETH1 and 2 (if you want mirror archives). Then you have to write a script to delete the archive logs older than a certain date (usally older than your last two auto scheduled backups is fine for most people, unless you want to restore a much older backup and roll-forward to a point in time before your last two backups).
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    Do a db2 get db cfg and it will tell you the oldest file that is still utilized by an application. If the file you are reffering to is listed or newer then what is listed it means that there is a job out there that is still using it. Be it that it hasn't commited its work, or still processing.
    --
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows

    DB2 v9.7.0.6 os 6.1.0.0

Posting Permissions

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