MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Is Offline defrag worth it ???

Ive seen in the past that its a normal practice of Exchange admins to perform offline defrag aka eseutil /d on exchange databases.

But, is it really worth the time taken and downtime planned ??

To know this better, we need to discuss about event id: 1221 and its relevance.

Event Type: Information
Event Source: MSExchangeIS Mailbox Store
Event Category: General
Event ID: 1221
Date: 01/01/2005
Time: 00:04:16
User: N/A
Computer: SERVER
Description: The database “First Storage Group\Mailbox Store (SERVER)” has 3.4 megabytes of free space after online defragmentation has terminated.

What does this mean ?

Exchange has performed a routine maintenance and any old data that is past the delete thresholds has been deleted from the database.
The space it has left behind has then been converted into “white space”. No difference in the size of the database.
This “white space” will be used by Exchange, before expanding the database any larger.

When to think about reclaiming the white space?

This is my personal opinion:

If the DB is 100 gigs and 1221 says that it has more than 40-50 Gigs free space, it’s worth performing an offline defrag.

What if we don’t reclaim the space ?

This is the real catch –> Exchange will use that space before further increasing the PHYSICAL size of the DB.

Day 1,Event id: 1221 showed my DB has 10 MB of White space. Day 2 it showed the DB has 15 MB of white space. Day 3 its showed 2 MB of white space. What does this mean ?

This means that user might have deleted data worth 10 MB and when maintenance completed Exchange made 10 MB white spaces whilst performing the routine tasks. Day 2, the scenario is not that different because users might have deleted mails or the deleted items retention period is past and exchange could allocate 15 MB white space. Day3, mails might have came in drastically and the WHITE SPACES where used by incoming mails or there wasn’t much job for maintenance to perform, so the process could only give 2 MB.

Other than event id: 1221, is there a way I could find the logical size of DB?

Another option to know the logical size of the Db is to run a eseutil /ms whilst store is offline — Multiple the value by 4 and divide it by 1024 to get the value in MB.

Post a defrag on an exchange database, we might end up in a situation where we need to re-configure all/many Blackberry- iPhone- Windows mobile’s with the new database.

So long story short – Do you really wanna defrag your exchange database ??

Do it iff your’e running out of disc space or the Database has reached its size limit 75GB (E2K3 STD). If not, i’d just let it run….

Ratish

14 Responses to “Is Offline defrag worth it ???”

  1. Karunakar Says:

    Thank you ratish now i know when to do offline defrag as i am thinking to do soon 🙂 i will check the logs first and do it if i really need to perform.

  2. Richard Black Says:

    None of the System Admins I know do offline defrags. The main reason is you never know how long it is going to take. I order to get downtime to do maintenance you have to be able to tell management how long it is going to take. It is just easier to get new disk then create a new database and move users. You have much more control and less downtime for users.

  3. Ratish Sekhar Says:

    Richard,

    Thanks for your comment.
    Actually I’ve encountered scenarios where admins started Offline defrag even without knowing what it does. This post is to address the same. 🙂

    Again, offline defrag runs at approximately 9 GB per hour as per:
    How to defragment Exchange databases: http://support.microsoft.com/kb/328804
    Also as per:
    Ramifications of running the eseutil /p or edbutil /d /r command in Exchange: http://support.microsoft.com/kb/259851
    It may take 4 to 6 GB per hour

    These rates are average; performance may vary depending on how many passes the process has to make on your database and the speed of the hardware.

    In real life examples, it takes close to 8-9 GB per hour on a good piece of hardware.
    So, for a 50 Gigs of data (EDB+STM) defrag will finish approximately 6 hours or so.
    But, what you told is absolutely right. Even I would move users to a new store coz defrag will be the last thing ill do 🙂

  4. Paul Lindner Says:

    Hello Ratish its Paul from NY you have a great site.

  5. Muhammad Irfan Sadiq Says:

    Ratish,

    I have been exclusively wrking with Exchange Server since 2003, and have learned as per Microsoft Best Practices to perform an offline Database Defrag, since Online defrag (Daily Maintainence Interval) simply deleted the basic level files to clean up the Exchange database. In couple of Exchange Master Certification Trainings i was advised by Exchange Rangers group to perform an offline defrag at least once every quarter. If the Exchange Database is designed by MS best practices ( Exchange 2003 50GB / per MBDB & Exchange 2007 100GB / MBDB) it does not take awfull long time to perform Eseutil /p , Eseutil/d.

  6. Juan S Says:

    Any offline defrag raises a red flag during an Exchange health check from MS. They recommend moving all mailboxes out of a defraged/repaired databases.

  7. Alex Says:

    Just done with offline defrag on Exchange 2007. I have 4 DB’s and on of them 60GB took me about an hour to finish offline defrag and i bit less for integrity check.

    and do not forget to perform full backup once you done 🙂

  8. chris Says:

    i think the time frame is not exact it actually depends on the database like 4- 5 GB per hour it actually varies it takes even more or even less . if Defrag is really necessary and we need the production as well we can have a dial tone strategy …… (concept of RSG and merging of data).

    **note** when there is change in database some user using other than OL 2003 SP2 or later may need to create new profile

  9. TS Says:

    Ratish or anyone else,

    I am about to run an offline defrag of my 03 database on a seperate computer since my drive on the email server is full. I was told that the eseutil is a stand alone program and that I would have no problem stoping the store and copying the files to another server to run the defrag and then copying the files back. Do you see any issues with this? Thanks.

  10. Ratish Sekhar Says:

    Troy,

    Good day. I am assuming you need to perform an offline defrag to reclaim space on the drive.
    But did you make sure that the database has enough of white-space available ?? Check for event id 1221 and it should tell you.

    Now, runnning it on a different machine is never been easier.

    There is a great kb article on it
    How to run Eseutil on a computer without Exchange Server: http://support.microsoft.com/kb/244525/

    You just need to copy and paste these files to a location and run it from there. Eseutil.exe, Ese.dll, Jcb.dll, Exosal.dll, and Exchmem.dll
    Now, the real question, what after offline defrag ??? As soon as you copy and paste the defragged database to production, these might happen.

    1. Blackberry user might get garbled messages in inbox.
    2. Outlook users might complain of Outlook being slow and some duplicate entries.
    3. This issue would get resolved, if you reconfigure their profile.

  11. Shambhu Sharma Says:

    Best Practice is Learn about offline de-fragmentation but don’t do at first or second stage. This is the last option to claim the white space but make sure you should 110% space available and good backup. The good practice is move the mailboxes to new stores which will ask you very little time for downtime per mailboxes.

  12. Paul Lindner Says:

    Hi Ratish HRU doing.
    Any way could you give the exact syntex for offline defrag.
    Thanks

  13. Ratish Sekhar Says:

    Hi Paul,
    Please look for the section “How to run OFFLINE DEFRAG” in step 23 @ https://msexchangeguru.com/2009/07/12/exchange-database-recovery-using-eseutil-commands/

    Ratish

  14. How Exchange 2010 deals with whitespace « MSExchangeGuru.com Says:

    […] Refer this article for more information: https://msexchangeguru.com/2009/09/08/offline-defrag/ […]

Leave a Reply

Categories

Archives

MSExchangeGuru.com