Exchange: How to use ESEUTIL to repair/recover Exchange Databases?
Health of a database:
Run Eseutil /mh “Path of the database” and check the state of the database.
1. State = Clean Shutdown
Move log files from the Transaction logs folder location and mount the database
2. State = Dirty Shutdown
Ensure that the log files required are in a clean state by performing Eseutil /ml “Path of the log files\log prefix” command
If the health status is ‘OK’ perform the Soft recovery with the command Eseutil /r <Log Prefix> /l “Path of the log files” /d “Path of the database”
Mount the database after completing the operation
Sometimes the ‘/i’ switch is also used when the operation has failed to complete.
Hard Recovery
In the situation where log files are missing, restore from a successful backup or perform a hard repair.
Once the restoration completes, a file named restore.env along with the logs that were backed up without being committed to the database will be created in C:\Temp
Perform Hard Recovery by the command Eseutil /cc “Path of the restore.env containing folder” restore.env file will be deleted after the completion of hard recovery.
If we miss the sequence of logs, the recovery will fail and should use the command eseutil /cc “Path of the restore.env folder” /t to recover the database.
Hard Repair
Use eseutil /p “path of edb file”
Offline Defragmentation
Once Hard Repair Completes finishes we will need to defrag the databases:
Eseutil /d
You must have available hard disk space equal to 110 percent of the size of the database that you want to defragment.