Eseutil Defrag

Home »: Eseutil Defrag

Exchange Recovery Software

Database defragmentation is process of reducing the size of database and eliminating extra space by arranging non-contagious data into contagious form. To keep the size of Microsoft Exchange Server compact, online defragmentation of Exchange database is carried automatically during normal maintenance of MS Exchange database. However, as an administrator you understand that simply relying on online maintenance to manage disk space is not that great an idea. Therefore, Microsoft provides you with an additional defragmentation tool eseutil, which is a command line utility, using which you can defragment the Exchange database.

Download Software     Purchase Software

To defragment the database, you need to use eseutil/d command. When you use this command, the extra free space also gets deleted leading to a reduced size of the database. Although, using eseutil/d is not that difficult, but you need good technical knowledge before using it. Let us explore more about eseutil/d under following topics:

  • How eseutil /d command works?
  • How much time is required to defragment Exchange database?
  • How to confirm free space available in the database?
  • At what time eseutil /d should be executed.
  • When eseutil /d should not be used.
  • Using eseutil /d.
How eseutil /d command works?

When you execute the eseutil command line tool with /d switch to defragment the database, then the defrag copy all the information of the original database to create a temporary database. While doing so, the tool discards the empty pages and then rebuilding the indexes of the database pages. After this, the original file is replaced with temporary file and is then renamed as original file.

While using eseutil/d command, make sure that 110% of the hard disk space is free to store the temporary database. If this condition is not met than the process of database defragmentation will not be completed. Another factor that may lead to abortion of defragmentation process is presence of bad records. If eseutil/d encounters any bad record during the defragmentation process, then it stops defragmenting the database immediately and displays an error message saying bad records are found in the database. Then you need to repair the database before defragmenting it again. You will need an Exchange Server Recovery tool for that.

How much time is required to defragment the database?

The time needed for defragmentation of Exchange database depends on two factors:

1. the availability of free space in the database.

2. presence of the temporary database on same drive.

It is a common misconception among people that eseutil will take more time in defragmentation if the size of Exchange database is more. Eseutil does not consider the total size of the Exchange database but only considers the empty space in it. For example, eseutil/d will take same time in defragmenting a 50GB hard disk with 20 GB of free space and a 30 GB hard disk with 20 GB of free space.

Another factor that decides the speed of defragmentation is presence of temporary database on same (or different) drive and availability of free space on that drive. If the free available disk space is 110% of original disk space and temporary database is available on the same drive as original database, then the eseutil/d will take less time in defragmentation of the database. But in case the temporary database is stored in any other drive, time needed for defragmentation is more. Therefore, it is always advised to keep the temporary database on the same drive as original database.

How to confirm free space available in the database?

As we have already discussed that the time needed for defragmentation of database depends on free space available in the database, therefore you must check the amount of free space available in the database before beginning the defragmentation process. Use the eseutil/d defrag tool only when sufficient free space is available on the database. During online defragmentation that is automatically done by Exchange Server, free space available in Exchange database is recorded in an event log file. You can calculate the free space available by viewing that event log. The event log contains following information regarding free space:

  • "Event Type: Information
  • Event Source: MSExchangeIS Mailbox Store
  • Event Category: General
  • Event ID: 1221
  • Date: 8/16/2006
  • Time: 9:15:00 AM
  • User: N/A
  • Computer: Computer Name
  • Description: The database "storage_group\mailbox_database" has xxx megabytes of free space after online defragmentation has terminated."

In the above log, computer name is the name of computer having Exchange Server and xxx is the amount of free space available in the database. Once you are confirmed that sufficient free space is available in the database, you can move ahead for eseutil defrag.

At what time eseutil /d should be used

Eseutil /d command must be executed when following situations are true:

  • Sufficient free space is available in the Exchange Server database so that you can free up that space during the process of defragmentation
  • When you encounter ESE-1018 error. This error occurs when indexes of the database face some problem.
  • After repairing the database using eseutil/p command, you must defragment the exchange database
  • When database is in consistent state.
When eseutil /d should not be used

Eseutil /d command must not be executed when following situations are true :

  • Since Exchange Server automatically performs online defragmentation on a regular basis, there is no need to use eseutil/d for normal maintenance of the database.
  • When sufficient free space is not available in the database
  • Database is in inconsistent state
  • When ESE-1018 error is affection some portion of Exchange database
Using eseutil /d

Now that you have gathered all the information about eseutil/d command, let us see how to use eseutil/d for defragmentation of the database. When you are sure that 110% of free disk space is available on the disk, execute the following steps to defragment Exchange database on mailbox server:

  1. Right click on the database that you want to defragment in order to dismount the exchange database
  2. Now type the location of Exchange Server at command prompt as given below:

    <Drive>:\program files\microsoft\exchange server\bin
  3. The preceding location replace the term Drive with the letter where Exchange Server is available. Now to defragment the database on mailbox server, type the following command:

    <Drive>:\program files\microsoft\exchange server\bin eseutil /d <db_name>

Follow the steps given below to defragment the Exchange database on Hub Transport or Edge Transport Server::

  1. Dismount the Queue database.
  2. Use Service snap-in to stop the Microsoft Exchange transport service .
  3. Now, type the given location of Exchange Server at command prompt:

    <Drive>: :\program files\microsoft\exchange server\bin
  4. In the preceding location replace the term Drive with the letter where Exchange Server is available. Now, to defragment the database on Edge Transport Server, type the following command to defragment the database on Edge Transport server:

    <Drive> :\program files\microsoft\exchange server\bin eseutil /d
    <Drive> :\program files\exchange server\TransportRoles\data\queue\mail.que

In the last step mentioned above replace the term 'Drive' with the Drive letter where both Exchange database and Exchange Server is available. By following the steps mentioned above you can defragment the Exchange database on mailbox server and Edge Transport server. As already discussed above, the process of defragmentation may get aborted if any sort of inconsistency or bad records are found in the Exchange database. Then, you will need to first repair the database using Exchange Sever Recovery software before the defragmentation process

Download Software     Purchase Software

Read More Topics
Cash Back Guarantee
Software Awards