Fix Data Corruption in Exchange 2013 Server DAG setup

Summary: When you setup your Exchange server and create a DAG, you think that all is well. But what happens when your Exchange Databases in DAG become corrupt?

Adding “Exchange trusted subsystem ” in Security Tab

There are two possible scenarios for corruption, they are:

Let us take a look at each one and what they mean:

Physical Corruption of the Exchange Database

This can happen when the ESE Structure is no longer valid. For Example, your Exchange databases are in a dirty shutdown state due to physical hardware failure or sudden reboots of your server.

What is a dirty shutdown of an Exchange database you may ask? Information is loaded into the cache memory but isn?t committed to the exchange database. The result is that the exchange database is flagged as ?Dirty? by the Jet Engine. Until such time when all the dirty transactions are not are not resolved, the exchange database is considered inconsistent.

To fix an Exchange database in a dirty shutdown state you can try and repair the database using the tool ESEUTIL with the /k switch

Firstly you need to check if the Exchange database is in a clean shutdown state or a dirty shutdown state, you can do this running the command ESEUTIL /mh ?path to your database?

if the DB state shows as “Clean Shutdown”, the database is detached from the transaction log and is consistent. However, if the DB state shows “Dirty Shutdown“, the database is still attached to the log file and is inconsistent.

The above corruption cannot replicate across as you are unable to bring the Exchange database back online.

Another application that can cause this is your Anti-Virus. If the correct exclusions are not set on your Anti-Virus application, it could go and delete files causing the inconsistency of the log files and the Exchange database will not mount if it is rebooted etc. Note that it wont be replicated either.

To set exclusions on your Anti-Virus application like ESET, Kaspersky, System Center Endpoint protection and many others that support Microsoft Exchange, you can refer to the following link and set it according to what Microsoft outline:

Anti-Virus Software in the Operating System on Exchange Servers

 Logical Corruption of the Exchange Database

This happens when the data within the database is no longer valid but the ESE structure is. This type of corruption can replicate and can also occur in a standalone Exchange Server. There are a few methods to deal with this kind of problem:

Detecting and Repairing Logical Corruption of Your Exchange Server Databases

Mailbox Moves

To perform mailbox moves, you would need to create a new Exchange database and create its database copy and then start moving the mailboxes across to get rid of the current Exchange database. This is a simple task but can be very time consuming especially if the mailboxes are large, 100GB+

Single Item Recovery

The next step is to look at performing Single Item Recovery for a mailbox or mailboxes. You first need to enable it within Exchange, to do this run the following command:

Do take note, By default, the mailbox uses the deleted item retention settings of the mailbox database, but you can override the default can be overridden by setting it at the mailbox level for specific mailboxes.

Now let us look at what Single Item recovery is:

Single item recovery provides an additional layer of protection so that you can recover items accidentally deleted by a user or by automated processes such as the Managed Folder Assistant. Single item recovery simplifies recovery and reduces recovery time because you can recover items without recovering an entire mailbox or mailbox database from backup media.

You can also use the Search-Mailbox cmdlet in the Shell to search for and recover missing items.

Mailbox Repair Request

The last thing to look at is performing Mailbox Repairs. You can do so running the New-MailboxRepairRequest command from the Exchange Management Shell on a mailbox.

Let us look at some of the functionality of this command:

Here is a brief explanation of what the command detects and fixes:

You may also like to read:  Article on New-MailboxRepairRequest

A final point here, you need to ensure that you have proper backups in place in your Exchange Environment, you can also perform restores using Microsoft?s own product called Data Protection Manager then you need to ensure that you can restore the databases and they are no corrupt.

If the issue is not resolved, then you can also look to Mailbox Exchange Server Recovery tool by Stellar Data Recovery to recover data from your corrupt  .EDB file.

Please check our Stellar Repair for Exchange MVP reviews for a better understanding.

Related Post