Thursday, September 22, 2016

Hello Friends, On this post i will talk about how you can repair a mailbox database in Exchange 2010/2007. Exchange database can get corrupt because of a power outage or due to some corrupt emails. If the mailbox database is in dirty shutdown then you will not be able to mount the Exchange database, You will have to follow the below steps to mount the database successfully.
Note:- Always take a back up of the mailbox database.edb file and the log files before making any changes to the Exchange database.

First of all we will have to check the status of the mailbox database. Open Exchange management shell and run the below command to check the status of the mailbox database.
eseutil /mh “Location of the database”
Below is the snapshot of the same , However in this scenario the database is in clean shutdown. In case the database is not in clean shutdown then its state will be Dirty Shutdown.

To repair the database run the eseutil /p switch, Remember the /p switch is hard repair hence you might lose some data. It is always recommended to take a back of the database(.edb file ) and the log file before the repair. below is the command to initiate a hard repair on the mailbox database.

eseutil /p “Location of the database”
Sample command:-
Eseutil /p “C:\program files\Microsoft\Exchange server\V14\Mailbox\mailbox database.edb”

Once you initiate the hard repair , You will receive a warning stating that some of the data might be lost , Click ok to to the pop up. Now the repair will start and the repair will take time so be patience about it. Normally the eseutil repairs a mailbox database at a speed of 7 – 8 Gb /hr however the time of the repair is directory proportional to the size of the mailbox database and the level of corruption on the mailbox database. Once the repair completes then again check the status of the mailbox database by running the eseutil \mh command . If the database is in dirty shutdown then move the database log files to a different location. You will be able to get the location of the log files by running the below command.
Get-mailboxdatabase -identity “mailbox database,edb”  | fl *path*
The highlighted part is the location of log file.

Go to the log file location and move(Cut and paste) all the log file from that location to a different location,By default in Exchange  the log files and the mailbox database.edb file resides on the same location so only keep the mailbox database.edb file only and move all the log files to a different location. Now we need to open Exchange management Console, Go to Organization configuration->Mailbox->Database management->Properties of the mailbox database->Maintenance ->Check the option “This database can be restored from a back up”.Go ahead and mount the database and you will be able to mount the mailbox database.

No comments:

Post a Comment