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 > Managing Archival Logfiles within HA cluster

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-19-09, 11:58
bulump bulump is offline
Registered User
 
Join Date: Oct 2009
Location: Calgary, AB Canada
Posts: 37
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?
Reply With Quote
  #2 (permalink)  
Old 10-19-09, 13:12
bulump bulump is offline
Registered User
 
Join Date: Oct 2009
Location: Calgary, AB Canada
Posts: 37
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?
Reply With Quote
  #3 (permalink)  
Old 10-19-09, 21:00
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #4 (permalink)  
Old 10-20-09, 09:21
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
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.1.0.2 os 5.3.0.0
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