Thursday, 13 October 2016

How to repair corrupt database in Exchange 2016


As we all know sometimes Exchange users noticed corruption issues with Exchange Server 2016 like database process terminate unexpectedly, users unable to access their mailbox data, corruption also cause database switchover and failover problem etc. As a remedy, there are various options available to fix corruption like PowerShell commands, third party tools, Restore from backup etc. You can face following scenarios if your database get corrupt: 

•    Exchange Information Store Service is not start
•    Missing Exchange database files(edb)
•    Database shows in “Dirty Shutdown” state
•    No free disk space on database 
•    While database is in Clean Shutdown state, significant logical corruption exists causing the database to dismount.
Let’s have a look of different methodologies:

Backup Available: Restore the Exchange database from backup
Exchange Server provides a plug-in for Windows Server Backup to backup of Exchange data. If you have updated Windows Server Backup use following steps to restore your database:
First Start Windows Server Backup>>Local Backup.
Now click Recover… to start the Recovery Wizard.
Select one of the following step:

•    If back up is on the local server, select ServerName>> Next.
•    If backup is on another server/computer, select Another server>>Next
•    Now ‘Specify location type page. If select Local drives>select the drive containing the backup on the Select backup location page>>Next.
•    If Select Remote shared folder, and then click Next. Enter the UNC path for the backup data on the Specify remote folder page, and Next.
Now Select Backup Date page will open, select date and time from here>>then Next.
On the Select Recovery Type page, select Applications, and then click Next.
On the Select Application page, verify that Exchange is selected in the Applications field.
Note: Also check the application components of the backups from “View Details” options. If you have most recent backup then don’t use option of roll-forward recovery of the application database.

From this option Specify Recovery Options page, specify where you want to recover the data, and then click Next: There are two recovery operations available: 

•    Recover to original location Use this option to restore the Exchange data original location.
•    Recover to another location Use this option restore individual databases to specified location Browse to specify the location. 

After completion of restore process, manually moved data files back to their original location, or mounted somewhere else in the Exchange organization. When you restore a database to another location, you will notice that the restored Exchange database will be in a dirty shutdown state. After the completion of restore process, you will need to manually put the database into a clean shutdown state by using Eseutil.exe.
On Confirmation page, review the recovery settings, and then click Recover.
On the Recovery Progress page, you can view the status and progress of the recovery operation.
Click Close after completion of recovery process.

If No Backup Available: If you have updated backup, you can easily restore the Exchange 2016 database using Windows Server Backup. But that may not be the case always. If you don’t have backup or backup is available but is get corrupt. In this case, database cannot be recovered through Windows Server Backup. You can use New-MailboxRepairRequest command to recover corrupt database.


This command use to detect & repair mailbox corruptions. You can repair a specific mailbox or a full database using this command. This command detects and fixes the following types of mailbox corruptions:

•    Search folder corruptions 
•    Aggregate counts (reflect incorrect values)- (AggregateCounts)
•    Folder views (returning incorrect contents)- (FolderView)
•    Provisioned folders(incorrectly pointing to parent folders- (ProvisionedFolder)

Parameter 1: 
This Parameter use to detect and repair all folder views for the mailbox
New-MailboxRepairRequest -Mailbox -CorruptionType FolderView

Parameter 2:

This Parameter use to detect and report on ProvisionedFolder and SearchFolder corruption
New-MailboxRepairRequest -Mailbox xyz -CorruptionType ProvisionedFolder,SearchFolder -DetectOnly

Parameter 3:

This Parameter use to detect and repair AggregateCounts for all mailboxes on mailbox database XYZ-DB01.
New-MailboxRepairRequest -Database XYZ-DB01 -CorruptionType AggregateCounts

Parameter 4: 
This Parameter use to detect and repair all corruption types mailbox and archive.
New-MailboxRepairRequest -Mailbox xyz -CorruptionType ProvisionedFolder,SearchFolder,AggregateCounts,Folderview -Archive

Parameter 5: 
This Parameter creates a variable that identifies xyz mailbox and then uses the variable to specify the values for the Database and StoreMailbox parameters to create a request to detect and repair all corruption types.
$Mailbox = Get-MailboxStatistics xyz
New-MailboxRepairRequest -Database $Mailbox.Database -StoreMailbox $Mailbox.MailboxGuid -CorruptionType

Many more parameters are available, check it from here:

Third Party Tools
This cmdlet takes a quite long time to repair corrupt Exchange database. There are many third party tools available online that speeds up repair process and doesn’t affect Exchange databases availability. Stellar Phoenix Mailbox Exchange Recovery is one of the finest tool to repair corrupt Exchange server database. The software also export recovered edb files to a Live Exchange server. The software supports MS Exchange Server 2016, 2013, 2010, 2007, 2003 etc.
Remember that if you perform recovery on different version of Exchange database like 2013, 2010 then the steps will be different. Please ensure that you know what you are doing.


Post a Comment