I understand the difference between "logical" and "physical" free space and have a problem with whitespace not increasing (logical space, formerly event 1221 in Exchange 2003).

Given that

  • I have an Exchange 2010 server that had many mailboxes moved to a different databases.
  • Attachments are being deleted from messages

I observe that

  • When I run the script below no logical space is freed
  • When I run online maintenance, a full backup, or the powershell command clean mailbox database, nothing seems to free logical space.

For clarification, I'm not talking about disk space. I'm talking about whitespace within the database.

How can I free up logical space to a point where physical disk space is no longer being consumed (excluding log files)?

Because the wrong answer is being upvoted, and my question gets zero votes, I assume that people think I'm talking about physical space... but I'm clearly not

$Databases = Get-MailboxDatabase -Status
    foreach($Database in $Databases) {
        $DBSize = $Database.DatabaseSize

        $MBCount = @(Get-MailboxStatistics -Database $Database.Name).Count
        $AllMBStats = Get-MailboxStatistics -Database $Database.Name   

        $MBItemAssocCount = $AllMBStats   |   %{$_.AssociatedItemCount.value} |  Measure-Object -Average   -Sum
        $MBDeletedCount =   $AllMBStats   |   %{$_.DeletedItemCount.value} |  Measure-Object -Average   -Sum
        $MBItemCount =      $AllMBStats   |   %{$_.ItemCount} |  Measure-Object   -Sum

        $MBDeletedItemSize= $AllMBStats   |   %{$_.TotalDeletedItemSize.value } |  Measure-Object -Average  -Sum
        $MBItemSize   =     $AllMBStats   |   %{$_.TotalItemSize.value.ToMb()} |  Measure-Object -Average    -Sum      

        New-Object PSObject -Property @{
            Server = $Database.Server.Name
            DatabaseName = $Database.Name

            UserCount = $MBCount

            "DatabaseSize (GB)" = $DBSize.ToGB()
            "DatabaseSize Deleted (bytes)" = $MBDeletedItemSize.Sum
            "WhiteSpace (MB)" = $Database.AvailableNewMailboxSpace.ToMB()
            "LogicalSize (MB)" =   $MBItemSize.Sum
            "Available Mailbox Space" =  $Database.AvailableNewMailboxSpace
            ItemCount = $MBItemCount.Sum
            "AverageMailboxSize (MB)" =  $MBItemSize.Average

Exchange 2010 doesn't free up whitespace automatically. You either have to live with it, or create a new database and move all of the left-over accounts and delete the database.

EDIT: I forgot that if you don't mind dismounting your database and you have a bunch of free disk space available (equal to amount of whitespace) then you can do an offline defrag using eseutil /d. See http://exchangeserverpro.com/defrag-exchange-2010-mailbox-database

  • I'm talking about Logical space. In other words whitespace isn't increasing. I'll rephrase my question. – goodguys_activate Feb 11 '13 at 21:38

Three possibilities I can think of:

  1. You need this hotfix: http://support.microsoft.com/kb/2621266 (doubtful, but maybe)

  2. Your retention period for deleted items or deleted mailboxes is getting in the way. You can try setting those to both to 1 day and then waiting until the next full backup to check again.

  3. You aren't purging the disconnected mailboxes after they've been moved (goes with #2 actually)...see here: http://www.howexchangeworks.com/2010/09/purge-disconnected-or-soft-deleted.html

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.