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. Henry Maxwell Says:

    Recently, my edb file got corrupt due to dirty system shutdown, so I tried to repair using Eseutil but got no success. Then, tried some other manual methods, then also couldn’t be able to repair the edb file., So at last I used Stellar Phoenix Mailbox Exchange Recovery Software and it successfully repaired my corrupt edb file and restored completely inaccessible exchange mailboxes. So, I would recommend this tool in case Eseutil and other manual methods fails to repair the corrupt edb file.

  2. Peter Gomes II Says:

    Eseutil is always the most preferred choices among Exchange Administrators, but due to the lack of enough scripting knowledge, people avoids this and go for recovery software.

    Of-course, there is no alternative of third party recovery tools, but this helpful guide also can be tried by administrators if the database is not brutally damaged. Nice catch Meera!

    Peter,

  3. NLakshminarayana Says:

    Superb information I never ever saw this type full info on web…really awesome

  4. Fixing “Cannot start Microsoft Outlook. Cannot open the Outlook window” error when starting Outlook 2013 | Mike's Blog Says:

    […] For production or real world cases you should be very clear on exact process and have clear understanding on differences between soft recovery and hard repair. Probably this article may be helpful for you: Exchange Database Recovery – Using eseutil commands. […]

  5. Vishal K Says:

    Superb Information..I love the way it is explained pictorially. It really helps me to understand.

  6. Jeremy S Says:

    When restoring from backup do you overwrite the existing information store?

  7. Prabhat Nigam Says:

    No, use Recovery Database with Alternate location. Look at our blogs, We have explained it clearly step by step.

  8. 17005 Exchange Transport service shut’s down after start | Serg Klishyn Says:

    […] Remove any existing transaction log files that exist in the specified directory. The files are named Trn.log or Trnnnnn.log. howto on msexchangeguru.com […]

  9. Rockk Says:

    Hi Team – Thanks for the above information. It’s very useful.
    Similar way do you have details for Exchange 2010. Appreciate if you can provide the same.
    Thank you…

  10. Flemming S Says:

    Thanks a lot for this walk-through, you saved my day !!

  11. Ahmed Says:

    very useful and worked very well for me thanks.

  12. Gerson Aipinge Says:

    This was very helpful. I moved my default Exchange 2013 database from the default drive to the Secondary Volume. It was failing to mount and after I followed these steps it worked 100%.

Leave a Reply

Categories

Archives

MSExchangeGuru.com