XADM: Determining Database Free Space with Exchange 5.5 Service Pack 1

ID: Q195914


The information in this article applies to:


SUMMARY

Microsoft Exchange Server 5.5 Service Pack 1 offers two new informational features for determining free space in an Exchange Server database (EDB) file. Knowing this can help you decide whether it is worthwhile to perform offline defragmentation.


MORE INFORMATION

To discover how much free space is available in your database files, look for an Event 1221 in the Windows NT Application Event log. There will be separate events logged for the Public, Private, and Directory databases. The event descriptions will be similar to the following:


   The database has 151 megabytes of free space after online
   defragmentation has terminated. 

The Event 1221 is written soon after Online Defragmentation (OLD) completes a pass. When OLD completes, an Event 180 is logged for each database, Private, Public, and Directory.

NOTE: An Event 179 signals the beginning of each OLD pass.

OLD runs during Information Store Maintenance. If the Information Store Maintenance period expires before OLD completes, an OLD will log an Event 183 and suspend itself until the next Information Store Maintenance window comes around.

You may view or adjust the Information Store Maintenance period in the Exchange Server Administrator program by getting the properties of each Exchange Server computer in (<Site>\Configuration\Servers\<Servername>) and clicking the Information Store Maintenance tab.

The number reported by Event 1221 is a very conservative "worst case" estimate; if you perform offline defragmentation, you should get back at least the amount of space reported as free.

To get a "best case" estimate, you may stop the Exchange Server services and generate a detailed report on free space by typing the following at an MS-DOS command prompt:
ESEUTIL.EXE /MS [PRIV.EDB|PUB.EDB|DIR.EDB] > FREESPACE.TXT
Even on a large database, this procedure should require only a few minutes of downtime.

NOTE: This switch is available only in Exchange 5.5 Service Pack 1 or later.

The following is an abridged sample of typical output that would be saved to Freespace.txt:

   Microsoft(R) Windows NT(TM) Server Database Utilities

   Version 5.5

   Copyright (C) Microsoft Corporation 1991-1998.  All Rights Reserved.

   Initiating FILE DUMP mode...
         Database: priv.edb
   
   *************************** SPACE DUMP ****************************
   Name                       Type     PgnoFDP       Owned   Available
   ===================================================================
   priv.edb                   Db             1       87040       31091
   
   1-144                      Tbl          180         109          78
       ?T668f+B67aa+T39+Q674  Idx          184          10           6
       ?T668f+B67aa-Te06+Q67  Idx          185          14          10
       MsgFolderIndex7        Idx          181           1           0
       MsgFolderIndexPtagDel  Idx          183           1           0
       RuleMsgFolderIndex     Idx          182           1           0
   1-145                      Tbl          151          45          38
       MsgFolderIndex7        Idx          152           1           0
       MsgFolderIndexPtagDel  Idx          154           1           0
       RuleMsgFolderIndex     Idx          153           1           0
   1-24                       Tbl          127         444         241
       <Long Values>          LV           208         198         193
   ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
   
   TimedEvents                Tbl          103           2           0
       TimedEvents2           Idx          104           1           0
   -------------------------------------------------------------------
                                                                 86167
   Operation completed successfully in 8.2 seconds. 

The sum at the bottom (86167) is total the number of pages free in the database.

Estimate the maximum bytes you might recover by multiplying this number by 4096.

BACKGROUND INFORMATION

Exchange Server database files (Dir.edb, Priv.edb and Pub.edb) grow as needed to accommodate new data. As old data is deleted, the "holes" in the file are re-used for new data before growing the file size again, but the files never shrink in size until an offline defragmentation is performed.

In normal operation, the size of the EDB files will stabilize after a few weeks or months. Significant changes in usage or configuration (for example, adding or deleting large numbers of mailboxes or adding an Internet gateway) may change the equilibrium size of the files. In such cases, offline defragmentation may be helpful to not only reduce file size, but improve performance and increase data allocation efficiency, especially with versions of Exchange prior to 5.5 Service Pack 1.

Exchange Server 5.5 Service Pack 1 added significant new capabilities to Online Defragmentation which make OLD nearly as capable as offline defragmentation, with the exception that OLD still does not reduce the overall size of the EDB file.

Offline defragmentation is NOT a periodically-required Exchange Server maintenance practice, and should be done only when the Events in the Application Log tell you that there would be benefit from it, or when you have performed operations that obviously warrant it (most commonly, moving a large group of mailboxes off your server).

As a very broad rule of thumb, you will probably not get long term file size shrinkage unless the amount of free space in your database is ten times the average daily traffic on your server. (Determine daily traffic by adding up the sizes of all the EDBnnnnn.log transaction log files generated on a typical day with circular logging turned off.)

Offline defragmentation is done with the Eseutil.exe utility's /D switch, and requires stopping Exchange Server services. Plan for a minimum of 30 minutes of downtime per GB of data to be defragmented.

Offline defragmentation works by creating a new database consisting only of pages actually used from the original one, and then copying that database over the original one. To perform offline defragmentation, you therefore need at least as much free disk space as the expected size of the new database. The normal recommendation is to have at least as much space free as the size of the original database. If you run out of space or offline defragmenation fails for some other reason, there is no harm done to your original database, but you should find and manually delete the partial new database (usually Tempdfrg.edb) to free up disk space.

Offline defragmentation can be performed in place or out of place on another server if you are short on disk space. To defragment on another server, copy Ese.dll, Eseutil.exe and the EDB file to be defragmented to a drive with sufficient space. Copy the defragmented EDB file back in place after defragmentation completes.

It is important to perform a full online backup after defragmentation.


Keywords          : 
Version           : WinNT:5.5
Platform          : winnt 
Issue type        : kbhowto kbinfo 

Last Reviewed: April 13, 1999