Do I need to compact my Exchange 2003 database?

Posted on 2010-11-08
Last Modified: 2012-06-27
I have an Exchange 2003 server which has been in service for about 5 years so far. The database size has been growing steadily, as expected. It is currently about 85GB in size. It never seems go get smaller, just bigger. Sometimes when people leave the company and their email is archived off the server, I expect that the database size would shrink at least a little within a few weeks, but it does not. Even when we had a big layoff a couple years ago.
Is their something I need to do? I understand that it may just be converting to white space when I archive and delete an account, but if that was the case then the size would at least remain steady for a while after deleting a user as the white space gets re-used instead of the database growing, but it still seems to grow regardless. Is it recommended that I do some sort of offline compaction of the database, or should I just leave it alone if there are not really any problems? I still have more space to grow into, but it won't last forever. I am hoping to get another 2 years out of it.
Question by:robw24
LVL 49

Accepted Solution

Akhater earned 500 total points
ID: 34084424
As you have stated the database will never shrink without an offline defrag.

however offline defrag is useless starting exchange 2003 SP2

>>"I understand that it may just be converting to white space when I archive and delete an account,"

perfectly true

>>"but if that was the case then the size would at least remain steady for a while after deleting a user as the white space gets re-used instead of the database growing"

in theory yes however the space used is not always contiguous it is random, the white space will be reused however not necessary directly

if you are running enterprise version of exchange just create another mailbox database and move all the users to it.

if you decide you still want to do an offline defrag this is how to do it
LVL 15

Expert Comment

ID: 34084431
You can do an offline defrag of the database.

Defragmenting an Exchange 2000 or Exchange 2003 database
Note Defragmenting a database requires free disk space equal to 110 percent of the size of the database being processed.
In Exchange System Manager, right-click the information store that you want to defragment, and then click Dismount Store.
At the command prompt, change to the Exchsrvr\Bin folder, and then type the eseutil /d command, 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
Use the following database switch to run Eseutil defragmentation on a specific database:
eseutil /d <database_name> [options]
Performs off-line compaction of a database.

Syntax: eseutil /d <database_name> [options]

Parameters: <database_name> is the file name of the database that you want to compact.

You are not required to use any of the following options, but you can use one or more (separated by a space) to specify the operations that you want to perform on the database.
Option         Description
/b<database>   Make a backup copy under the specified name

/t<database>   Set the temporary database name (the default is

/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             Preserve the temporary database (in other words,
               do not instate)

/o             Suppress logo

/i             Do not defragment streaming file

Note If instating is disabled (for example, if you use the /p option), the original database is preserved uncompacted, and the temporary database contains the defragmented version of the database.

For more information about Exchange Server versions 4.0 and 5.0, click the following article number to view the article in the Microsoft Knowledge Base:
163627  ( ) How to defrag an EDB file on a non-Exchange server
For more information about how to run Eseutil on a computer without Exchange Server, click the following article number to view the article in the Microsoft Knowledge Base:
244525  ( ) How to run Eseutil on a computer without Exchange Server
The Tempdfrg.edb file is created on the logical drive from which the eseutil /d command is run unless you use the /t switch. For example, to create a Tempdfrg.edb on the root of drive D, run the following command:
D:\>eseutil /d /ispriv
You can also use the /t switch to set the name for the temp database and for a different location. For example, 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

Expert Comment

ID: 34084504
Exchange will never automatically shrink the file.  You are correct about the white space being reused later, as to why is grows again sooner than you think...the thing is email boxes to all tend to keep growing.

I would say compaction is not necessary, except that since you'll need 110% of the .mdb file size as free space to do a compaction, you may want to do it now rather than later--like if it grows more you will no longer have enough free space to compact.

If in fact the space is simply used and that's why the IS keeps growing, then you won't get back anything significant from a compaction, but it should not hurt anything to try

Have you considered looking at individual mailbox size?  Maybe go to your top users and make them delete/archive some things?  Every email server I have supported tends to have a pattern something like the top 10% of users are consuming 80% of the space.  You can get bad loads of space with better policing of usage.  Users hate this, but I usually explain to the big boss that they'll either need to spend however many thousands of dollars on a new server or else support you in having users clean up.  Once a dollar figure is put on the cost of not cleaning, the size starts to go down a lot!
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.


Author Comment

ID: 34084634
Akhater: Good idea regarding creating another database/store and moving the users. Not sure if I will do this but I will keep it in mind. Also thanks for the link on offline defrag.

JBond2010: Thanks for the details on the offline defrag.

evanmcnally: So you think that there is nothing wrong, it's just the whitespace getting re-used quickly? That is what I was thinkng but wasn't sure. It just seemed to get used quickly. I do have limits in place and if they go over they will not be able to send mail (can still receive). So it's not like they are going crazy with their mailbox sizes.  

I do not have enough space (110%) to do a compaction. Would need to be an offline defrag, but I am thinking now that I am probably fine without doing that.
LVL 49

Expert Comment

ID: 34084668
You can use any disk for the temp database it can be a usb disk, the bad thing about offline defrag is that it takes time and all your users will be down during this time that's why it is much better to just create a new database and move users to it.

However defrag is not a requirement


Expert Comment

ID: 34084700
Yes, you will need to do an offline defrag of the mail stores one thing that i have found useful from a performance and maintenance stand point is to departmentalize your exchange stores like create a mail store for sales one for costumer service ect. this way you can take down one store at a time and run a defrage with out disturbing other people. this will also make the exchange environment perform a little quicker.

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question