Clearing Exchange Server log files

In the Exchange Server environment, the database transactions are first written to a log file and then written to the database file. Once the transaction file reaches a certain file size, the transaction file is renamed and a new transaction log file is generated. Over time the transaction log can accumulate and take up a lot of disk space on your server. 

There are two ways to get clear the Exchange Server log files. First is to run a backup on the Exchange Server and the second way is to enable circular logging.

Windows Server Backup

With the Windows Server Backup method, you commit the transactions and flush the logs (the logs being the piece that takes up the space). This ensures the data can be recovered, the piece of the system consuming your drive space is cleared, and you will have a backup of your data.

The nice thing about this approach is that all you have to do is create and regularly schedule the backup and let it run. In the act of completion of a backup, the Windows Server Backup tool will flush the logs.

Windows Server Backup is quite simple to set up, and there is no special step necessary to set up the flushing of the Exchange logs. By creating the scheduled backup using the Windows Server Backup Wizard (Figure A), you should be good to go.

Figure A

There is already a backup running to flush the Exchange logs. (Click the image to enlarge.)

I highly recommend scheduling this backup to run at a time when Exchange isn’t going to be in heavy usage. Depending on how much data the server has, this backup can take quite a while, so make sure you schedule the backup with plenty of time to complete before the start of the next business day.

This method of flushing the logs does not require any further work on the Exchange server–in particular, you do not have to make any changes within Exchange; for many admins, that makes this option the most logical and efficient. This is also the best option if you know you will only need to recover data up to the last backup. If you know you will need to retain more data than what was saved in the last backup, this is your best and possibly only option for saving spacebecause, even though circular logging does a great job of keeping your drive space free, it does so with a price.

Circular logging

In the standard transaction logging used in Exchange 2010, a database transaction is first written to a log file and then written to a database. When that log file reaches one MB in size, it is renamed. After the previous log file is renamed, a new log file is created. This cycle continues and over time results in a set of log files. These files remain on the drive and can accumulate until there is no space remaining on the drive; this can cause a lot of problems.

You can avoid this issue by using the circular logging feature, which allows Exchange to overwrite transaction log files once the data contained with the log file is committed to the database. This method saves a lot of space, but you can only recover data up to the last backup. If your business requires the retention of multiple weeks, months, or years of Exchange data, circular logging is not the best method for you.

If circular logging is the method you need, here’s how to enable the feature:

  1. Log on to your Exchange server.
  2. Open the Exchange management console.
  3. Expand the Organizational Configuration.
  4. Click Mailbox.
  5. Select the database for which you want to enable circular logging.
  6. Click Properties.
  7. Click Enable Circular Logging (Figure B).
  8. Click OK.
  9. Open the Services tool, search for Exchange Information Store, and restart this service. Circular logging will now be in effect.

Figure B

If you change your mind, you can always go back and disable circular logging.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s