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 > Log files

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-14-05, 11:51
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
Log files

I need to clean up the log files created by DB2 and OS on Linux and AIX servers. Can someone tell me which log files and their location should be cleaned up after reviewing/archiving ?. I know Smith log file is one of them on AIX..........It would be the best if I can have a script to clean them periodically...........

Thanks for any help.
Reply With Quote
  #2 (permalink)  
Old 12-14-05, 12:03
sun4u sun4u is offline
Registered User
 
Join Date: Dec 2005
Posts: 18
which the db2 version are you on ?
Reply With Quote
  #3 (permalink)  
Old 12-14-05, 12:03
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Which version of DB2 are you on ?
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 12-14-05, 12:09
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by mdx34
I need to clean up the log files created by DB2 and OS on Linux and AIX servers. Can someone tell me which log files and their location should be cleaned up after reviewing/archiving ?. I know Smith log file is one of them on AIX..........It would be the best if I can have a script to clean them periodically...........

Thanks for any help.
list history backup all for DBNAME

This will tell you which logs are required for which backup images.

ie:
Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
-- --- ------------------ ---- --- ------------ ------------ --------------
B D 20051214010002001 N D S0037889.LOG S0037889.LOG

For my backup above, I need S0037889.LOG and later to get to the current point in time. If I have 100% confidence in that particular backup then I can remove any logs before S0037889.LOG. Usually we keep a few weeks worth just to be sure, you never know when someone needs some data from an old point in time...
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #5 (permalink)  
Old 12-14-05, 13:07
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I think he means logs like db2diag.log and such.

They are in $HOME/sqllib/db2dump, where "$HOME" is the instance owner home directory.
Reply With Quote
  #6 (permalink)  
Old 12-14-05, 13:26
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
I am sorry....I have been away for a while.

The log files that grow over time. What ever they are.........Either the DB2 process creates or the operating system creates.........I am not worried about the software installation log files.

Thanks.
Reply With Quote
  #7 (permalink)  
Old 12-14-05, 13:26
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
DB2 version 8.1 & 8.2.............
Reply With Quote
  #8 (permalink)  
Old 12-14-05, 13:36
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by mdx34
The log files that grow over time. What ever they are.........Either the DB2 process creates or the operating system creates.........I am not worried about the software installation log files.
It's a bit more complicated than that... my post above addresses transaction logs, every INSERT/UPDATE/DELETE to db2 is logged for integrity. If you crash, you can restore and replay the transactions in the logs so you don't lose data.

Diagnostic logs are where n_i said.
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
  #9 (permalink)  
Old 12-14-05, 13:48
mdx34 mdx34 is offline
Registered User
 
Join Date: Oct 2004
Posts: 238
I am sorry..........No I wasn't talking about transaction logs...........

Thanks.
Reply With Quote
  #10 (permalink)  
Old 12-14-05, 19:37
wangzhonnew wangzhonnew is offline
Registered User
 
Join Date: Nov 2005
Location: Toronto
Posts: 65
get the timestamp of the backup as a reply above, and you can use 'prune' command to remove the archived logs
__________________
IBM Certified DBA for DB2 UDB
IBM Certified Database Developer for DB2 UDB
DB2 Tech Support, IBM Toronto Software Lab
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