Sunday, July 29, 2007

Defragmentation of Exchange Server Hard Disk

I realized today this is one of the common question Exchange administrators ask and try to understand if it is a good idea or bad idea to perform file level defragmentation on Exchange servers. I don't remember where I got a hold of some nice notes about this topic; anyway I wanted to post here to share with Exchange community .Disk defragmentation involves rearranging data on a server's hard disks to make the files more contiguous for more efficient reads. Defragmenting your hard disks helps increase disk performance and helps ensure that your servers that run Exchange run smoothly and efficiently. Because severe disk fragmentation can cause performance problems, run a disk defragmentation program (such as Disk Defragmenter) on a regular basis or when server performance levels fall below normal. Because more disk reads are necessary when backing up a heavily fragmented file system, make sure that your disks are recently defragmented.

Exchange databases also require defragmentation. However, fragmentation of Exchange data occurs within the Exchange database itself. Specifically, Exchange database defragmentation refers to rearranging mailbox store and public folder store data to fill database pages more efficiently, thereby eliminating unused storage space.

There are two types of Exchange database defragmentation: online and offline.

Online Defragmentation

Online defragmentation is one of several database-related processes that occur during Exchange database maintenance. By default, on servers running Exchange 2000 Server and Exchange Server 2003, Exchange Server database maintenance occurs daily between 01:00 (1:00 A.M.) and 05:00 (5:00 A.M.). Online defragmentation occurs while Exchange Server databases remain online. Therefore, your e-mail users have complete access to mailbox data during the online defragmentation process.

The online defragmentation process involves automatically detecting and deleting objects that are no longer being used. This process provides more database space without actually changing the file size of the databases that are being defragmented.

Note: To increase the efficiency of defragmentation and backup processes, schedule your maintenance processes and backup operations to run at different times.

You can schedule database defragmentation in two ways

To schedule database defragmentation for an individual database, use the Maintenance interval option on the Database tab of a mailbox store or public folder store object.
To schedule database defragmentation for a collection of mailbox stores and public folder stores, use the Maintenance interval option on the Database (Policy) tab of a mailbox store or a public folder store policy. For information about how to create a mailbox store policy or public folder policy, see "Create a Mailbox Store Policy" and "Create a Public Folder Store Policy" in Exchange 2000 Server or Exchange Server 2003 Help.

Offline Defragmentation
Offline defragmentation involves using the Exchange Server Database Utilities (Eseutil.exe). ESEUTIL is an Exchange Server utility that you can use to defragment, repair, and check the integrity of Exchange Server databases. It is available through the following sources:

If you are running Exchange 2000 Server, ESEUTIL is located in the E:\Support\Utils folder of your Exchange 2000 CD (where E:\ is the drive letter of your CD-ROM drive).
If you are running Exchange Server 2003, ESEUTIL is located in the F:\Program Files\exchsrvr\bin directory after running Exchange Server 2003 Setup (where F:\ is the drive letter of the drive to which you installed Exchange Server).
You can only perform offline defragmentation when your Exchange Server databases are offline. Therefore, your e-mail users will not have access to mailbox data during the offline defragmentation processes.

During the offline defragmentation process, Eseutil.exe creates a new database, copies the old database records to the new one, and then discards unused pages, resulting in a new compact database file. To reduce the physical file size of the databases, you must perform an offline defragmentation in the following situations:

After performing a database repair (using Eseutil /p)
After moving a considerable amount of data from an Exchange Server database.
When an Exchange Server database is much larger than it should be.


You should consider an offline defragmentation only if many users are moved from an Exchange Server database or after a database repair. Performing offline defragmentation when it is not needed could result in decreased performance.
When using Eseutil.exe to defragment your Exchange Server databases, consider the following:

To rebuild the new defragmented database on an alternate location, run Eseutil.exe in defragmentation mode (using the command Eseutil /d) and include the /p switch. Including the additional /p switch during a defragmentation operation enables you to preserve your original defragmented database (in case you need to revert to this database). Using this switch also significantly reduces the amount of time it takes to defragment a database.

Because offline defragmentation alters the database pages completely, you should create new backups of Exchange Server 2003 databases immediately after offline defragmentation. If you use the Backup utility to perform your Exchange Server database backups, create new Normal backups of your Exchange Server databases. If you do not create new Normal backups, previous Incremental or Differential backups do not function because they reference database pages that were re-ordered by the defragmentation process.
For more information about defragmenting Exchange 2000 Server and Exchange Server  2003 databases, see the following articles in the Microsoft Knowledge Base:

  • Article 192185: How to Defragment with Eseutil Utility (Eseutil.exe)
  • Article 324672: Offline Defragmentation with Eseutil, webcast
  • Article 328804: How to Defragment Exchange Server Databases



Oz Ozugurlu


Dewey said...

Can you not use a defragmenter like Diskeeper? I was under the impression that Diskeeper was designed for defragging servers without having to take them offline?

Anonymous said...

Fragmentation is very high on our servers and it poses a serious issue to the admin. Handling the fragmentation with minimum downtime is a challenge.

Anonymous said...

An automatic defragmenter like PerfectDisk can do the trick for overall defragmentation of the server. Offline defragmentation of the data stores can also be handled by PerfectDisk for Exchange. We have thousands of customers regularly recovering significant amounts of otherwise wasted space. An example here:

Joe Abusamra
Raxco Software

Oz Ozugurlu said...

I have taken below comments from Microsoft which is expressing my feelings as well about this issue. I am posting is as it is

I would never do it on running production server databases. The reason for it is simple actually - file system defrag is a very intense I/O operation. So the disc will be very busy. I have seen some cases here in Support Services, where our database engine has actually started logging warnings that the write to the disc was successful, but it took "unusually long" to complete, and it was suggesting that hardware might be at fault. Sure enough - a disk defrag kicked off just before this started happening as witnessed by the Application log. That right there is enough reason for me not to do it in real life.
The bottom line really is - you do not HAVE to file-level defrag the Exchange database drives. Exchange reads and writes to it's databases in very random fashion. Large sequential reads and writes will see much more improvement from file system defrag than Exchange databases will. But if you really WANT to do it - I would do it the old-fashioned way: move the databases off to some other volume, file system defrag the drive and then move the databases back... Or at least make sure you have a good backup, dismount the databases and file-system defrag then.

oz ozugurlu

Oz Ozugurlu said...

I forgot to say thanks for all of you taking your time and posting your inputs


Andy Grogan said...
This comment has been removed by the author.
Oz Ozugurlu said...


thanks for the Tips, and sharing your experince with us


Andy Grogan said...

HIya mate, yes got through it, posted it, then saw that you had already covered it! - darn! so removed it to avoid looking like a plonker!


kimberly said...

buy viagra
viagra online
generic viagra

Dianne said...


Anthony said...

During initial computer check-ups and repairs, I always check for the status of my hard drive. Canada's one-year warranty to my year old PC is still on but minor repairs like “defragging hard drives” are doable things I've recently learned from my son.. I'm a scrambly type of guy so it always comes to the point that I need to reorganize my files. Funny yet advantageous that kids are better than us in terms of these hi-tech toys they call computers. Anyway, I still need to learn those bulleted topics you've posted here, and I think I need my son's guidance – again.

hard disk recovery said...

Thanks for telling about defragmentation of exchange server hard disk.But sometimes when we try new things by mistake we do wrong action like accidentally deletion of files and lost our data. But no need to worry because now a days data recovery options are available.

arvin lexor said...

Thanks for sharing! This is a great alternative for my old class hard drive, cost-effective solution to my can try this also..Playboy Hard Drive

Armand Magsamen said...

Defragmentation really helps a lot. It helps your computer work faster by arranging the data it has in store. Do not forget to defrag your computer at least 2-3 times a week. It's for your own good.

Cincinnati Neighborhoods said...

hey guys nice posts.. regards, Always you shared some different topic. Which really useful for all. This post is totally different form your previous. Keep it up! Looking for more posts.

Generic viagrabuy said...

Thing which you define is very well we appreciate you thanks for sharing!!
Generic Viagra buy
Generic Viagra
Tadalish SX
Generic Viagra
Sildenafil citrate

Used PC Exporter said...

Nice Blog Post !

Varun Sharma said...

Server Data Recovery in Mumbai Thanks for sharing information about defragmentation of exchange server hard disk. It really helped a lot to me. Thank you once again.