How to Determine the Repair Count of an Exchange Database?

Megha Sharma
Updated On - 24 Jan 2019

If you are planning an Exchange database repair, it is essential to know about the new Microsoft support policy.
The new support policy requires that if the repair count value is greater than 0, then all mailboxes on this database would have to be moved to the new database. It ensures that the database structure will not be affected by the database repair process. Also, it helps to prevent store crashes and to maintain the server stability.

How to determine the repair count of a database?

Now, most users want to know how to determine the repair count of an Exchange Database when it is online. This is how you can do this.

The method we discuss here applies to Exchange 2010 and newer versions. For 2007 or older versions, you need to dismount your database to check the repair count.

The procedure to check the repair count of an Exchange database is:

Suspend a passive copy of the database in database availability group.

Perform eseutil /mh operation.

Suspending the passive copy of a database would stop log replays and then release active locks against the database. This helps in determining the repair count of the database. Now, let us understand how to determine the repair counts.

Open Exchange Management Shell and run the commands one-by-one:

To suspend a passive database copy in database availability group, run the following command.

suspend-mailboxDatabaseCopy –identity <DBNAME>\<SERVERNAME>

Here, <DBNAME> is the database name and <SERVERNAME> is the server name of the Exchange.

Users can run the following command to verify if the database has been suspended or not:

Get-MailboxDatabaseCopyStatus –identity <DBNAME>\<SERVERNAME>

The output status would be shown as suspended if it has been successfully suspended.

After the passive data is suspended and locks are released, you can use eseutil and determine the repair counts.

eseutil /mh .\ <DATABAE FILE NAME>

The output provides the repair count, the repair date, and the old repair count.

Users can resume their database from here with this command.

Resume-MailboxDatabaseCopy <DBNAME>\<SERVERNAME>

To validate it, use:

Get-MailboxDatabaseCopyStatus <DBNAME>\<SERVERNAME>

To check repair count when the database has a single copy only

When the database has a single copy only as in the case of public folder databases, users can use eseutil /mh /vss command to check the repair count.

This /vss extension first creates a VSS copy of the database file and then performs the specified eseutil command. This works against any active or passive database copy without dismounting or suspending the database

Let us see the commands required in such condition to determine repair counts.

First, run this command:

Get-MailboxDatabaseCopyStatus <DBNAME>\<SERVERNAME>

It will display status of the database – healthy or corrupted

Use an administrative command prompt, navigate to the database directory, and run this ESEUTIL command.

eseutil /mh /vss .\ <DBNAME FILE NAME>

The output would be the number of repair counts.

Therefore, ESEUTIL /vss option is quite a convenient way to determine the repair count without dismounting your database.

Conclusion

As per the new Microsoft support policy, any database with repair count or old repair count ≥ 1 requires evacuation. Microsoft clarifies that this will ensure that the repairing process will not affect the structure and the health of the database. This is a precaution against server instability and store crashes due to the corruption caused in a database by the repair process.