Article ID: 240145 - Last Review: October 25, 2007 - Revision: 6.4 How to remove Exchange Server transaction log filesThis article was previously published under Q240145 This article is a consolidation of the following previously available articles: 259751, 315196 This article also contains information about deleting the transaction log files. In a worst-case disaster scenario, you may not be able to recover all your data without the log files if the database becomes corrupted. Transaction log files provide a high level of recoverability. Therefore, you should only perform the procedure that is discussed in this article as a last resort in emergency situations if you cannot complete a full backup. A full backup permanently deletes the committed logs automatically after backing them up. On This PageSUMMARY
Exchange Server database transaction logs record all changes to an Exchange Server database. Over time, these log files accumulate and use all the available disk space if they are not periodically removed from the hard disk. Exchange transaction log files have a fixed size. For Microsoft Exchange Server 2003 and all earlier versions of Exchange Server, this size is exactly 5 megabytes. When a transaction log is full, the transaction log is renamed with a numeric sequence number, and a new current log is generated. The current transaction log is the one most recently created by Exchange Server. In Microsoft Exchange Server 5.5, the current transaction log is always named Edb.log. In Microsoft Exchange 2000 Server and in Exchange Server 2003, the current log is named with the storage group prefix. For more information, see the “Storage groups” section. Exchange automatically removes unnecessary log files by using one of the following methods:
147524
(http://support.microsoft.com/kb/147524/
)
How circular logging affects the use of transaction logs
258470
(http://support.microsoft.com/kb/258470/
)
How to modify the circular logging setting
If any one of the following conditions is true, the transaction log files will increase in number until the hard disk drive space is exhausted:
Note For the purposes of this article, "removing" a transaction log file means moving that transaction log file to another location where the transaction log file can be backed up, stored, or deleted, depending on your requirements. For the purposes of this article, "deleting" a transaction log file refers to the kind of removal that does not let you to back up or restore that transaction log file. MORE INFORMATIONManually removing transaction log files that are not requiredTo correctly remove excess transaction log files, follow these steps:
Database statesIf an Exchange Server database has not been shut down correctly, the database remains "attached" to its transaction log stream. This means that not all the data from the transaction log file has been secured to the database files. During the next startup of the database, Exchange Server detects this condition. Exchange Server then applies the missing data to the database files. If the log files that contain this data are not available, the database cannot be started.When an Exchange Server database is shut down correctly, that database "detaches" from its transaction log stream. In this situation, the database does not require the previous transaction log files when that database next starts. However, these log files could be useful if a backup or an earlier version of the database were to be restored. The log files will be used to roll the database forward from the time of backup. Therefore, transaction log files should not be permanently deleted until you are sure that you will not want to replay them into an older version of the database. Before you manually remove any transaction log files, you should determine the state of any database that used the particular transaction log files. In this situation, determine the "attach" or "detach" state of each database that used the particular transaction log files. You can determine whether a database is attached or detached by examining the database file header by using the Eseutil utility's /MH command switch. For example, run the following command at a command prompt where database_name is the name of the database that you want to examine: eseutil /MH database_name For example, to examine the Mailbox Store (Server1) database, typeeseutil /MH “Mailbox Store (Server1).edb” Note To examine the header of a database by using the Eseutil command, the database must be stopped.After you run this command, examine the State value in the header information that appears. The State value provides the following information about whether the database has been correctly detached:
Sometimes the capacity of both of the reserve transaction log files might be exceeded. This causes all the databases in the storage group to be stopped in a Dirty Shutdown or Inconsistent state. Warning If you run out of disk space on the transaction log drive, the databases may not be able to shut down cleanly. If one or more of the databases are in a Dirty Shutdown or Inconsistent state and if you delete all the transaction log files in order to free disk space, no databases in the affected storage groups will be mountable again without being repaired or restored. You must not delete log files that are still required by one or more of the databases. Storage groupsExchange Server databases are organized into storage groups. A storage group is a set of databases that share a single transaction log file stream. In Exchange Server 5.5, there is a single Information Store storage group that contains up to two database files. These two database files are named Priv.edb and Pub.edb respectively. Additionally, Exchange Server 5.5 contains a single Directory Service storage group that contains a single database file that is named Dir.edb.In Exchange 2000 Server and in Exchange Server 2003, there is no Directory Service storage group. In Exchange 2000 Server and in Exchange Server 2003, there can be up to four Information Store storage groups per server. Each of these storage groups can contain up to five databases. The names of these databases are configurable by the administrator. If the transaction log drive becomes full, all databases in the storage group will be stopped immediately. When you start any database in a storage group, the state of all databases in the storage group is checked. Any required transaction log file replay is performed together for all databases before the first database can start. Transaction log file replay operations and events generally apply to all databases in a storage group, not to an individual database. Important You should verify that each database file is in a Clean Shutdown or Consistent state. One or more databases in a particular storage group may be correctly detached even though another database in that same storage group is not correctly detached. Do not assume that all databases in a storage group are in a Clean Shutdown state based on the state of the first database that you examine. Note For Exchange Server 5.5, you must examine each database that is contained in a single .edb file by using the Eseutil command. For Exchange 2000 Server and for Exchange Server 2003, each database is divided into two files. The two files are an .stm file and an .edb file. Examine the state of both the .stm file and the .edb file by using the Eseutil command. Log filesTo determine which transaction log files are required by the databases in a particular storage group, follow these steps.For Exchange Server 5.5Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:322756
(http://support.microsoft.com/kb/322756/
)
How to back up and restore the registry in Windows
For Exchange 2000 Server and for Exchange Server 2003
Note The Log Required field may report a range of one log, but the corresponding numbered log file cannot be found. For example, The Log Required field may report a range of 28221-28221, but the log file that is numbered 28221 cannot be found. This can occur if the checkpoint is in the most recent log file. The most recent log file is always named with only the storage group prefix. For example, the most recent log file may be named E01.log. Until this log is full and until a new log is generated, the file name of the current log does not include the log sequence number. You can verify the actual internal sequence number of the current log file by viewing the log file header by using the following Eseutil command: eseutil /ML log_prefix.log
For example, if the log prefix is E01, use eseutil /ML E01.log.
The lGeneration field of the log file header reflects the actual sequence number of the log file.If you must restore an Exchange Server database from a backup, and if you want to recover the Exchange Server database without losing data, you must also restore all the transaction log files that were created after that backup was performed. If there is a break in the sequence of the transaction logs, you cannot roll forward past that break. In this situation, you must remove all the higher-numbered logs after the break. This includes the current log file. Note Even if all the databases in a storage group are in a Clean Shutdown or Consistent state, you should not remove the most recent log file. If you remove the most recent log file, a new set of log files is generated, starting with the sequence number 0x000001. This new set of log files will prevent an Exchange Server database from a previous backup from being rolled forward. For more information about how to repair an Exchange Server database, click the following article number to view the article in the Microsoft Knowledge Base: 893083
(http://support.microsoft.com/kb/893083/
)
Top support issues for the Exchange information store
| Article Translations
|
Back to the top
