Banner

How to Remove White Spaces in Exchange Database

Updated On - December 5, 2022 by Nasir Khan |

Reading Time: 6 minutes

If you are looking for an answer on how to remove white spaces in Exchange database, then this article is a big help for you. Let’s first understand in simple terms what is white space in Exchange Database.

In simple words, Whitespace is a free space area in Exchange databases that gets created when an item or object (like a mailbox) is deleted. This free space area is reused by the Exchange database for storing new items or objects.It is an abnormality in Exchange Server that hinders the creation of available space for new data in the database.

Let’s say you have a 100GB mailbox database size, that means it will show as 100GB in size on the disk. Then if you remove mailboxes from the database, or move mailboxes to another database, the database will not shrink in size, instead the new mailbox (white) space will be available.

Remove White Space in Exchange Database – Manual Steps

In the manual process for how to remove white space in Exchange Database, there are 4 steps involved:

Step 1: Check White Space in Exchange Database

  1. Run Exchange Management Shell as administrator.
  2. Use Get-MailboxDatabase cmdlet with AvailableNewMailboxSpace parameter to get the available new mailbox space.

The below command also sorts mailbox database size on available new mailbox space.

[PS] C:\>Get-MailboxDatabase -Status | Select Name, DatabaseSize, AvailableNewMailboxSpace | Sort-Object -Descending AvailableNewMailboxSpace

Name                    DatabaseSize                     AvailableNewMailboxSpace

———                 —————–                                                     ————————————-

DB01                      499.6 GB (536,468,258,816 bytes)              107.9 GB (115,884,228,608 bytes)

Use below commands to find white space in Exchange:

Use below command to find whitespaces on a mailbox database::

Get-MailboxDatabase< DB Name > -status | Select-Object Server,Name,AvailableNewMailboxSpace

Use below command to find whitespaces on all mailbox database on a server:

Get-MailboxDatabase –Status –Server <servername> | Select-Object Server,Name,AvailableNewMailboxSpace

Use below command to findwhitespaces on all mailbox database on all server:

Get-MailboxDatabase -status | Select-Object Server,Name,AvailableNewMailboxSpace

Step 2: Create a new mailbox database

  1. Sign in to Exchange Admin Center (EAC).
  2. Click servers in the feature pane.
  3. Click databases in the tabs.
  4. Click + to create a new mailbox database.
  5. Enter the Mailbox database name.
  6. Click Browse to select the server on which to create the mailbox database.
  7. Select the Exchange Server where to store the database. Click OK.
  8. Change the Database File Path and Log Folder Path. Click Save.

A warning message will appear indicating restart the Microsoft Exchange Information Store service. Click OK.

1

The mailbox database gets created and mounted in the Exchange Server.

2

Start Windows Services and select Microsoft Exchange Information Store. Click Restart the service.

3

Verify configured database and log folder.

The mailbox database is created successfully.

Step 3: Move all mailboxes from one database to another database in Exchange Server

  1. Get all mailboxes from source database and move them to target database.

Here, in our example source database is DB01 and target database is DB02.

Note: The below cmdlet applies to Exchange Server 2010/2013/2016/2019.

[PS] C:\>Get-Mailbox -Database “DB01” -ResultSize Unlimited | New-MoveRequest -TargetDatabase “DB02”

DisplayName                     StatusDetailTotalMailboxSizeTotalArchiveSizePercentComplete

———–                              ————            —————-         —————- —————

Administrator                    WaitingForJobPickup 694.2 KB (710,903 bytes)                  0

Christopher Payne            WaitingForJobPickup 805.7 KB (825,070 bytes)                  0

Mary Walsh                        WaitingForJobPickup 53.4 KB (54,682 bytes)                    0

BenetizAnees                      WaitingForJobPickup 411.4 KB (421,233 bytes)                  0

Larson Tevin                       WaitingForJobPickup 40.93 KB (41,913 bytes)                   0

Jake Cornish                       WaitingForJobPickup 40.93 KB (41,913 bytes)                   0

Step 4: Delete old mailbox database

  1. Sign in to Exchange Admin Center (EAC).
  2. Click servers in the feature pane.
  3. Click databases in the tabs.
  4. Dismount Database: Select the database that you want to dismount in the list view.

Click (More icon) and then click Dismount.

4

A warning message appears to confirm if you are sure to dismount the selected mailbox database.

Click Yes.

5

  1. Delete the mailbox database: After dismounting the database, select the database in the list view. Click (delete icon) to delete the database.6

A warning message appears to confirm if you are sure to delete the selected mailbox database from the Exchange Server. Click Yes.

7

Again, a warning message appears suggesting you must remove the database and log files manually. Copy the location and then click OK.

8

  1. Delete mailbox database data and log files manually: Delete the data and log files from the specified location in the File Explorer.

Step 5: Defragmentation

The white space can also be removed from Exchange database by using Defragmentation. Defragmentation is further of two types – Online Defragmentation and Offline Defragmentation.

Online Defragmentation

Fully automatic process that does not need to be run. Exchange runs it automatically every night. This process does not reduce the size of the database, deletes expired messages and also cleans up deleted mailboxes in the mailbox store.

Offline Defragmentation

Choose this process if you want to shrink the Exchange database and compact the database by removing unused storage space. This process creates a new database without empty pages (replace the old ones with new ones or delete the old ones). This can be done with Eseutil. This improves the performance of the Exchange database, but can only be done if you have a lot of free space.

The issue with offline defragmentation is that it can affect the structure of the Exchange database and can cause some deletion too.

Defragmentation of Exchange Database

  1. Use below command in Exchange Management Shell to check how much whitespace is available in Exchange databasebefore starting the defragmentation process.

      Get-MailboxDatabase< Database name > -Status | Format-List Name, DatabaseSize, AvailableNewMailboxSpace

  1. Dismount your Exchange database.

Dismount-Database < database name >

  1. Defragment the database.

Eseutil /d <database_name>

  1. Mount the database again.

Mount-Database < database name >

  1. Check the whitespace available in database.

Get-MailboxDatabase< Database name > -Status | Format-List Name, DatabaseSize, AvailableNewMailboxSpace

Professional Solution: Regain Exchange Server Recovery Software

Use professional third-party Exchange Server Recovery software to recover data from Exchange Server databases. The utility effectively repairs corrupt Exchange EDB files and restores all mailbox items at desired location. It saves recovered Exchange database EDB file to PST, EML, EMLX, MSG, MBOX, VCF, PDF, HTML, MHTML file formats. Also, it Imports recovered EDB mailbox to Gmail, Yahoo Mail, Hotmail, GoDaddy, and Amazon Workmail.

Free Download100% Secure Buy NowPrice: $99

Salient Features of Exchange Server Recovery Software

  • Recovers large and multiple Exchange database EDB files without any data loss.
  • Recovers offline/dismounted EDB files.
  • Recovers permanently deleted emails from EDB files.
  • Two modes for performing Exchange EDB file recovery – Quick Scan and Advance Scan.
  • No Exchange EDB file size limit for recovery.
  • Repairs Public and Private folders and STM files.
  • Recovers all attachments along with emails from corrupt EDB files.
  • Maintains original files and folders hierarchy while performing EDB file recovery.
  • Recovers all intentionally or accidentally deleted mailboxes.
  • Exports recovered mailboxes to Microsoft Office 365 and Live Exchange Server.
  • Recovers lost or deleted Exchange Server mailboxes.
  • Search feature to find Exchange database EDB file in the system.
  • No need for Live Exchange Server environment for EDB file recovery.
  • Displays preview of Exchange mailboxes before saving.
  • Repairs Unicode EDB files.

Just 5 Steps to Backup Exchange Server Mailboxes

  1. Download, install and launch Regain Exchange Server Recovery software.
  2. Select Exchange database EDB file for scanning.
  3. The tool will display preview of recovered Exchange Server mailboxes.
  4. Select desired location and target file format.
  5. Click Next to save recovered Exchange Server database.

Conclusion

This article discusses manual methods to remove white spaces in Exchange database. Also, we discussed the complete Offline defragmentation process of the Exchange database using Eseutil commands. Also, in this article we recommend using Regain Exchange Server Recovery software to instantly recover Exchange Server database files. Fully compatible with all versions of MS Outlook and Exchange Server, the software is available as a free to download demo version. The trial version comes with all functionalities but will save only first 30 items per folder. To save unlimited items per folder, purchase the full licensed version of Exchange Server Recovery software.

https://secure.gravatar.com/avatar/634e2b272d33cc8cd0af4cf5f65e6336?s=96&r=g

Author: Nasir Khan

I am Nasir Khan from India, working as a Content Developer in Regain Software. Here I am writing about our products and their updates. And writing some free solutions from converting emails or Cloud Migration process. We have tools like Email Converter, Emails backup and Cloud migration.

Leave a Reply

Your email address will not be published. Required fields are marked *

  −  1  =  5