How To Resolve Exchange Dirty Shutdown Error
This write-up will allow users to resolve the Exchange dirty shutdown error by using Exchange Extensible Storage Engine Utilities (ESEUTIL) tool.
For Exchange Server to start up smoothly, it is necessary that its database is shut down properly. For this, it has to be ensured that database is “detached” to the transaction log files (means the data in transaction log is committed to the database files). At the time when Exchange Server is started, this condition is checked out and the missing data in the database files is then committed automatically with the help of available log files.
If the database is detached from the transaction log files, Exchange Server does not require the previous log files to start up. The log files prove to be a great asset when an older version of database has to be restored. It is strictly recommended not to permanently delete any log file until it is ensured that older version of database isn’t needed to be replayed.
|Transaction log traces every minute and major change done in Exchange database. The data or information that has to be added to the user mailbox is first registered in log files after which it is written into the database.The size of a log file is fixed and when the transaction log is full, a new one is created. The numbering of log file in a sequence helps the user to understand that a new log is generated.
To check out if a database is properly detached; verify if it is in clean shutdown state or dirty shutdown state. To examine the state value of Exchange database, follow the steps mentioned below:
Click on the ‘Start’ button and in the run textbox, enter ‘cmd’ and hit enter.
For Public Folders, type the command:
For Private Folders, type the command:
Here it is assumed that Exchange Server is installed at: ‘c:\program files\exchsrvr folder’ and the database is saved at ‘c:\program files\exchsrvr\mdbdata folder’.
- If the State=Clean Shutdown, it means that the database is correctly detached.
Database State: Clean Shutdown
- If the State=Dirty Shutdown, it means there are transactions that are awaited to committed to the database.
Database State: Dirty Shutdown
What is Dirty System Shutdown?
The Exchange Server database is based on JET engine where log files is responsible to keep a track of input and output operations in the database file. ESE uses the concept of mailbox database cache so as to reduce the input-output operation count.
When an operation is loaded to the cached memory and it is not committed to the information store, the JET engine marks it as DIRTY. Until the pending transaction is committed to the database, it is not considered as updated and till the time dirty pages are there in the database, it is considered as inconsistent.
Until the transaction could have completed, if the system shuts down accidently, the database remain attached to the log file due to which DIRTY SYSTEM SHUTDOWN error is received on screen.
Error Messages You Might Receive Due to Exchange Dirty Shutdown Error
Dirty Shutdown Error
How to Fix Dirty Shutdown Error?
1) When LOG Files are in Clean State
This problem can be resolved by performing soft recovery Exchange 2016/2013/2010 database wherein the transaction log is replayed when it is re-mounted due to unexpected stop.
This can be done using Exchange Storage Engine Utility (popularly known as ESEUTIL) which is an executable file to perform repair, integrity check, defragmentation and other operations on Exchange database while it is offline. For soft recovery of database, it has to be ensured that required log files are not damaged. To test this, type “Eseutil /ml “Path of the log files\log prefix” in command prompt.
Log File State
The syntax for soft recovery is:
Soft Recovery Syntax
Soft Recovery Process
2) When Log Files are Missing
When the log files are not in clean state, dirty system shutdown errors can be fixed with hard recovery of database. It is similar to soft recovery with the only difference that the transaction log is replayed by restoring database from online backup.
If a valid backup is available, restore database files (.edb and .stm) and transaction logs. When the restoration process is complete, a file named ‘restore.env’ will get created at temporary folder ‘C:\Temp’.
It is recommended to make a copy of folder containing log files and restore.env folder as during hard recovery, there are chances that some data might get lost.
For hard repair, run the following command: ‘Eseutil /cc “Path of the restore.env containing folder’
Hard Repair Process
Now go to the folder where restore.env folder was saved. You will find that it is empty.
Post Hard Repair
3) When there is no Valid Backup
If log files are not available and no valid backup is available, then in the command prompt, enter following recovery syntax: eseutil /p <database_name>
For No Valid Backup
Following message will be prompted on screen, click OK
And the recovery process will get started:
When recovery is complete, again run \mh switch to check the consistency of database. It should be Clean Shutdown. After this, defragment the database.
Perform Offline Defragmentation using Eseutil
Offline defragmentation arranges the database on Server, removes the unused pages thereby reducing the disk space. A new database is created that comprises of the old data free from unused pages. The database thus created is compacted and helps to manage the dis space.
Eseutil/d command is used to defrag Exchange mailbox database and the syntax is ‘eseutil /d Database_Name’
Checkpoint File: To keep a track of what database has not been written to the database, Exchange Server maintains EDB.chk (checkpoint) file. At the time of recovery after any failure, it indicates the log file point from where the recovery should start.
Restore.env Folder: Similar to the checkpoint file, this folder defines the range of transaction logs that should be present in temporary folder for database recovery.
Bringing It All Together
The process shared above to bring inconsistent Exchange database into consistent state exemplifies complexity via ESEutil. A simple procedure to fix dirty shutdown error can be adopted through SysTools Exchange Recovery software. The solution has specialization to recover and repair corrupted offline/dismounted Exchange database files. Users can use this tool to recover & repair EDB file and mailboxes from corruption and export directly to the to the Live Exchange Server, Office 365 and multiple file format.
Download Now Purchase Now