How to Check and Reclaim Whitespace in Exchange Server?

Exchange Server database tends to get large with continuous adding of emails and other mailbox data. To optimize storage and performance of Exchange Server, you can reduce the size of database by deleting mailboxes or other data. But after deletion of data, when you check the database size, you may find that the size is still the same. The reason for this is that when you delete data from the database, Exchange Server makes available that space for storing new data. This free space is called White Space.

Let’s take an example. You have a database of 1.5 TB in size and you have removed mailboxes or other data of around 200 GB. This means that the database size should come down to 1.3 TB. However, you find out that the size is still the same, i.e., 1.5 TB. The 200 GB space, from where the data was deleted, is marked as White Space. So, when you add new data to this database, the size of the database will remain the same as new data will be stored in White Space.

How to Check White Space in Database?

To check White Space in your database, open the Exchange Management Shell (EMS) and run the Get-MailboxDatabase command as given below. This command will give all the information needed about the database, such as Name of the database, DatabaseSize, and AvailableNewMailboxSpace.

Get-MailboxDatabase -Status | Select Name, DatabaseSize, AvailableNewMailboxSpace

Get-MailboxDatabase command to check status

As you can see in the above image, the database named DefaultDB is of 247 MB in size and the AvailableNewMailboxSpace is 78 MB. Here, the AvailableNewMailboxSpace is the White Space. This means that you can reclaim the 78 MB of space from the database.

How to Reclaim White Space in the Exchange Server Database?

To reclaim the White Space, you need to defragment the database. Defragmentation is a process that reduces the size of database by eliminating the unused space. Let’s see how to perform this process.

NOTE: The below process will require you to dismount the database. So, you must perform the process in a maintenance window. Also, check that there are no antivirus scans or backup jobs are in progress during this time. It’s strongly suggested that before proceeding, you should take a full backup of the server in question.

 

After taking the backup, dismount the database. For this, use the Dismount-Database PowerShell command in the Exchange Management Shell (EMS) as given below.

Dismount-Database

use the Dismount-Database PowerShell command to dismount the database

Once the database is dismounted, ensure that you have enough temporary storage available, equivalent to the database size.

Now, you need to run the EseUtil /d PowerShell command as given below to perform the defragmentation process.

Eseutil /d /t

run the EseUtil d PowerShell command

The process may take some time, depending on the size of database and performance of the server and storage.

Once the process is complete, you can mount the database. For this, run the below command.

Mount-Database

Run Mount-Database Command to Mount the database

To confirm that the database size is reduced, again run the Get-MailboxDatabase command.

Get-MailboxDatabase -Status | Select Name, DatabaseSize, AvailableNewMailboxSpace

run the Get-MailboxDatabase to check database size

As you can see in the above image, the available space in the database is now 1 MB.

To Conclude

You can use the PowerShell commands, as mentioned above, to check and reclaim the White Space in Exchange Server database. Although you can reclaim the White Space by defragmenting the database, it is best to optimize the storage or move the transaction logs to another drive to increase the performance and avoid the risk of drives getting full. It is also suggested to split the data into multiple mailbox databases.

In case of database corruption due to lack of storage space or any other issue, you can use a Exchange database recovery application, like Stellar Repair for Exchange, to recover the data from corrupt database as quickly as possible. With this application, you can open multiple EDB files of any Exchange Server version, with no size limit. After a quick or deep scan, you can save the EDB file data to PST and other file formats. You can also export the EDB data, including user mailboxes, user archives, shared mailboxes, disabled mailboxes, and public folders, directly to another live Exchange Server database or Office 365.



Was this article helpful?
About The Author
author image
Shelly Bhardwaj linkdin Icon

Shelly is technology expert and core knowledge of Exchange Server, Outlook.

Table of Contents

WHY STELLAR® IS GLOBAL LEADER

Why Choose Stellar?
  • 0M+

    Customers

  • 0+

    Years of Excellence

  • 0+

    R&D Engineers

  • 0+

    Countries

  • 0+

    PARTNERS

  • 0+

    Awards Received