Read time 5 minutes
In Exchange 2010 or any other version, it is necessary to have access to log files to repair corrupt Exchange database completely. When Exchange Server starts up, it always performs a check to verify whether the database is detached from the transaction log or not. The primary reason behind the inspection is to ensure that no transactions are left to be written to the database. However, if any database still remains attached to the transaction logs, Exchange Server automatically detaches it by replaying the available log files.
Log files can be very helpful when you need to restore the database from a previous state. That’s why it is recommended not to delete log files permanently. Moreover, when the Exchange Server is in Dirty Shutdown state, and you need to recover the database from a recent backup, then transaction logs play a vital role.
In this article, we will discuss how Exchange Database can be recovered in Dirty Shutdown state with or without log files.
What causes an Exchange Dirty Shutdown?
Dirty Shutdown state in an Exchange Server occurs when the log files are not committed to the database causing potential data loss and disturbances in the email communication. Some common causes behind Dirty Shutdown are mentioned below:
- Incomplete transactions due to sudden power failure.
- Deleted or corrupted log files.
- Abrupt termination of Exchange Server services.
- Hardware overload beyond the capacity of Exchange Server.
Now we know the reasons behind Dirty shutdown, so let’s dive in to learn how to fix Exchange 2010 dirty shutdown step-by-step.
How to check the state of Exchange Server 2010 Database?
Most of you might know that a transaction is a set of operations performed against the database to ensure that the Exchange Database remains intact with complete data. Each of these transactions is recorded in log files to keep track of the changes. It restores the database to its working state by rolling back the transactions if anything goes wrong.
Now, you must be thinking about how to verify whether the database is in a clean state or Dirty Shutdown state. Well, there are the commands that you can use to verify the state of your Exchange Database.
Note: Make sure you are connected to Exchange Server while running these commands.
Microsoft provides a useful in-built utility that can be used to verify the state of the database as well as to repair and restore the database.
- To check the state of the public folder database, open CMD on your system and type the below command: Eseutil/mh “Path of the database.”
C:\program files\exchsrvr\bin>eseutil/mh “drive:\program files\exchsrvr\mdbdata\pub1.edb”
- To check the private folder state of the database, type the below command:
C:\program files\exchsrvr\bin>eseutil/mh “drive:\program files\exchsrvr\mdbdata\priv1.edb”
If the database is in a Clean shutdown state, it has been detached from the transaction and is consistent. However, if it is in Dirty Shutdown state, it means the database is still attached to the transaction and is inconsistent.
The Exchange Server database is entirely based on JET Blue engine technology, known as the Exchange Storage Engine. This engine uses database cache for optimizing the input-output operations to the log files. If the database is not updated with the transaction logs, the JET engine marks the database pages as Dirty. That’s why the Exchange database faces the Dirty Shutdown state.
Fixing Dirty Shutdown state
There are two methods to fix the Dirty Shutdown state, depending upon the availability of log files.
1. Soft Recovery Method – With Log Files: If the log files are available, then troubleshooting dirty shutdown error using Eseutil utility is quite simple and straightforward. This solution is known as Soft Recovery of database, in which the transaction logs are replayed with log and checkpoint files. The command to recover the database and resolve Exchange 2010 Dirty Shutdown issue with log files uses a /R switch with Eseutil.
Eseutil /R E00 /L location of log files
E.g.,
Eseutil /R E00 /L c:\exchsrvr\logfiles
If the log files are missing, then the soft recovery method will fail. You can receive multiple errors when log files are missing or in Dirty Shutdown state. Some of the errors are:
- Error – 501 (JET-err _errLogFileCorrupt) – “Log File is Corrupt”
- Error -515 (JET_errInvalidLogSequence) – “Any log file from the sequence is missing”
- Error -514 (JET_errBadLogVersion) – “Log file generated with different Exchange Server or edition.”
So, before applying any of the methods for recovery to fix Exchange 2010 Dirty Shutdown, it’s necessary to verify the state of log files as well. For this, you can use the following switch:
Eseutil /ml ” log files path\log prefix”
2. Repair – Without Log Files: Another method to repair the database involves use of other Eseutil switches. In case, if you don’t have a valid backup or the log files are inconsistent, then you can repair the database using /p switch with Eseutil. The command will be as follows:
C:\Program File\Exchsrvr\Bin>eseutil /p “C:\Exchsrvr\Mailbox Store (SERVER).edb”
On running this command, you will receive a prompt, click OK to run the command. It will start repairing the Database.
Also, once the repair process is complete, check the state of the database once again to ensure whether it is now in a shutdown state or a clean state.
Things to know before using Eseutil for Dirty Shutdown state
- Using Eseutil utility requires technical expertise because using it incorrectly can lead to data loss.
- It is necessary to have 110 percent size of the database as free space.
- The Eseutil approach can take significant time depending upon the size of the database.
If you cannot fix the issues using Eseutil, you will have to use third-party Exchange EDB Recovery software that can help you recover the data in all situations of database corruption. Kernel for Exchange Server is one such utility that is very effective in recovering the Exchange database in any situation. It offers a range of features and functionalities that makes it capable of recovering data from highly corrupt Exchange databases.
Conclusion
Fixing Exchange Dirty Shutdown state, especially when missing log files, is a very complicated task. Although Microsoft does provide Eseutil command-line utility to fix the issue, it isn’t helpful in every situation. In this article, we have discussed how you could fix the Exchange Dirty Shutdown state with Eseutil commands. We have also recommended Kernel for Exchange Server, which can be used when Eseutil fails to repair the database.