Exchange Server 2003 automatically performs regular database maintenance at the store level by default, but you should still manually examine your Exchange server's database maintenance schedule to make sure you're achieving optimal results.
There are 11 different tasks performed as a part of the maintenance -- some apply only to Exchange mailbox stores; others apply only to Exchange public folder stores:
- Purge the indexes on the mailbox and public folder stores.
- Perform tombstone maintenance on mailboxes and public folders.
- Remove expired messages from the dumpster for the mailbox and public folder stores.
- Remove expired messages from public folders.
- Remove deleted public folders with tombstones over 180 days old.
- Clean up message conflicts within public folders.
- Update server version information on public folders.
- Check for and remove duplicate site folders on public folder stores.
- Clean up deleted mailboxes on mailbox stores.
- Check the message table for orphaned messages (messages with a reference count of 0).
- Perform an online defragmentation of the store.
When maintenance is run on an Exchange Server store, it starts with the first of the 10 abovementioned tasks, and completes as many as possible within the allotted amount of time. If the Exchange database maintenance period expires before all applicable tasks have completed, the Exchange server will pick up at where it left off in the task rotation the next evening.
As long as at least one of the first 10 tasks has completed, Exchange Server will spend the last 15 minutes of its database maintenance cycle running an online defragmentation. By default, the online defragmentation will continue for an hour after the maintenance cycle has ended.
Adjusting the Exchange Server database maintenance cycle
Even though the Exchange database maintenance cycle is completely automated, there are some manual things you can do to make sure that it runs optimally. As I mentioned earlier, each store runs its own independent maintenance cycle.
To adjust the maintenance cycle for an Exchange Server store:
- Open Exchange System Manager, right click on the store you want to adjust, and select Properties.
- Navigate to the Database tab, where you can adjust the store's maintenance schedule through the Maintenance Interval dropdown list.
Since the maintenance cycle can be very resource intensive, schedule the maintenance cycle to occur when most of your users are not using the server. By default, maintenance runs from midnight to 4 a.m. This should be fine for most companies -- but you should also consider your backup schedule. Backing up an Exchange database doesn't preempt the tasks performed by the store, but it will cause the online defragmentation to be suspended until the backup is complete.
Also, if your server has multiple Exchange Server stores, you should configure the database maintenance interval to run at a different time for each store (this may not be possible for servers with a large number of stores). For example, you might run the Exchange database maintenance cycle on one store from 1 a.m. to 2 a.m., and perform maintenance on another store from 2 a.m. to 3 a.m.
Controlling online defragmentation intervals
Out of the 11 standard Exchange Server database maintenance tasks, one is more important than the rest -- online defragmentation. An online defragmentation frees space in the Exchange database by compacting database records into the fewest number of database pages possible. Keep in mind that an online defragmentation does not change the physical size of the database though; it simply frees up space within it.
There are a couple of registry keys you can use to control the behavior of the online defragmentation portion of Exchange Server's database maintenance cycle. (As always, keep in mind that editing the registry can be dangerous, so perform a full system backup before trying this technique.)
As I mentioned earlier, online defragmentation runs for 15 minutes at the end of the database maintenance cycle (assuming that a task has completed) and for another hour after that.
The registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\servername\Private-GUID (or Public-GUID for public folder stores) can be used to control the amount of time that is used at the end of the maintenance cycle for online defragmentation.
Simply create a REG_DWORD key named OLD Minimum RunTime (this key is case sensitive), and assign it a value that reflects the number of minutes that you want online defragmentation to run as a part of the maintenance cycle.
You can also control the amount of time that the online defragmentation process runs after the maintenance cycle completes. To do so, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSExchangeIS\servername\Private-GUID (or Public-GUID for public folder stores) and create a REG_DWORD key named OLD Completion Time (again, this is case sensitive).
Assign this key a value that reflects the number of seconds for which the online defragmentation process should run. For example, a value of 3600 would cause the process to run for 3,600 seconds (i.e., one hour).
In most cases, you probably won't have to make any adjustments to the registry keys, but I do recommend making sure that the database maintenance interval settings for each store are optimal for your particular server.
About the author: Brien M. Posey, MCSE, is a Microsoft Most Valuable Professional for his work with Exchange Server, and has previously received Microsoft's MVP award for Windows Server and Internet Information Server (IIS). Brien has served as CIO for a nationwide chain of hospitals and was once responsible for the Department of Information Management at Fort Knox. As a freelance technical writer, Brien has written for Microsoft, TechTarget, CNET, ZDNet, MSD2D, Relevant Technologies and other technology companies. You can visit Brien's personal Web site at www.brienposey.com.
MEMBER FEEDBACK TO THIS TIP
Thanks for this fantastic article! It has helped me immensely as a newbie Exchange admin.
Do you have comments on this tip? Let us know.
Related information from SearchExchange.com:
Please let others know how useful this tip is via the rating scale below. Do you have a useful Exchange Server or Microsoft Outlook tip, timesaver or workaround to share? Submit it to SearchExchange.com. If we publish it, we'll send you a nifty thank-you gift.