Summary: The ESEUTIL command line utility is Microsoft’s built-in mechanism for fixing Exchange database mounting problems. In this article, we’ll discuss ‘how to run ESEUTIL /R in Exchange Server 2003/2007/2010/ 2013/2016/2019’. Though this utility works in most cases, it sometimes fails to achieve the desired outcome, triggering the need to look for more powerful repair techniques.
A damaged or corrupted Exchange database can be repaired or restored from backup by using the command-line based ESEUTIL utility. ESEUTIL can work with EDB as well as log files associated with an Exchange Mailbox Database. It can be used on one database at a time. An Exchange administrator, who is aware of the way this utility works, can use it to perform several complex tasks such as database repair, offline defragmentation, database integrity checks, etc.
Common ESEUTIL Switches
Typically, ESEUTIL is used in combination with different switches which can alter the way it works. The most commonly used ESEUTIL switches include:
/p – Performs Hard Recovery and purges any corrupted data (data loss)
/c – Controls hard drive recovery after the backup restore has been performed
/r – Replays transaction log files to restore the database to the consistent state
This article is dedicated to the third switch (mentioned above) – /r. This option is used to replay transaction log files to restore database consistency by performing a soft recovery. Let’s explore this in detail.
Before starting the recovery process, you need to run ESEUTIL with /mh to identify the problem and the state of database. If the state of database is in Dirty Shutdown (see image below), then you would need to run the soft recovery.
[IMPORTANT]: The word ‘recovery’ must be clearly differentiated from the word ‘restore’. Restore is the act of reinstating database and log files back into place on a server. Recovery, on the other hand, is the act of replaying transaction logs into the database.
Since transaction log files can be replayed by using ESEUTIL /R switch, the operation that is performed by using this option is known as ESEUTIL /R Soft Recovery Mode.
If this fails, you need to perform the Hard Recovery by using the ESEUTIL /P parameter, which will purge corrupted data from the database. This means loss of data and no support from Microsoft if you require the assistance afterwards. To avoid any data loss and safely recover mailboxes and data from corrupt or damaged database, you can use an Exchange recovery software, such as Stellar Repair for Exchange. The software repairs corrupt Exchange database (EDB) files, extracts mailboxes, and helps you import them to your Live Exchange server. You may also save the repaired mailboxes and data as PST. Plus, it also helps you recover deleted or lost mailboxes.
Soft recovery occurs when transaction log replay is carried out on a database that is re-mounted after an unexpected stop, or when transaction logs are replayed into an offline file backup copy of a database. This kind of recovery is done with ESEUTIL by using the /R switch.
Note: ESEUTIL /R command cannot be used to replay log files to a different database. The database must be dismounted.
In the above syntax, ‘Enn’ indicates the log file prefix of transaction logs you wish to replay into the database.
Note: For ESEUTIL/R command to work, it should be run from the folder in which the transaction log files exist. It will work only when the databases to be recovered are in their original path locations.
A checkpoint file lets you resume recovery (replay transaction logs) from an established point rather than from the start. In situations where a complete replay of logs is required, the existence of this file can affect the process negatively. Thus, ideally, the use of the checkpoint file should be controlled during recovery. If this is not needed, just remove it from the command line.
The /L parameter needs to be used when the log path is different, or you are running ESEUTIL from a different location, other than the location where the files are stored.
The /I switch ignores hanging attachments in log files.
In some situations, ESEUTIL utility may fail to achieve the expected results. This can happen if the EDB files have been severely damaged or corrupted. Moreover, as already mentioned, the ESEUTIL hard recovery mode (/p) leaves room for data loss since it discards the database pages that cannot be repaired.
Once the process is complete and when you try to mount the database, check that the database should be in Clean Shutdown state.
If it is not, this means there a serious damage to the database. By using the native tools, you can only restore the database from the last backup, accepting loss of data from the last backup to the time when the database failed.
Before using any inbuilt repair and recovery utilities for the Exchange server, it is important to find out all about them. Also, take a backup of your EDB, STM, and LOG files, before attempting any recovery and repair process. It is not 100% guaranteed that ESEUTIL utility will work. After you run the process, you might still end up with a database which is not mounting or a huge amount of data loss.
Thus, a safer and simpler approach to repair EDB files is to use a trustworthy third-party Exchange recovery software. Stellar Repair for Exchange software repairs online as well as offline EDB files and efficiently restores mailbox contents including emails, contacts, tasks, attachments, etc. The software offers a safe exit window from complex Exchange problems such as “Exchange Server Dirty Shutdown Error”, server crash, fail to mount problems, etc. Its interactive user interface makes working with it extremely easy.
Eric Simson is an Email Platform Consultant and is associated with Stellar Data Recovery from last 6 years. He writes about the latest technology tips and provides custom solutions related to MS Outlook, MS Exchange Server, Office 365, and many other Email Clients & Servers.