MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Exchange Database Recovery – Using eseutil commands

The real job of an exchange administrator is to maintain high availability when it comes to a messaging environment.

Below mentioned processes are not done on a day to day basis, but understanding how the process works is mandatory for every exchange administrator.

###Update###

JET_errMissingLogFile -528 -548 – Exchange 2010 database recovery: https://msexchangeguru.com/2013/02/01/jet_errmissinglogfile-528-548/

You may be also interested in these topics too if you wish to know more about Exchange database technology:

Exchange database repair – The eseutil /p process: https://msexchangeguru.com/2011/03/02/databse-repair/

Here I have tried to explain the terminologies involved in a repair process like how the Exchange JET database stores information properly arranged in physical and logical pages and how the repair, defrag and ISINTEG process get rid of corruption.

Bad Checksum on Exchange Database: https://msexchangeguru.com/2009/07/13/checksum-error/

Here, lets look at identifying a checksum error, understanding health of an Exchange database and how to know which log file belong to which database.

A step by step walk-through of procedure to be followed when exchange database fail to mount in Exchange System Manager:

1. Perform the Eseutil /mh “Path of the database” as indicated below and check the state of the database.

Health of the Database

Health of the Database

2. If the state is in clean shutdown, move all the log files from the Transaction logs folder location and then mount the stores.

3. If the state is in Dirty shutdown as mentioned below, check if the log files that is indicated as Logs required is available or now.

Database in Dirty Shutdown

Database in Dirty Shutdown

5. To make sure that the log files that is required is in a Clean state, you can perform Eseutil /ml “Path of the log files\log prefix” as indicated below. This command will help you check the health of all the log files in the location.

Database in Dirty Shutdown

log file health – eseutil /ml

6.If the log files are healthy, then perform the Soft recovery with the command Eseutil /r <Log Prefix> /l “Path of the log files” /d “Path of the database”

Soft recovery - eseutil/r

Soft recovery – eseutil/r

7. Once the command completes successfully, mount the stores.

You might get this error:

“Operation terminated with error -1216 (JET_errAttachedDatabaseMismatch, An outstanding database attachment has been detected at the start or end of recovery, but database is missing or does not match attachment info) after n seconds.”

To resolve this, run soft recovery with the “/i ” switch at the end and it will override the EDB-STM mismatch.

How to run HARD RECOVERY:

In case the required log files are not available in a clean state or missing, either restore from a successful back up or perform Hard repair.

8. In case we have valid backup, then we can restore the files.

9. In any restoration software, once the restoration completes, it should create a location containing the restore.env file along with the logs that were backed up without being committed to the database that was backed up.

10. By default, we have the location as C:\Temp as indicated below:

Log restore location

Log restore location

11. This folder contains the restore.env along with the logs as indicated below:

Restore.env Location

Restore.env Location

12.  Make sure we take a copy of the folder containing the logs and restore.env file as the content of the folder will be lost if the hard recovery completes or fails.

Copy the folder post restore

Copy the folder post restore

13. In the command prompt, perform the Hard recovery from the BIN folder with the following command:

Eseutil /cc “Path of the restore.env containing folder”

Hard Recovery - eseutil /cc

Hard Recovery – eseutil /cc

14. The command will complete successfully:

Hard Recovery completion

Hard Recovery completion

15. If you check the folder that contained the restore.env file, we would find that to be empty:

Location becomes empty post Hard Recovery

Location becomes empty post Hard Recovery

16. If the backup was taken a few days back and there were logs created in the production location once the backup was done, then we must make sure that the production location contains the sequence of logs from the one in the restore.env location. In this case, the restore.env folder contained the last log file as E0000003.log. If the production location does not contain a sequence of this (i.e. E0000004.log), the hard recovery command will fail.

17. We can use the eseutil /cc “Path of the restore.env folder” /t in order to avoid playing the logs in the production location. (Kindly make sure to take a copy of the folder once again before performing the command as mentioned in step 12. However, in this case, there will be data loss of the mails created after the backup was taken.

18. We can mount the stores successfully.

How to run HARD REPAIR: 

19. We can Hard repair the databases, to get them back into a clean shut down state in case we do not have a valid back up. To do so type the command:

D:\Program Files\Exchsrvr\Bin>eseutil /p “D:\Exchsrvr\Mailbox Store (SERVER).edb”

 

20.     When you are prompted to confirm this operation, choose OK.

Pop-up whilst repair

Pop-up whilst repair

http://support.microsoft.com/?id=317014

21. The process completes successfully.

Repair process completed

Repair process completed

How to run OFFLINE DEFRAG:

22. Once Eseutil /p finishes we will need to defrag the databases, to do so type the following command: Note: You must have available hard disk space equal to 110 percent of the size of the database that you want to defragment.

23.    To defragment Priv.edb, type the following command at the command prompt, and then press ENTER:

24.   D:\Program Files\Exchsrvr\Bin>eseutil /d “D:\Exchsrvr\Mailbox Store (SERVER).edb”

Offline Defrag

Offline Defrag

25. Note If the private and the public information store databases are large, this step may take some time. When you are prompted to confirm this operation, choose OK.

XADM: How to Defragment with the Eseutil Utility (Eseutil.exe) http://support.microsoft.com/?id=192185

26.  Once Eseutil /d finishes Mount the store & Dismount the store immediately then perform the below steps.

How to run ISINTEG:  

27.  Use Isinteg.exe to fix the Pub1.edb database and the Priv1.edb database. The Isinteg.exe utility runs a test on all areas of each of the databases and reports the results. Isinteg.exe also tries to fix any issues that are encountered.

28. To fix Priv1.edb, type the following command at a command prompt

29. E:\Program Files\Exchsrvr\Bin>isinteg -s (SERVER) -fix -test alltests and choose the store that we are running the command on. 

 

ISINTEG

ISINTEG

You are prompted to select the database to be checked.

Index                Status               Database-Name

Storage Group Name:  First Storage Group

  1                    Offline              Mailbox Store (servername)

  2                    Offline              Public Folder Store (servername)

30. Enter a number to select a database or press Return to exit.

31. You can only check databases that are marked as offline. The Information Store service must be started, but the information store must be dismounted.

32. When you select a database, you are prompted with the following message to confirm the selection:

“You have selected First Storage Group / Mailbox Store <servername>

Continue? (Y/N)”

33. Press Y and Enter to start checking the selected database.

34. You receive a summary report that indicates the number of tests that were run, the number of warnings, the number of errors found, the number of fixes attempted, and the time it took for the program to run. If there are any warnings, errors, or fixes, run the command again. Repeat this step until there are no warnings, errors, or fixes reported and the report looks similar to the following text:

Test reference table construction result:

0 error(s); 0 warning(s); 0 fix (es); 0 row(s); time: 0h: 0m: 0s

Test Folder Result:

0 error(s); 0 warning(s); 0 fix (es); 101 row(s); time: 0h: 0m: 0s

 Now in test 3 (reference count verification) of total 3 tests;

100% complete.

ISINTEG Completion

ISINTEG Completion

Before you execute any command on the database, please make sure that QUICKEDITMODE is not checked in command prompt properties as it may pause the process upon left click.

Quickeditmode disabled

Quickeditmode disabled

Best Regards,

Meera Nair
Team @MSExchangeGuru

112 Responses to “Exchange Database Recovery – Using eseutil commands”

  1. Aslam Says:

    Good Explanation About ESEUTIL.

  2. Mohammed Tahir Says:

    Very good presentation. Its very easy to understand.Thanks for the same.

  3. Madan Says:

    Gr8 work. I relay liked this article. Simple and precise.

  4. raj Says:

    This is good but only three times we can do repair once third time gets over you cannot do the repair your database is gone for toss. so keep a flat file copy before doing this.

  5. Gias Says:

    Thanks a lot for free useful topics. It was very helpful for me. Though besides this i followed other sites. But this one is great. I have 50 GB data and full process need about 10 hours.
    1. Take a copy of main data foler (Exchsrvr) and put it safe place
    2. use useutil /mh to test health of database and got dirty shutdown.
    3. use useutil /ml to test log file.
    4. use useutil /r but it failed
    5. use useutil /p for both database mail database and public folder database, successful
    6. take a backup of repair database to a other folder for safety.
    7. delete all log files and only except 2 edb and 2 stm files
    8. mount data store just to check and then dismount
    9. i have huge data so i avoid derangement
    10. finally use isinteg -s servername -fix -test alltests and successful

    Insallah, mail server now working properly.

    Gias

  6. Azad Kumar Nahar Says:

    Very awesome write up. I relay liked this article. Simple and precise.

  7. Nilesh Gadkari Says:

    Excellent presentation about Eseutil commands which is very help full Gr8 work.
    Nilesh..

  8. Jeff Says:

    Thanks! This saved me.

  9. Jimmy Says:

    i’m running out of the space and i like to redirect the Temp direction to my other disk.. what is proper command ?

    i tried with /t “R:\Recovery”

    do i need to give /t “R:\Recovery\recovery.edb” name ? i tried this but it didn’t work.. what am i missing?

  10. Chris Schaller Says:

    Awesome article. Been struggling for a bit on this.
    Would have been nice though for a heads up on the time this stuff takes to complete.
    Took a full 18 hours (64982.27 seconds) to repair!
    1 user had wiped their entire calendar events when they connected their iPhone for the first time through iTunes… I needed to restore just his mailbox from the previous night’s backup.

    It would seem that in the question of Mac vs PC, even the devices are at war 🙂

  11. Rajasekaran Says:

    Hi Meera,

    Excellant document! Every ex.admin has to keep in hand.

    Pls post 2k7, 2010 eseutils and high availability

    God bless you and give good health to you.

  12. SAF Says:

    the site is so wonderful! to say the least, it did save my job yesterday!
    here is the account of my journey
    1. Take a copy of main data folder (Exchsrvr) and put it safe place
    2. used useutil /mh to test health of database and got dirty shutdown for both priv, and pub
    3. used useutil /ml to test log file.(i could not find the required log, and some where damaged)
    4. used useutil /r but it failed
    5. used useutil /p for both database mail database and public folder database, successful
    6. used useutil /d to defragment priv and pub databases,successful
    7. still mount failed
    8. used isinteg -s servername -fix -test alltests, failed
    9. used useutil /g to defragment, successful
    10.reused isinteg -s servername -fix -test alltests, successful
    11.remount the databases, successful
    mail server now working properly.
    thanks Meera your are marvelous, my bread is safe at least for now!

  13. Recovering Exchange configured with DAG using ZCB 4.2 | systemadminnotes Says:

    […] 4. Make sure restored database is in the clean state.https://msexchangeguru.com/2009/07/12/exchange-database-recovery-using-eseutil-commands/ […]

  14. Brian Says:

    Great walk through, I have just followed this, and it works great on 2010 too 🙂

  15. Sivakumar Nagarajan Says:

    Really wonderful Meera and Rathish. This is really helped a lot. Once again thanks.

  16. Bert Leen Says:

    I know that commands is working for recover edb files from corrupt and damaged exchange server but they are not recover complete mails from exchange server. Thanks for the great article though.

  17. Pablo V Says:

    Thanks a lot for your contribution. I was trying to mount our primary database for around 5 hours, but nothing.

    I found this information. And i was able to mount the database.

    Thanks again.

  18. Martijn D Says:

    This is by far the best article I’ve seen regarding ESEutil and recovering Exchange databases. With this article I was able to succesfully restore a corrupted database in Exchange 2007. Thank you very much!!!

  19. justin Says:

    Excellent article about eseutil.solved my exchange dirty sgutdown problem Thanks.

  20. kenneh Says:

    can’t remember the last time i read an article soo clear and helpful. my exchange can finally backup. Cheers!!

  21. shabber Says:

    it is the best article what ever i have seen regarding Eseutil tool.

    Thanks.
    S.Shabber(:$

  22. satishkumar Says:

    errer – windows detected a hardisk ploblem

    Backup your file immediatrly to provent information loss and then contact the

    computer manfacturer to delermin if you need to repair or prplace the disk

  23. Fredag 18.01.2013 « G1bg Says:

    […] Den planlagte backupen feila, og etter kort tid var serveren fylt opp med loggfiler. Fann ein guide som kunne være løysinga på problemet. Det synte seg at statusen på databasen var “Dirty […]

  24. Dave Dunkley Says:

    I have just repaired and restored my entire exchange database and remounted them successfully with the advice and procedures in this article, thank you very much for posting

  25. Ratish Sekhar Says:

    Youre welcome Dave…

  26. Adolfo Mosqueda Says:

    Thank´s for your info, it was very useful tu repair a DB. Excellent and very precise

  27. JET_errMissingLogFile -528 -548 – Exchange 2010 database recovery « MSExchangeGuru.com Says:

    […] Exchange Database Recovery – Using eseutil commands: https://msexchangeguru.com/2009/07/12/exchange-database-recovery-using-eseutil-commands/ […]

  28. Manu Says:

    Googled for some Eseutil helps and this link has come up..Excellent presentation..keep it up

  29. Mital Says:

    This has to be one of the most useful pages ever on Exchange – very simple to understand, straight to the point. Found it extremely useful to do a recovery yesterday. The screenshots and examples make it so much better than Microsoft official documentation.

  30. Jennifer Says:

    Well explained about Eseutil command

  31. RobertO Says:

    I was wondering if you know whether changing priority of eseutil.exe in task manager after it is running will help speed it up or is it not a wise idea to change it from normal?

  32. Harsh Says:

    Excellent document Meera. Thanks for sharing.

  33. Jarmo Says:

    Outstanding content! Thanks you saved my a__ today.

    Jarmo

  34. shabber Says:

    very very best document..it has given me a clean and clear idea abt theEseutil cmds..

    Thank you very much..

  35. mike norwalk Says:

    how do you run the ESE defrag util when you have a long file name. I am trying to run the command line and it can not find the DB. I have tried all kinds of variations including 8.3 format but nothing seems to be working for me? Thoughts? Below is the error i receive.

    M:\Program Files\Microsoft\Exchange Server\Mailbox\IS6>dir *.edb
    Volume in drive M is Database
    Volume Serial Number is 4211-5492

    Directory of M:\Program Files\Microsoft\Exchange Server\Mailbox\IS6

    09/09/2013 12:15 PM 9,733,160,960 Mailbox Database.edb
    1 File(s) 9,733,160,960 bytes
    0 Dir(s) 10,259,120,128 bytes free

    M:\Program Files\Microsoft\Exchange Server\Mailbox\IS6>eseutil /d M:\Program Files\Microsoft\Exchange Server\Mailbox\IS6\Mailbox Database.edb /t l:\temp.edb

    Usage Error: Invalid argument ‘Files\Microsoft\Exchange’. Options must be preced
    ed by ‘-‘ or ‘/’.

    Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
    Version 08.01
    Copyright (C) Microsoft Corporation. All Rights Reserved.

    DESCRIPTION: Database utilities for the Extensible Storage Engine for Microsoft
    (R) Exchange Server.

    MODES OF OPERATION:
    Defragmentation: ESEUTIL /d [options]
    Recovery: ESEUTIL /r [options]
    Integrity: ESEUTIL /g [options]
    Checksum: ESEUTIL /k [options]
    Repair: ESEUTIL /p [options]
    File Dump: ESEUTIL /m[mode-modifier]
    Copy File: ESEUTIL /y [options]
    Restore: ESEUTIL /c[mode-modifier] [options]

    <<<<>>>>
    D=Defragmentation, R=Recovery, G=inteGrity, K=checKsum,
    P=rePair, M=file duMp, Y=copY file, C=restore

  36. mike norwalk Says:

    i got the answer on another site. You need to put the full path in double quotes:

    eseutil /d “M:\Program Files\Microsoft\Exchange Server\Mailbox\IS6\Mailbox Database.edb” /t “L:\Mailbox Database.edb”
    Defragmentation Status (% complete)

    0 10 20 30 40 50 60 70 80 90 100
    |—-|—-|—-|—-|—-|—-|—-|—-|—-|—-|
    ……………………………

  37. Mark Harby Says:

    Really good clear article, the sort you really need to find at 1:00am when the sky is falling in.
    Great work.

  38. Exchange Database Recovery – Using eseutil commands « MSExchangeGuru.com - The Ripe Group Says:

    […] Exchange Database Recovery – Using eseutil commands « MSExchangeGuru.com. […]

  39. Cannot View Public Folders either via Outlook or OWA - Babyraj.com Says:

    […] Run a check on the database usage ESEUtil or ISInteg […]

  40. Anup Nair Says:

    This was just great>>>>>>>>>>>>>>>>>>>>>>

  41. Herby Seedat Says:

    Hi there.

    We’ve had a failure resulting in a hard repair. Currently the repair is running at around 6gb per hour, is there anyway to spend this up. We are running exchange 2007.

    Thanks

  42. Prabhat Nigam Says:

    Unfortunately, repair will take this long. 6GB is a good speed. I expect 4-5GB/hour

  43. Akhtar Shaikh Says:

    Excellent explanation

  44. Problème serveur Exchange 2010 | Le cloud de Piermick Says:

    […] https://msexchangeguru.com/2009/07/12/exchange-database-recovery-using-eseutil-commands/ […]

  45. andy Says:

    I had a SBS 2003 server motherboard fail this week. I was able to restore but the store would not mount. I used your guide to fix it.
    Thanks!!!!

  46. Bennie Says:

    This is the best eseutil explanation i have ever seen. Doing a database softrecovery at the moment, hope this will work, than i can continue repairing the SBS2011 server. Thnx a lot

  47. Nashim Khan Says:

    This article really great, all thing is covered. I used it today after a very long time.

    Great work.

  48. Deva Says:

    The explanation is very good, and i get this error while doing the hard recovery.

    The database is not up-to-date. This operation may find that
    this database is corrupt because data from the log files has
    yet to be placed in the database.

    To ensure the database is up-to-date please use the ‘Recovery’ operation.

    Can you please help and suggest.

  49. Prabhat Nigam Says:

    @Deva
    You need exchange disaster recovery expert. Don’t play with the exchange databases, you might end up loosing all emails.

  50. Sanat Says:

    The best explanation ever!!! Kudos!!!

Leave a Reply

Categories

Archives

MSExchangeGuru.com