Exchange Database Recovery & Repair Using ESEUTIL Commands

Every Exchange administrator is aware of ESEUtil. It’s the magic command-line tool that can do an exceptional job in Exchange database recovery by repairing a corrupt Exchange database. While it is able to fix minor glitches in the database, there could be some instances where it fails to work. That said, using ESEUtil is what most experts suggest as the first step towards Exchange database repair. Follow, Step by Step guide for “Exchange server repair using ESEUTIL”

In this article we’ve brought together all there is to know about ESEUtil. So if you think you need to better acquaint yourself with it, do read on.

What is ESEUtil?

ESEUtil is a command-line tool that works with the Extensible Storage Engine (ESE) of the Exchange Server Database. This utility, as already specified above, ESEUtil is used to view, repair, recover, integrity check, and modify damaged or corrupted Exchange databases. By default, the ESEUtil tool is location in the Bin directory of your Exchange installation. For most systems the path looks something like:

<SystemDrive>:\Program Files\Microsoft\Exchange Server\Bin

ESEUtil creates a new temporary database and write all fixed information to it in order to complete most of its operations. As per Microsoft recommendations, before using ESEUtil commands you should have free space of at least 1.2 times the size of your database (the size of the data in the database).

To know the size of your database search for event IDs 1221 and 1224 in your database’s event log. Then subtract the white space reported from the total file size and the resultant will be the database size.

For an example, suppose your database size is 100GB. Now on searching for event ID 1221, the database event log reports a white space of 25GB, then your actual database size is 75GB and you must make sure that you have about 90GB (75 * 1.2) of free space Practices.

Now that you have a fair idea of what ESEUtil tool is and what are the prerequisites to use it, let us move to the syntax and switches.

Syntax & Commands of ESEUtil

 To start using ESEUtil all you need to do is open the command prompt on your computer and then type –

eseutil /?

As a result you will see all the switches that can be used with it and their purpose. Here’s a list and explanation of some of the ESEUtil switches:

  1. Checksum: eseutil /k

 This command verifies the checksum of the pages in the log files, checkpoint file and Exchange database. The syntax this command is:

eseutil /k <filename>

Where you’ll need to replace <filename> with the name and path of the file whose checksum you wish to check.

  1. Defragmentation: eseutil /d

Defragmenting the Exchange database involves discarding the whitespace in the database to reduce its size on the disk (reducing the size of the EDB file). An offline Exchange defragmentation allows recovery of the whitespace discarded. For this, you need to create a new database and then move users to it. An online defragmentation is run every night and differs from the offline one in that it doesn’t allow recovery of the discarded whitespace. The syntax this command is:

eseutil /d <DBname> [option]

Note: This command is not recommended to be used as a regular maintenance task.

  1. File Dump: eseutil /m

As the name suggests, this switch displays database file headers, page header information, transaction log files, space allocation with metadata, and checkpoint file. The syntax this command is:

eseutil /m

  1. Integrity: eseutil /g

 Through an integrity check a DBA can verify if the Exchange database has any inconsistencies. This command allows page level and ESE level database integrity check. The syntax for this command is:

eseutil /m mode-modifier <filename> [options]

Where you’ll need to replace <filename> with the name and path of the database file whose integrity you wish to check. In place of <mode-modifier> you can use one of the following:

  • h – dump database header (default)
  • k – dump checkpoint file
  • l – dump log file or set of logs

Note: Application level integrity check is not possible with this command. If you need to check application level database integrity, you should use ISInteg tool.

  1. Recovery: eseutil /r

 Database recovery implies playing transaction log files into a database to restore internal database consistency. There are 2 kinds of Exchange server recoveries:

  • Hard Recovery – This kind of recovery can be done using the Restore mode (/c) in eseutil. A hard recovery happens when a transaction log replay process occurs after restoring a database from online backup.
  • Soft Recovery – A soft recovery happens when a transaction log replay process occurs when a database is re-mounted after an unexpected stop. Also, if transaction logs are replayed into an offline file backup copy of a database, that too is a case of soft recovery.

The syntax for this command is:

eseutil /r Enn

Here Enn indicates the log prefix of the transaction logs that you wish to play into the database.

Note: For this command to work the databases to be recovered should be in their original path locations. Also, only when this command is run from the directory (folder) where the transaction log files exist, will it work.

  1. Repair: eseutil /p

This command repairs a corrupt offline Exchange database by discarding the database file pages that cannot be repaired. That is, it simply sheds the irreparable pages from the EDB file. Hence, before using this command you should absolutely take a backup of the entire database. The syntax for this command is:

eseutil /p <DBFileName.edb>

This command can fix individual database tables, however, it doesn’t maintain links between them. To check and repair relationships between them in repaired mode, you should use ISInteg tool.

Guaranteed Solution:

 So that’s all you need to know before you can start using ESEUtil command. But as you would have gathered, to use ESEUtil, you’ll need to exercise a lot of caution and it may not work with complex corruption cases. To repair severe corruptions and other complex problems in an Exchange database, try Stellar Repair for Exchange Tool. This software is specially designed to repair and recover Exchange database or user mailboxes from severally corruption.

To download and check the functionality of this Exchange database repair tool:

You may also like to read:

6 Comments

  1. David Dang November 9, 2015
  2. James Palmer November 20, 2015
  3. Louis Nicholson November 20, 2015
    • admin November 23, 2015
      • Jack Williamson May 6, 2016

Leave a Reply

Your email address will not be published. Required fields are marked *