Email is the de facto communication channel used in most organizations today. According to a study by Radicati, 2.9 billion people will use email for business communications by the end of 2019. This is almost one-third of the world population! Also, this study estimates that 249 billion emails will be sent every day by the end of this year. To manage this heavy email load, you need a reliable email server, and Microsoft’s Exchange Server is the most popular email server in the world. There are many problems that could crop up in your Exchange server too, the most common of which is corruption in Exchange database files.
What exactly is a corrupted Exchange database file?
Exchange database files, also called EDB files, store and update mailbox information of Exchange users. Sometimes, this file gets corrupted and as a result, all information stored in it is lost. In turn, this impacts not just the productivity of employees but also results in a loss of critical data for the organization.
Before going into how we can fix this issue, let us look at some possible causes so we can try as much as possible to avoid them.
What are the causes of Exchange database corruption?
EDB files get corrupted due to many reasons. Some of the prominent ones are:
- Hardware issues and failures — Issues like overheating and motherboard failure can damage the hard drive sector where the EDB file is stored. This leads to permanent loss of data.
- Software problems — Problems in Microsoft Exchange or the underlying operating system can lead to EDB corruption.
- Viruses — Virus attacks are another common cause of EDB corruption. Many powerful viruses cause boot failures and hardware failures, that in turn, lead to EDB corruption.
- Dirty shutdown — Power failures and accidental shutdowns create a mismatch between data stored in EDB files and in cache. Typically in such cases, the system gets shut down before transactions are committed to the database and this leads to inconsistencies.
- Too much storage — There is a limit to how much you can store in an EDB file. Unfortunately, you don’t often get a “no space” message, so it is something you have to watch out. When the database has more content than the levels specified in the registry, the EDB file can get corrupted.
- Antivirus programs — File-level antivirus programs, especially those that are not compatible with Microsoft Exchange server, can cause EDB corruption.
Thus, these are some of the common causes of EDB corruption.
How to fix corrupted Exchange database files
If your EDB file is corrupted, here are some ways to fix it.
Use backup files
When you back up your data every few hours, you can easily recover your data from the backup file. Let’s say your EDB file gets corrupted all of a sudden and you’re unable to open a user’s mailbox. Simply open your backup file, get the data you want and put it in a new EDB file. Connect this file to the user’s mailbox and everything is back to normal.
Sounds easy, right?
But it is equally important to note that there are some limitations to this recovery method. First off, you’ll miss important emails that were sent or received between the time of backup and the time of corruption. For example, let’s say a backup of your files happens every four hours. The emails your employees send and receive in this intermittent time will be lost if you take data from the backup file.
Some companies overcome this limitation by continuous backup. This is both expensive and resource-intensive, but if you can afford it, this is the easiest way to recover the emails you need.
In case of a time lag between backup and corruption, opt for Eseutil. In fact. Eseutil, a built-in tool, is the most popular solution for fixing corrupted files. It ships with Microsoft, so you don’t have to download or install it separately.
You’ll find this in “C:Program Files\ExchSrvr\Bin”
Before we go into how you can run this tool, let’s see a few of its switches, so you know which option to choose.
The different switches in Eseutil are:
- Eseutil /d — defragments the database files.
- Esutil /r — restores the database.
- Eseutil /g — checks database integrity.
- Eseutil /k — verifies checksums in the database.
- Eseutil /p — repairs corrupt databases.
- Eseutil /m — displays database file headers, logs and checkpoint files.
- Eseutil /y — copies database and log files
- Eseutil /c — performs a hard recovery. This should be used if the database is severely corrupted.
- Eseutil /mh — checks the consistency of the database.
There are some things you should do before you start running this tool, and they are:
- Create a backup of the corrupted EDB file, just to be safe, in case something gets further messed up in the process.
- Identify the located of the corrupted files. You can do a file search, if that works easier for you, instead of browsing manually from folder to folder.
- Dismount the database. To do this, go to Exchange Management Console.
- Navigate to the option “organization configuration”
- Click mailbox
- Choose “database management” tab.
- You’ll see a list of databases. From this list, identify the corrupted database, right-click it, and choose “dismount database.”
- This process dismounts your corrupted database, and you’ll not be able to see this database in the list again.
- Finally, make sure you have enough space for Eseutil to run. Ideally, you should have free space equal to 20 percent of the total size of the database. Otherwise, this tool will not complete the process.
Now that you have the prerequisites ready, let’s see how to run this tool.
To run Eseutil, open the command prompt and type “Eseutil.exe.” Follow this with the switch you want to use. Ideally, run “Eseutil /r” if there is minor loss of data and you have a backup of past information. This will run faster than the other option and will simply restore the data that is unavailable in the database. On the other hand, if you don’t have a backup and if you’re up against major issues, run “Eseutil /p.” This command will do a hard recovery of the EDB file.
Here are step-by-step instructions on running Eseutil.
- As a first step, check for database consistency with the command “Eseutil /mh.” If the result is “dirty,” check if all the log files are present. On the other hand, if the database is “clean,” there is nothing to worry and start moving all the log files.
- If the log files are available, start with a soft recovery using the “/r” switch. In most cases, this will fix minor errors and database glitches for you.
- For some reason, if you encounter an error called “1216,” run Eseutil command with “/i” switch.
- You can even restore data from the backup to complete the process. Check if all the missing data is available now.
- On the other hand, if the log files are not available or if the database shutdown state is dirty, your best bet is to do a hard recovery. Take a backup of your EDB files, and run Eseutil with “/p” switch.
- If this doesn’t work too, use the “/c” switch as your last option.
- Next, check the temp folder. If the recovery was successful, this folder should be empty.
- Finally, use the “/d” switch to defragment the database.
- With this, you can close the Eseutil tool and your recovery is done.
After you finish running Eseutil, next run the tool called Isinteg to check for integrity weaknesses. The idea behind this tool is to find and eliminate any errors in public folders and mailbox databases at the application level. Like Eseutil, Isinteg also comes with a few switches, and they are:
- -? — displays usage information.
- -pri — checks the private store. This is also the default switch.
- -pub — checks the public information store.
- -fix — repairs the information store.
Again like Eseutil, run Isinteg from your command prompt with the appropriate switch.
The format is:
Isinteg -s ServerName [-fix] [-verbose] [-l logfilename] -test testname
Here are some details on how to use this command:
- ServerName: server name
- -fix: checks and fixes the inconsistencies
- -verbose: reports the same
- -l : log file name. Default is /Isinteg.pri/pub
- -test: name of the test. It can be your choice.
There is nothing much for you to do as this tool checks and fixes the possible errors by itself.
If none of the above steps work, it means your database is very severely corrupted and it is beyond the scope of these tools to fix it for you. Your only option, in that case, is to use one of the paid third-party tools available for EDB recovery.
So, have you tried to recover corrupted EDB files using any other method? Do share the details with our readers.