Deleting DB2DIAG.LOG

I have had a number of instances where the DB2DIAG.LOG, located under

“C:\Documents and Settings\All Users\Application Data\IBM\DB2\DB2COPY1\DB2”

would grow up to a 4GB file.   When this happened, it usually caused our .NET DB2 database handler applications to begin throwing errors and hanging because DB2 was having write issues.

Simply trying to delete the log was problematic since many times it was in-use and typically required us to stop a lot of other programs…

A quick and easy way to roll the log and start fresh is to issue a “DB2DIAG –A” command from a DB2 Command Window.

db2-CmdWindow

DB2Diag

As you can see above, my 12GB DB2DIAG.log file was rolled into a db2diag.log_2012-04-18-12.46.01 file.

Schedule this command to run weekly or whatever and you’re golden.   The only other thing to keep in mind is you may want to schedule a delete script to remove any old rolled log files….

Hope this helps!

Other posts of interest

This entry was posted in DB2, Troubleshooting. Bookmark the permalink.

2 Responses to Deleting DB2DIAG.LOG

  1. Revathi says:

    the information on this page is really helpfull but can you please provide scheduled script for removing any old rolled log files. thank you in advance.

  2. Pingback: Accessing Remote DB2 Databases from DB2 Control Center | myblog4fun

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>