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