Email Repair

How to Repair Exchange 2010 database with Eseutil Switches

Author: Ravi Singh | Updated on November 23, 2020 | Email Repair | Repair Exchange Database | 6 min read

Among the different tasks an Exchange Administrator is expected to perform daily, the tricky one is to ensure that the server keeps running without glitches. And no matter how simple it may seem, it is not an easy task. Unexpected technical, software or human errors keep cropping up that interrupt the normal flow of activities on the Exchange server. Thus, prompting the Exchange administrator to take immediate measures and get everything back to working. Among those measures include the knowledge of handy tools and utilities that can save the day when common fixes don't resolve the problems. This article focuses on ESEUTIL - one of the most widely used inbuilt command-line utilities that can be used to repair the Exchange 2010 database in situations of Exchange database errors. Further, the article explains the process to repair corrupt, inconsistent or damaged Exchange database by using an Exchange recovery software when Eseutil fails to fix the problem.

ESEUTIL and Associated Switches in Exchange 2010

ESEUTIL is a command-line utility, aimed at repairing minor issues within the Extensible Storage Engine (ESE) or Jet Engine of Exchange database. The utility is located in the Bin Directory and is used in database operations such as integrity check, offline defragmentation, database repair, checksum test, etc. It is automatically installed, along with the Exchange Server. It works on the dismounted database. There are several switches that can be used with the utility to perform different operations.

Here's a list of ESEUTIL Exchange 2010 switches:

/d – Defragments the offline database to reduce its gross size on the disk by discarding most empty pages and rebuilding indexes.

/p – Repairs corrupt Exchange database by discarding pages that cannot be repaired. This mode can result in data loss. Moreover, it fixes individual tables but not the links between the tables.

/c – Displays restored log files and control hard recovery after restoration from legacy online backups.

/r – Replays transaction log files to restore a database to internal consistency.

/g – Verifies page level and ESE level logical database integrity.

/m – Displays database file headers, transaction log files, checkpoint files, page header information, database page allocation, and metadata.

/k – Verifies checksum on all database pages, log files, and checkpoint files.

/y – Performs a fast copy of large files.

Why ESEUTIL is Needed to Repair Exchange 2010 Database?

The ESE or Jet Engine of an Exchange database includes data served in "Pages". In Exchange 2010, each page size is 32 KB. The Exchange database (EDB) file contains multiple such pages.

Whenever a read/write/update operation (or transaction) occurs on the database, it is first written to the memory, then to the log files, and finally to the database. This process is known as Write-Head Logging. For a database to be consistent, all transactions recorded within the log files must be committed to the database (EDB files) before the database is shut down. Only then is the database regarded as "detached" from the log files and in a clean shutdown state. However, if the server shuts down unexpectedly (server crash or due to power failure) while there are still transactions pending to be committed, the database is considered to be "attached" to the log files and in a dirty shutdown state.

In such a case, on restarting, the server performs automatic Soft Recovery where log files are replayed using the Checkpoint file to make the database consistent again. This works in most of the cases. However, if the problem is not fixed automatically, the administrator can manually perform a hard recovery by using the ESEUTIL utility. In cases of page-level database corruption, ESEUTIL comes in handy to correct things.

How to Repair Exchange 2010 Database with ESEUTIL?

Step 1: Run eseutil /mh command to check database status

Step 2: Check the status of log files

Step 3: Perform repair (Soft recovery (/i) or Hard recovery (/p))

Step 4: Defrag the database offline

Step 5: Mount the database

Detailed steps: 

Follow the stepwise instructions to repair the Exchange Server 2010 database by using ESEUTIL:

Step 1: Run eseutil /mh command to check if the database is consistent or not.

eseutil-mh-command

If the database shutdown state is 'Clean', move all the log files from the transaction logs folder and then mount the stores.

clean shutdown

If the database shutdown state is 'Dirty shutdown', check if the log files mentioned as "Required" are available or not.

dirty shutdown

Step 2: Check the status of "required" log files with the command eseutil /ml.  

This command will check the health of all log files at the location.

eseutil edbtest

Step 3: If the log files are healthy, Soft Recovery will put things back into place. Perform a soft recovery with Eseutil /r command:

Eseutil /r /l "Path of the log files" /d "Path of the database"

soft recovery

After completion of the command, mount the stores.

Step 4: In case you encounter JET_errAttachedDatabaseMismatch (error - 1216) after a few seconds, run soft recovery with /i switch at the end to override the EDB-STM mismatch.

Step 5: If log files are not healthy or are unavailable, restore the database from the backup or perform a hard recovery.

Step 6: If you're restoring from backup, a file called restore.env is created at a temporary location, when the restoration completes. This file contains the logs that were backed up without being committed to the backed up database.

Step 7: Take a copy of this temporary folder and store it somewhere safe.

Step 8: Now perform Hard Recovery from the Bin folder with this command: 

Eseutil /cc "Path of the restore.env containing folder" >

Step 9: Now, again check the temporary folder that contained restore.env file. If the hard recovery was successful, the folder would be empty.

Step 10: Now mount the stores successfully.

Step 11: If a valid backup is not available, perform Hard Repair with eseutil /p command.

Step 12: Choose "OK" on any prompt that you get.

Note: When doing a hard recovery, note the prompt as it means that you are accepting data loss.

accept warning

Step 13: This is the complete repair process. Once these steps complete successfully, to finish up, defrag the database offline with eseutil /d command.

eseutil-d-command

Step 14: Now mount and demount the store immediately and then use the ISInteg tool to fix any issues - isinteg –s -fix –test –alltests

Step 15: If Eseutil Exchange 2010 fails to repair database, try Stellar Repair for Exchange software. You can download the software from here:

To Sum It Up

This is the complete process of repairing the Exchange 2010 database using the inbuilt ESEUTIL tool. However, this tool might not be able to fix issues within EDB files in all cases. Moreover, it might result in data loss.

To overcome these limitations, use an automated EDB repair software such as Stellar Repair for Exchange. This reliable application repairs even severely corrupted/damaged EDB files and recovers inaccessible mailboxes within minimum time. The interactive GUI makes it easy to work with and it is compatible with a wide range of Exchange versions. Moreover, the product also offers features such as exporting mailboxes to Live Exchange or Office 365, selective mail recovery, and more. You can check software steps to repair corrupt EDB file from here.

76% of people found this article helpful