How Exchange Database Files Relate to Each Other

Transaction logs are files that Exchange uses to commit data (e- mail messages, user additions, creation of folders, and so forth) to the corresponding database file on disk. For example, in the Exchsrvr\Mdbdata folder you may see files such as Edb.log, Edb00001.log, Priv.edb, and Pub.edb. The Edb*.log files are the transaction logs and the *.edb files are the information store database files. (The Priv.edb file is the private information store and the Pub.edb file is the public information store.) The most current transactions are stored in the Edb.log file; when the Edb.log file reaches 5 megabytes (MB) in size, a file called Edbtmp.log is created to accept incoming transactions and the Edb.log file is renamed to Edb00001.log. After the Edb.log file is renamed, the Edbtmp.log file is then renamed Edb.log. This process is repeated each time the Edb.log file reaches 5 MB in size. Therefore, the log files build up as more and more transactions are created.

Exchange uses these write-ahead transaction logs to ensure up-to-the-second recoverability of the database. Each (operation) transaction is written to a transaction file and to the database cache, and eventually to the database. After data is written to the database, a checkpoint (Edb.chk) is advanced. This checkpoint marks the position in the log files at which the database is in a consistent state. Thus, in the set of transaction logs, there is a portion that can be considered active and a portion that can be considered inactive. If an event such as a power outage causes the system to fail, Exchange goes into automatic recovery when the system is restarted. This entails rolling forward through the transactions in the existing log files to the checkpoint.

An inconsistent Exchange database file is a file that all of the outstanding transactions have not been written to yet. During normal operation, Exchange 2000/2003 database files are inconsistent because there is information in the cache that has not yet been physically written to the file. In general, an Exchange database file can be considered consistent only after a normal shutdown of the database service.

As described earlier, during recovery, the inactive portion of each log is not used; however, the logs can prove to be valuable when media failures occur. If the transaction logs are hosted on a different medium than the database and the medium containing the database fails, it is possible to generate a complete recovery by restoring the last full backup on the new medium and then rolling forward through all the log files. Essentially, the checkpoint gets moved back from its location relative to the database on the disk that failed. Media failure is not a common scenario, but this is the only way (other than a fault tolerant solution, such as mirroring) that Exchange can recover from media failures.

Exchange 2000/2003 Specific Information

To avoid confusion about which log files belong to each storage group, Exchange 2000/2003 logs that belong to a given storage group are named with a unique log prefix, which is the first three characters of the file name. Valid log prefixes for the four storage groups that are supported on an Exchange 2000/2003 server are E00, E01, E02, and E03. Throughout this article, the log prefix for a storage group is designated as E0n. The current log file for a storage group is always E0n.log.

GOexchange�, �1998-2003 Lucid8 Information Services �