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!
Subscribe to:
Post Comments (Atom)
Microsoft says to "move" your files first... just in case. I think that might be wise.
ReplyDeleteThanks, this really helped me out. And yes, definitely move first
ReplyDeleteThanks for this post. This really help me to retrieve my exchange 2010 server disk space.
ReplyDeleteAwesome!! helped a lot, thanks :-)
ReplyDeleteExcellent
ReplyDeleteThanks.
Good job this is a nice post for reading this is my first time at this blog and really like what i m reading thanks i will keep visiting.
ReplyDeleteAwesome!! helped a lot, thanks :-)
ReplyDeleteSyed Rehan Ali
Does this also work for Exchange 2013? Can't find any references for that.
ReplyDeleteTest it.
ReplyDeleteClint, you're a genius :) It worked like a charm
ReplyDeleteNice Article you save my day :)
ReplyDeleteThank you Clint for an excellent article! I'm glad I learned this today.
ReplyDeleteThis saved the day! Thanks for the post!
ReplyDeleteif this is a DAG environment do you remove the LOG files from both DAG members? or only one?
ReplyDeleteI am in the middle of copying my logs to another partition as we speak. I think this will fix my issue as my database was dismounted on its own and the log volume was full. I'm new to exchange management. Is this really the "hands on" maintenance that is expected to be done on the logs for this server? I feel like I am missing something that will clear things out after database checks are made. I read circular logging is not recommended.
ReplyDeleteThx for the post. It should help. Any other info?
Rob
Logs are flushed when your database is backed up. Get a backup solution in place and you only need to worry about this when the backup fails to flush the logs.
DeleteRegarding the query about DAG environments, transaction logs are independent on each cluster node. Cleaning up the transaction logs on one node will not cleanup the logs on other cluster nodes.
ReplyDeleteThank you for the simple walkthrough, worked perfectly!
ReplyDeleteHas anyone tested this on Exchange 2016?
ReplyDeleteThis works fine for Exchange 2016 Raymond.
ReplyDelete