Offline Defrag of Exchange Information Store

You can use the Eseutil utility to defragment the information store and directory in Microsoft Exchange Server 5.5 and to defragment the information store in Microsoft Exchange 2000 Server, Microsoft Exchange Server 2003 and Microsoft Excchange Server 2007. The utility can run on one database at a time from the command line.

Exchange database online defragmentation occurs automatically as part of the database maintenance process. Online defragmentation detects and removes database objects that are no longer being used. The online defragmentation process provides more database space without changing the file size of the database. By default, Exchange is configured to run online defragmentation daily between 01:00 and 05:00. Only an Offline defrag reduces the physical size of the information store database.

Eseutil is located in the Winnt\System32 folder in Exchange Server 5.5 and in the Exchsrvr/Bin folder in Exchange 2000 and in Exchange 2003. For Exchange 2007, the default location is \Program Files\Microsoft\Exchange Server.

Option  Description 

/b      Database Make a backup copy under the specified name  

/t      Database Set the temporary database name (the default is Tempdfrg.edb)  

/s      File Set the streaming file name (the default is NONE) 

/f      File Set the temporary streaming file name (the default is Tempdfrg.stm)

/p      reserve the temporary database (in other words, do not instate)

P/o     Suppress logo 

/i      Do not defragment streaming file 


to create a Tempdfrg.edb on the root of drive D, run the following command:
D:\>eseutil /d /ispriv

to create a Sample.edb on the root of drive D when you are running the eseutil command from drive C, run the following command:
C:\>eseutil /d /ispriv /td:\Sample.edb

To defragment an Exchange 2007 database on a mailbox server:
At a command prompt, type the following command:
C:\program files\microsoft\exchange server\bin Eseutil /d c:\program files\exchange server\mailbox\\.edb

To defragment an Exchange 2000 or Exchange 2003 database:
In Exchange System Manager, right-click the information store that you want to defragment, and then click Dismount Store.
At a command prompt, type the following commands, and then press ENTER after each command:
cd Exchsrvr\Bin
eseutil /d
Include a database switch, and any options that you want to use.
For example, the following command runs the standard defragmentation utility on a mailbox store database:
C:\program files\exchsrvr\bin>eseutil /d c:\progra~1\exchsrvr\mdbdata\priv1.edb

To Defragment an Exchange Server 5.5 database:
Note To defragment a database, you must have free disk space that is at least 110 percent the size of the database that you want to process. To determine the free space that is required, follow these steps:
Verify that the information store service is not running.
At a command prompt, type the following command, and then press ENTER:
eseutil /ms"database.edb”
.
Calculate the free space by multiplying the number of free pages by 4 KB.
Subtract the figure that you obtained in step 3 from the physical size of the database.
The figure that you obtained in step 4 represents the data in the database. Multiply this figure by 1.10 (110 %). The sum total is the space that you require to defragment the database.
To determine the approximate time that is required to defragment the database, divide the figure that you obtained in step 3 by 9 GB (9, 000,000,000) per hour.

Note 9 GB per hour is the speed at which the Eseutil utility runs.

Sources:
http://support.microsoft.com/kb/328804
http://technet.microsoft.com/en-us/library/aa998863.aspx