\[Editor's Note: Do you have something to share with other Windows NT Magazine readers? We want to know about it. Write for Reader to Reader online, and you can tell others about your NT discoveries, comments, problems, solutions, and experiences. Email your contributions (700 words or less) to [email protected] along with your name and phone number. We edit submissions for style, grammar, and length. If we print your submission, you'll get $100.\]
Have you ever had Exchange Server crash? My condolences if you have, especially if you had circular logging turned on. If you're not familiar with circular logging, let me explain.
Exchange Server doesn't write transactions directly to its main databases (priv.edb and pub.edb). Instead, the software first stores the information in transaction log files to speed up writing and ensure data integrity. When Exchange Server gets a break, the software writes the information in the log files to the appropriate database. Therefore, the log files usually contain the most current information. As a result, these log files are extremely useful in disaster recovery. When the Exchange Server Information Store (IS) service starts, it automatically replays any information from the log files to the main databases, thus bringing the databases up to date. Although this functionality can help you recover information, there's a catch.
You can set up Exchange Server to use transaction log files in two ways: with circular logging and without. When you enable circular logging, Exchange Server recycles the log files and overwrites those files that contain information the software has already written to the database. When you disable circular logging, Exchange Server still writes the information from the log files to the database; however, instead of overwriting the log file that Exchange Server just committed, the software leaves the existing log file in tact, creates a new log file, and names the new log file incrementally.
Let's look at what happens when you enable circular logging:
1. Transactions (e.g., receiving mail in your mailbox) take place with Exchange Server.
2. Exchange Server writes those transactions to a transaction log file (e.g., edb00000.log).
3. Each transaction log file grows to 5MB as Exchange Server continues to write more information to that log file. (5MB is the maximum size limit for a log file.)
4. Exchange Server commits the information in the log file to a main database.
5. Exchange Server empties the log file, writes subsequent information into the log file, and restarts the cycle.
Without circular logging, the process remains the same until you reach step 5. Let's look at the added differences when you disable circular logging:
5. Exchange Server commits the existing transaction log file to the database and then leaves that log file in tact.
6. Exchange Server creates a new log file (in the case of my example, edb00001.log), and writes subsequent information to this new log file. Exchange Server lets the new log file grow to 5MB, commits the information in the log file to the database, and repeats the cycle of creating a new log file.
If you disable circular logging, you will begin to see several log files appearing on your Exchange Server system by the end of the day, so make sure you have plenty of disk space.
How does all this affect your peace of mind? Well, imagine the worst—a hard server crash. Most administrators perform a nightly backup, which helps. If you trash the IS, you can restore it from the previous night's backup and Exchange will be as current as it was the previous night. But what happens if the crash occurs late in the day and Exchange Server had already delivered 1000 emails and made just as many appointments? If you've disabled circular logging, when you start the IS using the previous night's backup, Exchange Server will replay everything in the log files into the IS, and BANG! you're current. You'll lose little or no data. However, if you've enabled circular logging, Exchange Server will replay only the transactions in the one log file the software hadn't committed to the database and you'll lose a lot of data.
As you can see, transaction log files are valuable. If you want to preserve them, turn off circular logging. To turn off circular logging, locate the appropriate Exchange Server system. View the server's properties by clicking File\Properties, and go to the Advanced tab. Clear the two Database Circular Logging check boxes. You must do this individually for each Exchange Server.
One more tip: Don't ever delete, rename, or move a *.log file—you'll be sorry you did. Performing any of these functions on a log file will cause the database to be in an inconsistent state. What's more, total recovery will be impossible if you delete the log files.
My recommendation? Turn off circular logging, implement a backup strategy, and have plenty of disk space available on your Exchange Server system. You'll be glad you did.