≡ Menu

Getting an Exchange Database into a Clean Shutdown State using Eseutil

So you’ve just restored an Exchange database, and now you are trying to mount it. To your surprise, you are getting an error similar to the following:

Couldn’t mount the database that you specified. Specified database: DB2; Errorcode: An Active Manager operation failed. Error: The database action failed. Error: An error occurred while trying to select a database copy for possible activation. Error: The database ‘DB2′ was not mounted because errors occurred either while validating database copies for possible activation, or while attempting to activate another copy. Detailed error(s):

An Active Manager operation failed. Error: Operation failed with message: MapiExceptionCallFailed: Unable to mount database. (hr=0×80004005, ec=-550)

Before you can mount a database restored from a backup, it needs to be in a clean shutdown state. You can use the Eseutil tool to check whether a database is in a clean shutdown state – if it is not in a clean shutdown state you can perform a repair to get the database into consistency.

Soft Recovery using Eseutil

The first thing you want to do is verify that the database is in a dirty shutdown state. We can do this using the eseutil /mh command. For example:

The output from the above command shows us that the database is dirty shutdown:

We can also see from the output, under Log Required, the database is missing a transaction log. We can replay log files into the database (as long as they exist) to get the database into consistency. To do this, we use the following syntax with eseutil:

eseutil /r /l /d

For example, my log file prefix is E02, and my database and logs are stored in G:\E_\Program Files\Microsoft\Exchange Server\V14\Mailbox\DAGDB1 . Here is a screen shot of the command:

When this repair is complete, I can run the eseutil /mh command again to verify that the database is in a clean shut down state:

At this point, I’ll be able to mount the database. This will almost always work when you restore a database from a Windows Server Backup, but there may be times when this doesn’t work and you need to perform a hard repair.

Performing a Hard Repair

Performing a hard repair using eseutil /p will check the database for any damaged pages; if it finds any, it will delete them. Make sure that you can live without any data inside the database before doing a hard repair, because you may lose data. Also, make sure you have twice as much free space as the size of the database before doing a hard repair – this is required for the temporary database that will be created.

To perform a hard repair, use the eseutil /p command, as shown here:

Once this completes, you can use the eseutil /mh command to verify the database is clean shutdown.

22 comments… add one

  • Raul July 13, 2010, 11:14 am

    Hi, thanks for the post. I was able to mount my database successfuly.

    I copied the OG database to a drive that had enough space, did the eseutil /p (took like 15 hours). then did the eseutil /d (again in the copied database). then ran eseutil /mh to confirm statistics. Then I passed this file to the original Exchange Store folder and replaced the broken database with this one. Erased all the logs in the “log folder” and it successfully mounted. I guess I was lucky, I had no erased information and the emails that were sent while my server was down came trough as well. I hope this helps to those who have the same problem… ( I had to do all this because a partner accidentally deleted the last 15th days logs).

  • Anna September 1, 2010, 1:22 am

    Hi, I used your post to perform test recovery on fresh instalation of exchange 2010, everything is “succesfully”, I mean eseutil /r eseutil /p, but the database is still in dirty shutdown.

    Its small standalone DC with exchange 2010 with 20 mailboxes. And its virtual on Hyper-V (full enterprise server 2008R2).

    Any idea?

  • Great - thanks! February 25, 2011, 1:51 pm

    I accidentally reformatted the wrong drive at the brand new Exchange Server 2010 and Zap! The one an only Public Folder was gone! Restore from backup did not work – so I was about to spent all night decommissioning the server.
    Eseutil /p was my savior

  • James West April 11, 2011, 8:08 pm

    I had uninstalled my old exchange 2003 server and my new 2010 server doped the Public folders because of it. this helped me get them back up and running. Thank you!!!!

  • Mike Pfeiffer April 11, 2011, 8:50 pm

    Great news, thanks James.

  • Markus May 14, 2011, 12:53 pm

    Hi Mike,

    just one Additon as I haven found in in such clearness elsewhere

    ESEutil /R will even report a “complete” if the path is WRONG or not existent SO BE SURE you have no TYPE there

    The SYSTEM Directory = the Installation BIN Folder of the Exchange Program !
    The LOG Director = where the LOG are for the Specific EDB ( might be E00, E01 …. )
    The EDB Directoy = where the Database is located as EDB File

    If you Type ONE wrongly or start Eseutil from a wrong Directory it will asume “Current Directory” and will not give you any lead why it looks fine but you still have a “dirty” status ,

    lets put it that way IF you dont see that “Percentage Line” you have something WRONG

    DONT GIVE up DONT DONT do the eseutil /P Until that works !!!

    ( PS : some Error Feedback would be appriciated ;) ) ( figured that out after 6 Hours with some angry people on my neck … hope you have better luck …. )

  • Marco June 25, 2012, 11:00 am

    This is THE BEST COMMENT EVER of this post. THANK YOU MARKUS!!!!!

  • Dan July 3, 2012, 2:44 pm

    I agree with Marco.. specifying the SYSTEM bin path finally did the trick for me.

  • Markus Viel May 14, 2011, 1:50 pm

    I Posted before

    as it is essential too know that you have to start Eseutil from the bin Folder of exchange and type the path to the LOG and EDB right , otherwise you get an complet Message.

  • Torijumo May 20, 2011, 10:36 am

    Hello,

    I got this error when i was doing the hard repair: microsoft exch server DB storage Engine utility has stopped working.

    do you have idea what is responsible for this?

  • Mike September 24, 2011, 9:03 am

    Remember to run as administrator when opening Exchange Management Shell! I found an error with “file locked or open” when I tried the first time! SBS 2011 (2008R2)

  • sean c January 5, 2012, 10:47 am

    That is most likley that you don’t have permissions on the folder

  • kevin October 20, 2011, 10:38 am

    If you do a soft repair are you at risk of losing any data?

  • Mike Pfeiffer October 21, 2011, 9:29 am

    Nope.

  • Pierrot Robert November 11, 2011, 7:17 am

    You just saved my life, eseutil /r /l /d put my database in a clean shutdown state. I had to put the /a switch though. I was able to mount my database after that.

  • Mike Pfeiffer November 12, 2011, 5:25 pm

    Awesome!

  • Joseph November 14, 2011, 9:05 am

    If you eseutil /p and end up getting a clean shutdown, then move log files from folder and mount the database can you still inject those moved log files back into the mounted database?

  • Luis January 26, 2012, 5:26 am

    Hi,

    I just did a restore from a a backup and the database won’t mount because it is in an inconsistent state.

    I run the eseutil /r, but it does not show me the Percentage Line.

    the paths that I select are, /s where the E01.chk is located, /d where the .edb file is located and /l where the logs are located.

    I get the operation run successfully, but it is still in a dirty shutdown state.

    Any Ideas?

    Regards,

  • Ken Johnson April 15, 2013, 5:30 pm

    Here’s a tip for those that had trouble getting eseutil to run. If you launch the Exchange Management Shell and run the eseutil command from inside that, you don’t have to enter the path. You only need to type in the the path for eseutil if you run it from a regular command prompt. This is another reason why you should use the Exchange Management Shell for Exchange 2010 administration.

  • Basil Clive May 9, 2013, 5:38 am

    Your solution is good but very hard for users, try … to repair and recover every EDB directory in only two or three steps from exchanger server. For more external details at here : …

  • Jaseem July 14, 2014, 11:51 pm

    Wow!..
    Thanks a lot… I have no words to express my happiness. You saved my day…
    Our database file was too large 470GB, it took 1 hour to complete soft recovery. After that its starts working fine. This fix is my first Exchange Server troubleshoot. Thanks a lot for such an introduction.

  • Beesy August 13, 2014, 7:58 pm

    Thank you for saving our mail server this morning! Our log drive was full and all databases were doing Dirty Shutdowns. Now thanks to this brilliant article, we have email again and everyone is happy. :-)

Leave a Comment