How does an Exchange Server database get corrupted?How we can fix corruptionin Exchange database?
An Exchange database is made up of log files and EDB file.Both files are dependent on each other. Why is that? If the database is directly opened by users or applications, the database will be locked and easily damaged.So cache and log files act as buffer between the user/ application and the database for performance and health. Likeany other file, it can get corrupted for various reasons, which are:
- Sudden power cut
- Hardware failure
- Software failure like updates
- Third party software not being application compatible
- Incorrect antivirus configuration
- Human error
- Malware and viruses
- Lack of storage space
In case of a sudden power cut,the server is turned off without prompting, which means that the database could still be open while the power is lost. This maycause database corruption.Any third-party applications like backups and antivirus,which are not Exchange Server compatible,would hinder or stop the Exchange Server from working as it should be while locking the database files. Viruses and other malware code like Ransomware, apart from wreakinghavoc on your server, can also corrupt thedata.
All of thesecan cause database corruption.However, extracting data from a corrupt database is not easy.The fact being that the database is in EDB format, which is proprietary of Microsoft.Unfortunately,if the database is not mounting, there isn't much one can do to natively extract data from an EDB file.
One mightsay that this would not be a big deal since the server and database can be restored from backup as it's a virtual machine. On the other hand, the backup is usually done during the night.However,looking at businesses these days, email flow is increasing by the minute while business is moving more on the cloud and depending on emails. So if the databasegets corrupted in the middle of the day, restoring from last night's backup would result in loss of whole dayemails. Not just emails, but also loss of tasks, journals, calendar meeting and other data which is stored in public folders and other collections.
Before we start working on the EDB, using the native tool EseUtil, we need to take a backup of the database somewhere on our network just in case we would need Microsoft's support (it will be explained later, why we need this). Another thing we need to see that there is enough space on the server for the recovery process.
On the Exchange Server, open command prompt as Administrator and browse to the location of the affected EDB file. Type the following command to get the status of database.
This will show all the information related to the database.The important thing to notice is the state of database. If the database is in a Dirty Shutdown state, then youneed to dothe recovery of the database by using the eseutil/r parameter, which will do a soft recovery of the database. After this is complete, you can try to mount the database.But if this doesn't work, then the only solution would be to run a hard recovery. One thing to note here is that with hard recoverythere is a possibility that you would fix the database, but it may result in data loss. Now, depending on the damage tothe database, the process will purge any corrupted data from the database andtry to bringit back to a Healthy Shutdown.However,apart from loss of data, there is apossibility that this process maynot be successful.
In addition, before running a hard recovery, make sure that you have the same amount of free space as that of the database size.
Remember we said above about backing up the database? The reason being that if you run a hard recovery on the database, Microsoft isnot bound to assist, and itcan get this information from a hidden parameter in the database.
Run the following command,
After this is done, you would be able to mount the database.
What are the challenges of using EseUtil for recovery? Well, the worst part is the data loss when using the hard recovery. The other thing is the resources needed like space and administrative effort.
A better alternative to this is to use Stellar Repair for Exchange. Exchange Database Recovery software enables you to repair corrupt databases, export data from one or multiple EDB files, export EDB files directly to live Exchange database or Office 365. How you benefit from this? Well, the downtime will be reduced by 75% and the company will be back in business in no time and with minimal data loss.
Is it safe to run eseutil /p on the database?
If you are using eseutil/p command, it is safe if you have in-depth knowledge of the command. Also, don't stop the process until it completes as it can corrupt the database file.
How much time eseutil/p process is going to take?
Eseutil utility runs at approximately 3 to 6 GB per hour, and defragmentation takes 9 GB per hour. The exact timedepends on your hardware and production environment.
eseutil /p crashes when repairing damaged tables?
Make sure you have enough space (at least 110 percent of the current database you're repairing) on the drive where you are performing the repair. It is also recommended to disable virus scan temporarily, while you perform the repair.