Tuesday, November 8, 2011

Flush Transaction Logs in Exchange

This article applies to all versions of Exchange from 5.5 to 2010.

The following knowledge base article gives you all the fruit about flushing transaction logs but I assume you just want to know how to do it right?

http://support.microsoft.com/kb/240145

Your Exchange Logs get deleted when your database backup completes. When your exchange server receives an email it dumps the email to the transaction logs. When the exchange server free's up it then plays these logs into the database. Sometimes Exchange may not have played all the log files into the database, so you cant simply "delete" them.

1. Dismount the all Exchange Mailbox Databases under the Storage Group you wish to clean up.

2. Use the ESEUTIL program to view if all the logs have been played into the Exchange Database.

eseutil /MH database.edb



If all the databases are in a Clean Shutdown or Consistent state, you may remove all the transaction logs. Older versions say "Consistent", New Versions of Exchange say "Clean Shutdown". In my screenshot I'm using Exchange 2010.

Note: If it is not in a "Clean Shutdown" or "Consistent" state, you can use eseutil to reply the log files into the database or remount the database and allow Exchange to replay them.
Caution: Do not delete log files if the state is not "Clean Shutdown" or "Consistent" as you will loose email!

3. Delete all log files including the chk file. The checkpoint file keeps track of which log files have been and have not been played into the database. Since there are no log files anymore, the checkpoint is not needed.

Caution: If your database is in the same directory as your log files be careful you dont accidently delete your edb database file as well!

4. Re-mount your exchange databases in your storage group. This will automatically create a new checkpoint file ready to go!

No comments:

Post a Comment