Read time 6 minutes

Summary: Disruption in email flow, problems in viewing your emails, not being able to mount or dismount the database, etc., are signs that your database is not in the ideal state. The reason could be a minor inconsistency issue or corruption in the EDB file. Let’s try to repair the Exchange Server with the ESEUTIL tool. If the issue is due to corruption, we will also discuss an Exchange recovery tool.

Exchange Server errors are some unavoidable truths that each Exchange administrator must face routinely. Due to some hardware or software issues, the integrity of the mailbox is affected, and the server shows an error with an error number. An experienced administrator may recognize the cause of error and remove it manually. But, for complicated errors, there is an inbuilt repair tool that can scan the EDB file and perform some basic recovery. ESEUTIL is one of the Exchange inbuilt tools that help in repairing corrupted or damaged Exchange Server. Exchange admins often use this tool to keep the server healthy and running.

What is ESEUTIL?

It’s a free tool from Microsoft that database administrators or anyone with authority can use to find and repair issues in the EDB file. You can find ESEUTIL, a command-line utility, in the “Exchange Server\V15\Bin\” directory. Using this tool, you can perform database repair, offline defragmentation, an integrity check for database, fix JET ENGINE or Extensible Storage Engine errors, etc.

Before using it, you must make sure that the Exchange database is dismounted, and there is enough disk space (minimum 1.2 times of the database’s file size) available on the system where you will repair EDB files.

The Exchange administrator can run ESEUTIL tool to check the consistency of the database and its health. It can diagnose the functional issues and several health-related symptoms of the Exchange database. Apart from corruption, ESEUTIL can recover the database items after an abrupt Exchange shutdown, spyware attacks, server crashes, deleted transaction logs, etc. It can recover data even when the backups are not available or deleted.

Instant Solution

Get Kernel for Exchange Server recovery software to recover data from corrupt or damaged Exchange EDB files and save it to PST without Outlook.

Things to Do Before You Start EDB File Repair

Complete these prerequisites before you perform any operation on the database.

  • Backup the mailboxes: Soft recovery with ESEUTIL is safe. But if you perform a hard recovery (in case of severe corruption), it will cause data loss. To avoid permanently losing users’ data, backup the mailboxes. Either use the Exchange Admin Center to export mailboxes to PST, or if the database is dismounted, use an EDB to PST converter tool.
  • Switch the active database: If the corrupt database is part of a Database Availability Group (DAG) and is the active database, then switch to a passive database. This will prevent any downtime. However, if the database has no copies, inform your users regarding the downtime.
  • Verify storage space: If the database size is 100 GB, then make sure that the system on which you will perform the repair process must have at least 120 GB of free space available.

How to Repair EDB File with ESEUTIL?

Now, let us discuss how you can manually repair Exchange database corruption with the in-built utility – ESEUTIL. To repair EDB files, you must perform the following five operations, one after another.

  1. Check the consistency of Exchange database
  2. Check the required logs status
  3. Perform recovery (soft or hard)
  4. Perform defragmentation
  5. Mount the database

To execute the above-mentioned tasks, you require the help of several switches. The following table will inform you about various ESEUTIL switches.

Switches Functions
/G Checks the integrity of the selected database.
/K Runs the checksums on database file, log files, and checkpoint files.
/D Defragments the whole database and saves storage by removing the white spaces.
/P Repairs the corrupt offline database files and discards such pages that it cannot repair.
/R Places the database in a consistent state by replaying the transaction logs.
/M Provides a display of headers of database files, transaction logs, and checkpoint files.
/C Conducts a hard recovery of database after recovering data from backup files.
/Y Copies the large EDB files quickly.

Now, open the ESEUTIL tool. Depending on your Exchange Server version, you can find the tool at:

For Exchange 2013 and later: C:\Program Files\Microsoft\Exchange Server\V15\Bin\

For Exchange 2010 and earlier: C:\Program Files\Microsoft\Exchange Server\Bin\

Open the tool as an administrator and perform the tasks given below.

Check the consistency of the Exchange database

Start by checking if the database is consistent or not by running this command:

eseutil /mh

There can be two outputs – either it shows the ‘Clean Shutdown’ state, or it shows ‘Dirty Shutdown’ state. For a clean database shutdown state, no action is required. Mount the database and you are done.

When the database shutdown state is Dirty, follow the next step.

Check for the Required Logs Status

If you found the Dirty database shutdown state, check if the ‘Required’ log files are present. To check the status of Required log files, run the command –

eseutil /ml

The output results will show if the log files are healthy or not.

Perform Recovery (Soft or Hard)

If the output of the last command shows that log files are healthy, perform a soft recovery with the command –

eseutil /r /l “log files path location” /d ” database path location

After that, check database status, if it is healthy mount it.

In case you do not have the log files, you have to perform the hard recovery. But let me warn you, this will delete all the corrupt pages from the database. Use the command below only when there is no other way. To repair EDB with hard recovery, run this command:

eseutil /p

Perform Defragmentation

After that, defragment the database offline file (EDB) to reorganize the information stored in the database by removing or eliminating the empty spaces in the database. Run this command –

eseutil /d

Mount the database

Once the defragmentation process is complete, mount the database using the Mount-Database cmdlet in Exchange Management Shell (EMS).

This is how we performed the manual database recovery with ESEUTIL command. If the database is mounted successfully, the repair is successful. And, if not, then there might be a case of severe corruption in the database.

Limitations of the ESEUTIL command line tool.

  • The need for technical expertise
  • Chances of incomplete recovery
  • The need for disk space
  • Lengthy procedure
  • May result in permanent data loss.
  • May not give satisfactory results in case of severe corruption.

What To Do If ESEUTIL Fails?

The native free tool has limitations on what it can repair. When the database is severely damaged, using the ESEUTIL tool will only waste your time and hurt the database even more. In such a case, use a professional Exchange recovery tool.

A dedicated Exchange database recovery tool is specially designed to read highly corrupt databases and rebuild the damaged pages. One such tool is Kernel for Exchange Server. It allows you to repair multiple EDB files and provides the option to either save the recovered data to an offline Outlook PST file or directly restore the mailboxes to an Exchange Server.

Final Words

The ESEUTIL utility is your first line of defense against corruption and other issues in the EDB files. However, the free tool cannot fix everything. In case your database is severely corrupted and cannot be repaired with the free utility, you must use our Exchange recovery tool. It supports EDB files of all sizes and even allow you to migrate EDB to Live Exchange after recovering data, if required.

Frequently Asked Questions

Q. What is the safest way to repair a highly corrupt Exchange database without data loss?

Ans. The most reliable method is to perform database recovery with a backup file. However, if the backup file is old, data that was added after the backup file was created will be lost. An alternative way is to use a professional EDB repair tool that can restore your mailbox items without relying on log files or a backup.

Q. How to avoid data loss in Exchange Server?

Ans. You can follow these tips:
1. Prepare a disaster recovery plan for Exchange
2. Have multiple backups and follow the 3-2-1 backup rule.
3. Use the Database Availability Groups to have multiple passive copies.

Q. Is it compulsory to defragment the database after repairing it?

Ans. It is not mandatory. Running the eseutil /d command is recommended only when your database has white spaces in large quantities, or you have performed a hard recovery (/p).

Kernel for Exchange Server
Related Posts