Blog Stats
  • Posts - 75
  • Articles - 1
  • Comments - 75
  • Trackbacks - 0


Cleaning up whitespace in exchange

During the lifespan of an Exchange server a database can become very, very large in the size it takes on the disk, much larger than the space used by the mailboxes that reside in the database. This is because whilst mailbox sizes will expand and shrink according to their data usage, the Exchange database only expands. Any space freed up by deletes in mailboxes or even the removal of a mailbox all together become whitespace in the database file. In the worst case you could have 40 GB of mailboxes yet a database that is consuming over 100 GB!

Unfortunately in Exchange 2003 the only way to shrink that database is by performing an offline defrag, bringing your mail users offline for the time it takes to perform the operation. An alternative is to create a second mailbox database and move all the mailboxes to this database allowing you, once completed, to delete the original database file.
Whilst this is a viable option for enterprise editions the Exchange 2003 standard edition is limited to 1 mailbox database. Not very handy…

A work around for this is to use a dial tone recovery database to allow your users to keep receiving and sending email while you perform an offline defrag. Downside of this is that any user who is in online mode will not have access to their older emails.
A dialtone database is, in essence, a temporary database you can use when the original edb file is corrupted and you do not want to have your users go offline during your attempts to save the original edb file. Using this method does bring in a bit of administrative overhead as you need to perform a recovery storage group merge later on, the need to go ahead with this operation relies solely on the situation…

In Exchange 2007 and 2010 a powershell commandlet has been introduced allowing one to clean up this whitespace whilst the database is still online. It runs against one or all databases at a time and might take some time to complete.

To run it against one database:

Clean-mailboxdatabase –identity “Database name” 

To run it against all databases:

Get-mailboxdatabase | clean-mailboxdatabase

Technorati Tags: ,,,,,,,,,,,,


# re: Cleaning up whitespace in exchange

Gravatar Good Article

<a href""> 9/28/2012 6:33 AM | justin

# re: Cleaning up whitespace in exchange

Gravatar There is no mention of whitespace in the documentation of the Clean-MailBoxDataBase cmd-let.

Exchange 2010 Other Versions Exchange 2007 5 out of 9 rated this helpful - Rate this topic
Applies to: Exchange Server 2010 SP2

Topic Last Modified: 2012-11-15

Use the Clean-MailboxDatabase cmdlet to scan Active Directory for disconnected mailboxes that aren't yet marked as disconnected in the Microsoft Exchange store and update the status of those mailboxes in the Exchange store. This cmdlet isn't able to update the Exchange store unless the Microsoft Exchange Information Store service is running and the database is mounted.

Please explain how this cleans up white space?


R 2/11/2013 4:11 PM | Roy

# re: Cleaning up whitespace in exchange

Gravatar Hi Roy,

Each database has whitespace in it due to deletion actions. Normally online maintenance should clean that up as much as possible but it does not always happen (different factors for that).

Clean-mailboxdatabase does actually clean up whitespace
(From the TechNet article):

This example cleans the mailbox database MBD01.
Clean-MailboxDatabase MBD01

If you were specifically referring to the the section you quoted, marking mailbox databases as disconnected will set a flag on the those objects in the database table. If they then go beyond the hold period the tables will be deleted causing free space in the edb file. 2/21/2013 11:02 AM | Marc

# re: Cleaning up whitespace in exchange

Gravatar Where are you getting the idea that this cleans up whitespace? It is NOT mentioned anywhere in the TechNet article or anywhere else, for that matter. 7/11/2014 9:08 PM | Nick K

# re: Cleaning up whitespace in exchange

Gravatar At the time of publishing this did actually clean up whitespace in the mailbox database (had to be run twice sometimes...) I haven't really been in situations since then where I would need to clean up any whitespace but will run it in my lab to see if that functionality was removed.

7/11/2014 9:50 PM | Marc

Post A Comment



Copyright © marc dekeyser