Exchange 2013, 2016 Database Repair using Eseutil or Isinteg

Summary: Extensible Storage Engine Utility or EseUtil is a common line-based tool in Exchange Server that helps administrators to recover a mailbox database from inconsistent or Dirty Shutdown State. It is also used to defragment the database, check database status and perform other database management operations. In this guide, we will discuss how to use EseUtil to repair a dismounted, corrupt, or inconsistent Exchange database and mount it back on the Exchange Server.

Exchange Server works on a write-ahead logging technique where the changes made are first recorded in logs, known as transaction logs, and then committed to the database. This is important to prevent excessive disk usage and ensure consistent server performance.

However, if the server shutdowns due to any reason, such as a crash, power failure, etc., before the records in the transaction logs are committed to the database, it can damage or corrupt the Exchange mailbox database. In such situations, the database dismounts automatically and enters the Dirty Shutdown state or becomes inconsistent, preventing users from accessing their mailboxes or sending and receiving new messages.

In this guide, you will learn how to use the EseUtil in Exchange 2013 and later to recover an inconsistent or corrupt mailbox database and mount it back on the server to restore mailbox connectivity.

Using EseUtil and Isinteg to Repair Database in Exchange 2013 or Later

When an Exchange database gets corrupt, there are two common ways to repair or recover the database back to the consistent or Clean Shutdown state:

  1. Restore from Backup: This includes restoring the database content from a recent backup.
  2. Repair: To repair the Exchange database using built-in Exchange Server utilities, such as Eseutil and Isinteg, or the New-MailboxRepairRequest cmdlet.

Both have their own set of pros and cons. For instance,

Although restoring the database from Exchange backup is an easy and fast way to retrieve database components, it may not be successful when Exchange database backup is not up-to-date (obsolete), does not work, or is unavailable.

The next option is to repair Exchange 2013 or 2016 databases via Eseutil or Isinteg. However, these utilities help fix the Exchange database only when the level of corruption is minimal.

One can use Eseutil to recover the database by performing soft or hard recovery, depending on the damage to the database.

In addition, the EseUtil can be used to fix the following errors in Exchange 2019, 2016, 2013, or earlier versions.

  1. Error in Provisioned Folder: An error occurs inside a folder structure for a particular or multiple mailboxes. Such a folder is known as Provisioned Folder.
  2. Error in Search Folder: Though Search Folders are meant to detect and resolve the available corrupt files, there are instances when Search Folders are identified with errors.
  3. Error in Specific Folders: The displayed content in specific folders gets associated with errors due to which View Folders fail to return correct results.
  4. A particular folder is unable to return the correct item count. The Aggregate Counts on that specific folder cannot yield actual values.
  5. Unable to mount database error

EseUtil Pre-Requisites

Before you can repair an Exchange mailbox database by using EseUtil, ensure the following to avoid errors and issues during database recovery:  

  1. Take a backup of the current EDB database and Log files at a safe location. This backup will help recover the database if the original database copy gets further damage or corrupted while repairing with EseUtil commands.
  2. Ensure there is adequate free space on the storage media to perform successful database recovery. To repair an Exchange database, there should be free storage space equivalent to 120% to 130% of the original database size. This is due to a temporary database copy that EseUtil creates during the repair and recovery process.
  3. If the storage requirement is not met, make sure to include a command to redirect the repaired Exchange Database file to another location (may work but not recommended).

You can check the amount of free space or whitespace in the Exchange database by searching your application log for Event ID 1221. You can use this information to calculate the free space required on your drive for EseUtil to work and repair the database successfully without error.

Alternately, use you can use the Get-MailboxDatabase cmdlet in the Exchange management shell (EMS) to view the free space in the database:

Get-MailboxDatabase -Status | Sort-Object DatabaseSize -Descending | Format-Table Name, DatabaseSize, AvailableNewMailboxSpace

Further, you may also use the Eseutil /ms cmdlet to find the current estimate.

Steps to Repair Exchange 2013, 2016, or 2019 Database using Eseutil

Eseutil commands can scan, repair, and defrags a low level of corruption in the Exchange database. Below we have explained the stepwise process to repair Exchange Database via Eseutil and Isinteg.

  1. Run Eseutil /mh command ? To get all the information on the database and to see that the  database is in Dirty Shutdown or Clean Shutdown state
  2. Run Eseutil/r command ? To perform a soft repair on the database
  3. Run Eseutil/p command ? To perform hard recovery
  4. Run New-MailboxRepairRequest (formerly Isinteg) ? New-MailboxRepairRequest is the successor of the Isinteg tool. Thus, we will use it to defrag the database after repair.

Step 1: Check the Database Status

To check the database status, i.e. if it?s in a Dirty Shutdown state, use the eseutil /mh parameter. This will display the database state.

Eseutil /mh <PathToDatabase>

The default database path is as follows:

C:\Program Files\Microsoft\Exchange Server\Vxx\Mailbox\<database>

This may vary if you are using another location or drive volumes to store databases or logs.

If the state displays Dirty Shutdown, it indicates database inconsistency and corruption.

Step 2: Check Logs Status

To recover the database, you can replay the uncommitted logs on the database and bring it to a consistent state. However, before you can replay the logs, it?s critical to check the log status by using the following commands.

cd <PathToLogFolder>
eseutil /ml <Log Prefix>

For instance,

eseutil /ml E00.log

If the output displays, ?No damaged log files were found?, follow the next step to perform the Soft recovery on the Exchange 2013 or 2016 database to repair it.

Step 3: Perform EseUtil Soft Recovery

You can use the EseUtil /r command to perform Soft Recovery on the database to bring it to a consistent or Clean Shutdown state. The command is as follows:

EseUtil /r <Log Prefix> /l "<PathToLogsFolder> /d "<PathToDatabase>"

For instance,

Eseutil /r e00 /l "E:\EXCH01\logs" /d "E:\EXCH01\database"

After performing the Soft Recovery, check the database status again to verify if the database is ?Clean? or still ?Dirty?.

EseUtil /mh <PathToDatabase>

If the output displays Clean Shutdown, the database is repaired and you can use the Exchange Admin Center or Mount-Database PowerShell cmdlet in the Exchange Management Shell (EMS) to mount the database and restore mailbox connectivity.

However, if the database is still not repaired and shows Dirty Shutdown or Soft Recovery fails due to missing or deleted logs, you can perform the Hard Recovery on the database by using Eseutil /p command.

Eseutil /p <DBFileName.edb>

The command repairs the database by purging or removing the irrecoverable mailboxes and mail items from the database. This could lead to data loss and thus, is not recommended.

Step 4: Defragment Database with New-MailboxRepairRequest

Defragmentation reduces the size of the database by eliminating the white spaces available in the Exchange database. To perform this process, run the below command by using the Exchange Management Shell (EMS).

IMPORTANT NOTE: Defragmentation can take a considerable amount of time, depending on the size of the database and the performance of the disks.

New-MailboxRepairRequest -Mailbox <MailboxIdParameter> [-Archive <SwitchParameter>] <COMMON PARAMETERS>

Step 5: Verify Corruption in the Database With Eseutil /mh Command

To check if the Hard Recovery process has successfully repaired the Exchange 2013 or 2016 database or not,  use the eseutil /mh parameter. If it is successful, the database state will show Clean Shutdown.

For any activity, it is necessary to verify that the Exchange 2013/2016 database repair via Eseutil has resulted in resolving the error.

Though almost all Exchange administrators are aware of Eseutil and New-MailboxRepairRequest commands, they are also mindful of the limitations of these commands.

There could be instances where the Exchange utilities fail to work, especially while repairing severely corrupt Exchange databases.

Some common Eseutil failure errors that you may encounter while recovering Exchange 2013 or 2016 databases can lead to excessive downtimes. Some of these errors are as follow,

  1. Exchange 2013 Eseutil error 1216
  2. Eseutil crashes in Exchange 2013
  3. Eseutil /r /l /d Exchange 2013 does not proceed
  4. Exchange 2013 Eseutil -528 error
  5. Eseutil /r Exchange 2016 error: Access to source database ?south? failed with jet error -1811
  6. Exchange 2013 Eseutil recovery has indicated the threat there might be a lossy recovery option

To avoid the risk of disruption, and downtime and ensure database repair with complete integrity and precision without the risk of the database, use an Exchange database recovery software, such as Stellar Repair for Exchange.

Recommended by MVPs and IT experts, the software can repair even severely corrupt Exchange database files, irrespective of the Exchange versions or level of corruption. The software supports Microsoft Exchange servers 2019, 2016, 2013, and all earlier versions.

Conclusion

Exchange Servers are the lifeline of business communication. Therefore, it has to be up and running 24*7. Despite this fact, Exchange administrators have to face situations where the Exchange Server or database goes offline. At such times, the most feasible option is to analyze the cause behind such an issue and resolve it at the earliest. If it is due to severe Exchange database corruption, then trying Eseutil and New-MailboxRepairRequest or Isinteg command to repair Exchange database 2003/2007/ 2010/ 2013/2016/ 2019 may not be practicable. Instead, use Stellar Repair for Exchange to repair severely corrupt database files. The software supports Exchange Server 2019, 2016, 2013, and earlier versions.

Related Post