Delete old transaction log files in Exchange 2010

Hi,

As the first post, I would like to share the world on how to delete the old transaction logs in an Exchange Server. Before starting, one should understand what transaction logs are. The transaction logs simply are logs of what all activities an Exchange Server has done. These logs are very important because, in the event of a recovery the logs will be very much helpful for the database to recover. Also, the exchange database will be committing (Saving) all the activities one by one at a time. So, what happens if 100 users tries to send out a mail at a time? Would you expect the database to save the activity one by one and send the mails? No way……. The mails will be sent then and there. The activities will be saved in the transaction logs. The database will commit the logs one by one……….

These logs can eat up a lot of space from the Exchange Server. Microsoft recommends not to manually delete the logs. The backups will be able to do that. In fact, if you have an Exchange aware backup, you have the option to tell the backup solution to save the logs, and flush the old logs. But, sometimes if the backup is failing………. The logs will not be committed, and the disk space will be full. The mailbox database will be dismounted automatically. The server will not respond. All the top guns, who have their mailbox on your server will be freezes. You need to recover as soon as possible…. One option is to run the backup manually, so that the backup job can flush the old logs, and free the space. But, you don’t have time.

The last resort is to manually delete the logs.

Requirement:

1. You must be a Server wide administrator

2. You must know the folders where

a. Microsoft Exchange is installed
b. Transaction logs are saved in the server (Say, C:\MDBDATA\MDB01)

Step 1. Open an elevated command prompt, navigate to the ‘bin’ folder in the directory where the Exchange server is installed. It can be in ‘C:\Program Files\Microsoft\Exchange Server\V14\bin’.

Step 2. Use the eseutil command.

Open the folder in which the database transaction folders are saved. There will be a file with the extension ‘.chk’. This file will keep track of the log file up to which the mailbox database has committed.

C:\Program Files\Microsoft\Exchange Server\V14\bin> eseutil /mk “C:\MDBDATA\MDB01\E00.chk”

The result will be having a value like
Checkpoint: (0x4B1D,FFFF,FFFF)

Only the first parameter will be our interest.

0x4B1D

Step 3. Open the folder in which the transaction logs are saved. Arrange the files on the basis of the ‘Modified Time’. Find the logfile, whose name ends with 0x4B1D.

Step 4. Now, you can delete all the log files above the one identified in Step 3.

After manually deleting the old file, initiate a full backup manually. Because, both incremental and differential wont be of any use at this time, since the log files were deleted by you.

Hope this will help you in a very crucial situation. Please feel free to send in you comments to tomjacobchirayil@gmail.com.

 

 

 

Advertisements

16 thoughts on “Delete old transaction log files in Exchange 2010”

  1. thank you Tom,,but i think you need add to that dismount the database before doing start to delete , however i did your steps..many tanks.

  2. Thanks alot, I’ve been looking for something similar to this for a while. Keep up the good work 🙂

  3. I’m having a problem om the step 2., it returns the error -1022 when using the eseutil command, do you know how to fix it?

    Thank you

    1. Please check the free space that is available in your server. Make sure that you have atleast N GB of free space in your disk drive, where the database resides, (where N is the size of your mailbox database)

  4. I have did the steps as instructed but the checkpoint value is 585D2 and i can only see 585D1.log I’m kind of confused now

  5. You state: “After manually deleting the old file, initiate a full backup manually. Because, both incremental and differential wont be of any use at this time, since the log files were deleted by you.”
    Two questions:
    First- If we move the committed log files to another volume and then run a Backup of Exchange, will the Backup be good?
    Secondly- If we move the log files, backup Exchange with a VSS Application aware provider, such as VEEAM, and then move the log files back into the log folder where they once resided now that we have enough space, will the VSS backup process those log files correctly?
    Thanks in advance,
    -Scott

    1. If you have Veeam application aware backup, even before deleting the logs you can try to run the veeam job (If the job is configured to truncate logs). This would automatically purge the logs.

      Veeam backup would be good enough enough to allow you for a granular recovery if you have a successful application aware backup. If the backup is successful, then you dont have to copy the log files back.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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