Role of transaction log files in exchange server
Microsoft Exchange server is a widely used email and communication system that is used by organizations all over the world to send messages, store files and attachments, sort mail into folders, and collaborate on tasks. An IT administrator can create user mailboxes on the Exchange server, which are stored in the Exchange database file also abbreviated as EDB. An Exchange server does not directly write changes to the database file because it is a slower method of access. Instead, the changes and updates to the mailboxes are temporarily saved in the Exchange server's memory and written to log files before being committed to the database file. As a result, it's important to understand the purpose of Exchange transaction log files and how they affect database performance.
What are Exchange transaction log files?
A transaction log in Microsoft Exchange server is a file that records all transactions that are updated in the server's memory before they are finally committed to the database. It safeguards the integrity of the database file and, together with the checkpoint files, ensures the database's efficient operation.
Following a series of operations, the Exchange server replays or commits the transactions from the log file to the database. However, if the server is unable to perform an operation due to a power outage or crash, the transaction is not committed to the database making it inconsistent with the log files.
What is a Clean Shutdown of Exchange database?
A Clean Shutdown is the state of the Exchange database after all transactions in the log have been successfully committed to the database. In this state, the database file is said to have been properly closed (consistent) without errors, and the EDB can be mounted to the Exchange server.
What is Dirty Shutdown?
A Dirty Shutdown is an Exchange database state that occurs as a result of incomplete transactions that have not been committed to the database file (.EDB) due to factors such as missing log files, Exchange server shutdown, or EDB file corruption. Let's take a look at some of the causes of Dirty Shutdown in databases.
What are the causes of Dirty Shutdown?
One of the most common causes of the Dirty Shutdown state is that log files on the Exchange server are missing or deleted. When you run the eseutil utility to check the status of the database, it displays the missing log files that caused the database to become dirty. Other reasons for the Dirty Shutdown error are listed below.
- Sudden or abrupt termination of Exchange server.
- Missing or deleted log files from the Exchange folder
- The Exchange database is inconsistent with the log files.
- Power failure when the Exchange server is committing to the database.
- Virus attack and ransomware threats to your system.
- Physical and logical corruption of the EDB file.
- Oversized EDB file leading to Exchange server crash.
- Hard-disk failure on which Exchange server is installed.
- Faulty Exchange server updates or relying on outdated versions.
- Conflict with installed anti-virus applications.
- Failure of Exchange to correctly read the transaction log files.
What happens when an Exchange database enters the dirty shutdown?
When the Exchange database enters the Dirty Shutdown state, the user mailboxes become inaccessible, and it is impossible to directly mount the database to the server. Because the transactions to be committed are still pending, the database is said to be dirty and inconsistent with the log files.
In addition, an Exchange server cannot mount the database file while it is in Dirty Shutdown and displays errors such as ‘failure to mount the database’ and Jet Errors with the following error codes.
- Failed to mount database ‘Database_123’ hr=0x80004005, ec=-528. An Active operation Manager Failed.
- Failed to mount database ‘Database_123’ hr=0x80004005, ec=-530
- Operation terminated with error -550 JET_errDatabaseDirtyShutdown, Database was not shutdown cleanly.
- Operation failed with the message: MapiExceptionDatabaseError. Unable to mount the database (hr=0x80004005,ec=-528).
How to check the Exchange database for dirty shutdown?
To check the Exchange database for clean or dirty shutdown, launch Eseutil from the Exchange server's bin directory and run the command eseutil /mh on the database file. If the database is inconsistent with the log files, the State 'Dirty Shutdown' is displayed.
How to Fix Exchange Database (EDB) Dirty Shutdown?
To resolve the Exchange database Dirty Shutdown error, make the database file consistent with the log files. This can be accomplished by restoring the missing log files or performing a soft and hard recovery with Microsoft's Eseutil tool. If you are unable to locate the missing log files or if the EDB file is severely corrupted, you can recover it using EdbMails Exchange recovery software.
Before you begin the recovery process, make sure you have a complete backup copy of the EDB file and any transaction log files. If you are using an older version of Exchange, such as Exchange 2003 or 2007, take a backup of the .stm, priv1.edb, and pub1.edb files, and make sure your computer has sufficient disk space for the recovery.
Steps to fix and recover database EDB file from Dirty Shutdown error
- Step 1: Launch eseutil from the Exchange server bin directory
- Step 2: To check the database's consistency and state, run the cmdlet eseutil/mh.
- Step 3: If the State column displays 'Dirty Shutdown' with the log file number, the database is inconsistent.
- Step 4: Copy the missing log files to the database folder if you have them.
- Step 5: To perform a soft recovery and replay the log files, run the cmdlet eseutil/r.
- Step 6: If the soft recovery fails, run eseutil/p to perform hard recovery.
- Step 7: Defragment the Exchange database file using the cmdlet eseutil/d.
- Step 8: Perform an integrity check using the IsInteg tool or NewMailboxRepairRequest cmdlet
- Step 9: Finally, mount the database to the Exchange server to restore the mailboxes.
Remember that performing a hard recovery deletes data that eseutil cannot recover. This is a problem, for example, if your EDB file becomes corrupted as a result of physical or logical errors. Furthermore, depending on the size of your mailboxes, this method can take a long time and requires extensive technical knowledge. The hard recovery should only be used as a last resort; if you want to completely recover an EDB file without losing data, the best solution is to use the Edbmails Exchange database repair tool.
How to fix Dirty Shutdown in Exchange 2019, 2016, 2013, 2010, 2007 and 2003 using EdbMails?
EdbMails can repair Dirty Shutdown errors in Exchange 2019, 2016, 2013, 2010, 2007, 2003 by fully repairing the EDB file and allowing you to migrate mailboxes to another Exchange server or export the EDB to Outlook PST format. Let's take a look at how to use the application to fix the error.
Steps to export disconnected Exchange mailboxes by using EdbMails
- Step 1: From the Task Manager, terminate any running Exchange server services.
- Step 2: Copy and save the offline EDB file from the Exchange directory to a secure location.
Ensure that you take a backup copy of the EDB file and have Microsoft Outlook installed on your computer.
- Step 3: Install and run the EdbMails Exchange recovery software.
Download EdbMails and install the application on any computer. You can also perform the recovery and conversion by installing EdbMails on a non-Exchange server computer. The following steps describe how to get started with the application.
Launch the application and click 'Log In' or 'Start Your Free Trial'.
Select the migration method as 'EDB to PST. EDB to Office 365. EDB to Exchange'.
- Step 4: Using EdbMails, navigate to the folder and select the offline EDB or STM file.
Select the Exchange database file that is in the dirty shutdown state to recover and convert the EDB to PST. Alternatively, you can migrate the Exchange mailboxes to Live Exchange or perform the EDB to Office 365 migration
- Step 5: Select all the mailboxes and click 'Migrate to live Exchange'.
- Step 6: Enter the 'IP Address' or 'User Credentials' to connect to the target Exchange server.
Select 'Connect using Global admin User' and select 'Connect to Mailbox(es)'. You can also connect to a specific user mailbox or load a list of user mailboxes by using a CSV file.
Connect to the Exchange server using Default connection or Autodiscover Email options. Enter the required login credentials to connect to the target Exchange server mailboxes.
- Step 7: Map the mailboxes from the EDB file to the target Exchange
The mapping operation is useful if you have a large number of mailboxes to migrate. Verify the mapping and enter a name for the Exchange migration job to save the settings for future migrations.
- Step 8: Start the migration and verify the migrated mailboxes on the new Exchange.
Begin importing your mailbox data and folders from the EDB file into Exchange 2019, 2016, 2013, or 2010, and then check the list of imported items with the View Log after the operation is finished. You can also pause and resume the migration.
You can also use EdbMails to export mailboxes to PST and then import the file into MS Outlook. This application has the advantage that it enables you to recover the EDB from Dirty Shutdown without log files or relying on Exchange server connection. EdbMails can also easily repair corrupted, disconnected, offline, and dismounted database files.
Conclusion
The Dirty Shutdown error occurs when the changes in the Exchange transaction log files are not committed to the database. As a result, the EDB file cannot be mounted, rendering the user mailboxes inaccessible. The Dirty Shutdown is caused by a variety of issues, one of which is missing or corrupted log files. Eseutil can be used to replay the log files and recover the EDB file. However, if the log files are no longer available or the database file is severely corrupted, the only option is to repair the corrupted EDB file with EdbMails. It is a Microsoft partnered Exchange recovery tool that can recover, convert, and migrate EDB files from any Exchange version (2003-2019).