purge Exchange server logs

http://ilantz.com/2011/10/26/how-to-manually-purge-exchange-server-logs-clean-and-easy/

How to manually purge Exchange server logs – clean and easy

Posted on October 26, 2011 by Ilan Lanz (Ilantz)

7 Votes

Hi Again !

I often get calls and questions regarding backups and Exchange Server, since ever this issue is not always working as required or as you would expect, but that’s off-topic

One of the most common stories is that without a working Exchange Server backup when you perform massive mailbox moves, transaction logs will get piled and fill up the volume or disk that they reside in. and then panic starts, “hey my databases were dismounted…” then of course the administrator realizes that the space on the log drive or volume has indeed ran out and now he needs to figure out what to delete.. and here’s where this post comes in…

So how can you delete or purge Exchange server logs without any risk ? well, in simple – you cannot, because the whole idea of restoring an Exchange or for this matter any transactional database requires you to have a first – “full” backup of the database itself and all transaction logs that were generated since the the date of the database creation date, or the last “successful” “full backup”.

Now here’s a nice method to “fake” a “full backup” or an on-demand transaction logs purge when you see you will be soon out of space, using the Exchange VSS writers and the diskshadow utility (available with Server 2008 or 2008 R2) . This procedure also “proves” that a VSS backup for your Exchange Server will work fine.

note: This method was tested on an Exchange server with Locally Attached Disks, not storage attached LUNs.

Use this method on on your risk. You should preform a “Full Backup” right after this process is done.

This example will show you how to purge the logs for a database that is located on Drive D. we will “fake backup” drive D and this will trigger the logs to be purged.

  1. Open Command prompt
  2. Launch Diskshadow
  1. Add volume d:
  2. Begin Backup
  3. Create
  1. At this step you should notice the following events in the application log indicating that the backup was indeed successful and logs will now be deleted.End Backup

Here’s some screenshots from the process:

http://ilantz.com/wp-content/uploads/2011/10/diskshadow.pnghttp://ilantz.com/wp-content/uploads/2011/10/diskshadow.png

The Diskshadow example screenshot.

http://ilantz.com/wp-content/uploads/2011/10/ese-event-id-2005.pnghttp://ilantz.com/wp-content/uploads/2011/10/ese-event-id-2005.png

ESE – Event ID 2005 – Starting a Full Shadow Copy Backup

http://ilantz.com/wp-content/uploads/2011/10/msexchangeis-event-id-9811.pnghttp://ilantz.com/wp-content/uploads/2011/10/msexchangeis-event-id-9811.png

MSexchangeIS – Exchange VSS Writer preparation.

http://ilantz.com/wp-content/uploads/2011/10/ese-event-id-224.pnghttp://ilantz.com/wp-content/uploads/2011/10/ese-event-id-224.png

ESE Event ID 224 – Logs are now purged

http://ilantz.com/wp-content/uploads/2011/10/msexchangeis-event-id-9780.pnghttp://ilantz.com/wp-content/uploads/2011/10/msexchangeis-event-id-9780.png

MSExchangeIS Event ID 9780 – Backup is now complete.

side note: although this example was tested against Exchange 2010, it should work just as fine with Exchange 2007.

Hope this helps you !

ilantz