Best Practices for Performing Database Maintenance

 < Day Day Up > 

Database maintenance is an easy task to put off because it is one of the most involved maintenance practices you will perform with any version of Exchange. It is also, however, one of the most important maintenance tasks to perform, and it is recommended that administrators run database maintenance routinely. Doing so keeps the Exchange Server 2003 system healthy , prevents downtime, helps maintain service levels, minimizes corruption, and reduces chances for data loss.

If your organization requires a reliable and stable messaging environmentand most organizations doperiodic database maintenance can be used to achieve these goals. The primary reason why Exchange systems at some point become less reliable or less stable is that any database that is not maintained suffers from at least a certain level of corruption. There are also other reasons why databases get corrupted:

  • Improper shutting down of the system

  • Poorly managed systems

  • A poorly maintained disk subsystem

  • Hardware failures

  • Databases exceeding a manageable size

  • Failure to use or review systems or operational management tools

  • Manual modification of Exchange databases

  • Deletion of Exchange transaction logs

  • Assumption that Exchange Server 2003 performs all the database maintenance that is required

  • Neglect

Database maintenance consists of both online and offline maintenance processes and procedures. Online maintenance is performed automatically by default, and offline maintenance is more involved. It requires dismounting the specific database within a given storage group and running the appropriate utilities against it. It is the offline maintenance that is most often overlooked.

CAUTION

Exchange Server 2003 databases and transaction log files should never be manually modified. Use only the utilities meant to be used for Exchange Server 2003.


Online Database Maintenance

Similar to AD's automatic maintenance schedule, Exchange Server 2003 out of the box provides general database cleanup maintenance on each of the databases. During the automatic Exchange Server 2003 database cleanup, the following five tasks are performed:

  • Tombstone Maintenance Deleted messages are compacted for both user mailboxes and public folders. This process looks for deleted messages and makes sure they have been deleted from the databases, and any references to the delete messages (including the data space the message actually took up) are cleared from the database.

  • Index Aging Index aging cleans up user-defined views that are created within the Outlook client and that have not been accessed or used within the predefined timeframe set in the Aging Keep Time Registry entry.

  • Age Folder Tombstones This task applies only to the public folder storage area of the messaging system. All folder tombstone entries that are older than the default 180 days are permanently removed from the list. This event helps control the size of the folder tombstone list.

  • Update Server Versions The Exchange public store uses the server's version information to establish and maintain the functionality between different versions of Exchange that might be in use throughout an enterprise.

  • Message Expiration Messages in the public folders that have exceeded the predefined time value for remaining on the server are deleted from the system.

Automatic online database maintenance performs approximately 60% of the regular functions needed to maintain integrity of the Exchange databases. These maintenance tasks are all performed while the entire system is online. Another 1020% of maintenance can be accomplished by refreshing the Exchange- related services within the Services MMC snap-in.

NOTE

Online database maintenance also reclaims unused whitespace in the database, but it does not compact or defragment it.


Unfortunately, even performing up to 70% or 80% of maintenance is not enough to ensure maximum use of the Exchange Server 2003 production environment. In fact, the remaining percentage of Exchange Server 2003 maintenance is vital to the overall health and integrity of the Exchange databases. Offline maintenance picks up where online maintenance left off.

Performing Offline Database Maintenance

As mentioned earlier, and as the name implies, offline database maintenance prevents users from accessing the particular database that you are servicing . For this very reason, it is important to perform offline database maintenance during non-business hours. Equally important, it is a good idea to schedule this downtime to minimize its effects on end-users.

Offline database maintenance is useful for repairing, recovering, and defragmenting Exchange Server 2003 databases. The eseutil and isinteg utilities are used to perform the maintenance. The most common maintenance procedure is defragmenting the databases, and you do not want to repair or recover databases more than you absolutely have to. These maintenance functions are built into eseutil . To minimize having to repair or recover a database, include offline database defragmentation maintenance routines in the company's maintenance schedule. A best practice for defragmenting the database is on a quarterly basis. However, this depends on the size of the database, the issues that are being experienced , and scheduling considerations.

NOTE

The following steps to perform offline database maintenance assume that the database has been copied offline to another volume.


To perform offline database maintenance, follow these steps:

  1. Log on using an account that has Exchange Full Administrator privileges to the Exchange server that houses the databases that will be maintained.

  2. Open the ESM by selecting Start, All Programs, Microsoft Exchange.

  3. Expand the Administrative Groups, First Administrative Group, Servers, <ServerName>, <StorageGroupName> in the left pane.

  4. Right-click the database that will be maintained and select Dismount Store.

  5. Select Yes to continue to dismount the store.

  6. Open a Command Prompt by typing cmd from the Start, Run dialog box and clicking OK.

  7. Change the drives and directory to where isinteg resides (the default is %SystemDrive%\Program Files\Exchsrvr\Bin\).

  8. Type

     
      isinteg.exe s <ServerName> -test allfoldertests  

    and then press Enter. At this point you will see a list of the databases on the server, indicating which ones are online or offline, as shown in Figure 19.6.

    Figure 19.6. Performing maintenance using isinteg .

    graphics/19fig06.gif

  9. Choose to run maintenance on the offline database by typing the appropriate number. Press Enter, then choose Y, and finally Enter again to confirm.

    If isinteg finds errors, run the appropriate fix as recommended and displayed within the command prompt. The same error and recommended fix is recorded in the Application Event log. If necessary, repeat the isinteg integrity check until no errors are reported. When no errors are reported continue to the next step.

    Preparing to Use eseutil

    The eseutil utility requires the administrator to enter the full path and name of the EDB database file. It assumes that the streaming database file (STM) is located in the same directory as its corresponding database and it has the same prefix for the database filename. For example, the database mailbox store 2 has the following 2 files:

     
     D:\Program Files\Exchsrvr\MDBDATA\mailboxstore2.edb D:\Program Files\Exchsrvr\MDBDATA\mailboxstore2.stm 

    If the filenames or paths are different for the two database files, refer to the online help for eseutil to add the switch to specify the path to the STM file.


  10. At the command prompt, type the following command to perform a database-level integrity check:

     
      Eseutil.exe /g "D:\Program Files\Exchsrvr\MDBDATA\mailboxstore2.edb"  

    and press Enter. The double quotes are necessary for paths with spaces in the names . If errors are reported, refer to Chapter 32, "Recovering from a Disaster."

  11. At the command prompt, type the following command to defragment the database:

     
      Eseutil.exe /d "D:\Program Files\Exchsrvr\MDBDATA\mailboxstore2.edb"  

    and press Enter. Again, the double quotes are necessary for paths with spaces in the names.

    TIP

    Although it is always a good practice to perform offline database maintenance, including defragmentation, on a quarterly basis, it is necessary only when the amount of free space in the database is greater than 15% of the total database size.

    To calculate the percentage of free space, take the total free space recorded in the Application Log (Event ID 1221) and divide that by the total database size (the size of the EDB file plus the size of the STM file).

  12. When the database compaction completes, mount the database using the ESM.

  13. Using Windows Backup or a third-party product, perform a backup of the database.

Database Maintenance Through Mailbox Moves

When you consider what it means to do database maintenance, it is easy to think about the online and offline maintenance routines mentioned previously. Online and offline database maintenance each have their purposes with offline maintenance routines capable of performing the most thorough maintenance. Offline maintenance though requires some downtime and the exact downtime duration depends not only on the size of the database but also on the condition that it is in. For example, offline maintenance of a 40GB database can possibly take well over a day or more to perform defragmentation or corrections on the database.

Another less intrusive method to periodically performing database maintenance that also does not require nearly as much downtime is moving mailboxes to another mailbox store. An Exchange administrator can create a new mailbox store either on the same Exchange Server 2003 server or on a separate server altogether. Once the new mailbox store is created, the administrator can move mailboxes over to the new mailbox store. By moving the mailboxes over to the new mailbox store, the database is in optimal condition.

NOTE

As with any maintenance processes or procedures, it is important to perform backups of Exchange prior to performing the maintenance tasks. Also, moving mailboxes for maintenance reasons should be performed during non-business hours to avoid interrupting users.


In some cases where the 40GB database is experiencing many corruptions, not all mailboxes will be able to be moved without generating errors. For instance, there may be roughly 5-10 percent of the mailboxes still on the original mailbox store that generated errors and did not move over to the new mailbox store. If this occurs, the administrator can perform offline maintenance routines mentioned in the section entitled "Performing Offline Database Maintenance." The benefit is that instead of performing a long and arduous offline maintenance routines on a 40GB database, the routines will be run on a much smaller database and consequently will not require a significant amount of downtime. Instead of taking possibly over a day to perform offline maintenance, the routines only require a few hours.

 < Day Day Up > 


Microsoft Exchange Server 2003 Unleashed
Microsoft Exchange Server 2003 Unleashed (2nd Edition)
ISBN: 0672328070
EAN: 2147483647
Year: 2003
Pages: 393
Authors: Rand Morimoto

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net