Stellar Logo
  • For Individuals
    Back to main menu

    For Individual

    • Windows Data Recovery

      Recovers lost or deleted Office documents, emails, presentations & multimedia files.

      • Free
      • Standard
      • Professional
      • Premium
    • Mac Data Recovery

      Recovers deleted files, photos, videos etc. on Mac.

      • Free
      • Standard
      • Professional
      • Premium
    • Photo Recovery

      Recover photos, videos, & audio files from all cameras and storage on Windows or Mac.

      • Standard
      • Professional
      • Premium
    • iPhone Data Recovery

      Recover deleted photos, videos, contacts, messages etc. directly from iPhone & iPad.

      • Recover
      • Erase
      • Toolkit
    • Video Repair

      Repair multiple corrupt videos in one go. Supports MP4, MOV & other formats.

      • Standard
      • Premium
    • Photo Repair

      Repair multiple corrupt photos in one go. Supports JPEG & other formats.

      • Standard
      • Professional
      • Premium
  • For Business
    Back to main menu

    For Business

    • Email Repair
      • Exchange Repair Repair corrupt EDB file & export mailboxes to Live Exchange or Office 365
      • Outlook PST Repair Repair corrupt PST & recover all mailbox items including deleted emails & contacts
      • OLM Repair Repair Outlook for Mac (OLM) 2011 & 2016 backup files & recover all mailbox items
      • Exchange Toolkit Repair EDB & Exchange backup file to restore mailboxes, convert OST to PST, & convert EDB to PST
      • Active Directory Repair Repair corrupt Active Directory database (Ntds.dit file) & extract all objects in original form
    • Email Converter
      • EDB to PST Convert online & offline EDB file & extract all mailbox items including Public Folders in PST
      • OST to PST Convert inaccessible OST file & extract all mailbox items including deleted emails in PST
      • NSF to PSTConvert IBM Notes NSF file & export all mailbox items including emails & attachments to PST
      • MBOX to PSTConvert MBOX file of Thunderbird, Entourage & other clients, & export mailbox data to PST
      • OLM to PST Convert Outlook for Mac Data File (OLM) & export all mailbox data to PST in original form
      • GroupWise to PST Convert GroupWise mail & export all mailbox items - emails, attachments, etc. - to PST
      • EML to PSTConvert Windows Live Mail (EML) file & export mailbox data - emails, attachments, etc. - to PST
      • Office 365 to PSTConnect to Office 365 account & export mailbox data to PST and various other formats
      • Migrator for Office 365Quickly migrate Outlook data files(OST/PST) directly to Office 365 or Live Exchange
    • File Repair
      • SQL Repair Repair corrupt .mdf & .ndf files and recover all database components in original form
      • Access RepairRepair corrupt .ACCDB and .MDB files & recover all records & objects in a new database
      • QuickBooks RepairRepair corrupt QuickBooks® data file & recover all file components in original form
      • MySQL RepairRepair MyISAM & InnoDB tables and recover all objects - keys, views, tables, triggers, etc.
      • Excel RepairRepair corrupt Excel (.XLS & .XLSX) files and recover tables, charts, chart sheet, etc.
      • BKF RepairRepair corrupt backup (BKF, ZIP, VHDX and .FD) files and restore complete data
      • Database ConverterInterconvert MS SQL, MySQL, SQLite, and SQL Anywhere database files
      • PowerPoint RepairRepair corrupt PPT files and restore tables, header, footer, & charts, etc. like new
      • File Repair ToolkitRepair corrupt Excel, PowerPoint, Word & PDF files & restore data to original form
    • Data Recovery & Erasure
      • Data RecoveryRecover lost or deleted data from HDD, SSD, external USB drive, RAID & more.
      • Tape Data RecoveryRetrives data from all types and capacities of tape drives including LTO 1, LTO 2, LTO 3, & others.
      • Virtual Machine RecoveryRecover documents, multimedia files, and database files from any virtual machine
      • File ErasurePermanently wipe files and folders, and erase traces of apps and Internet activity.
      • Mobile ErasureCertified and permanent data erasure software for iPhones, iPads, & Android devices
      • Drive ErasureCertified and permanent data erasure software for HDD, SSD, & other storage media
    • Toolkit
      • Exchange Toolkit5-in-1 software toolkit to recover Exchange database, convert EDB to PST, convert OST to PST, restore Exchange backup, and reset Windows Server password.
      • Outlook ToolkitComprehensive software suite to repair PST files, merge PST files, eliminate duplicate emails, compact PST files, and recover lost or forgotten Outlook passwords.
      • File Repair ToolkitPowerful file repair utility to fix corrupt Word, PowerPoint, and Excel documents created in Microsoft Office. It also repairs corrupt PDF files and recovers all objects.
      • MS SQL Toolkit5-in-1 software toolkit to repair corrupt SQL database, restore database from corrupt backup, reset database password, analyze SQL logs, & interconvert databases.
      • Data Recovery ToolkitSoftware helps to recovers deleted data from Windows, Mac and Linux storage devices. Also supports recovery from RAIDs & Virtual Drives.
    • Forensic
      • Email ForensicAdvanced email forensic solution for cyber experts to audit, analyze, or investigate emails & gather evidences.
      • Log Analyzer for MySQLAnalyze forensic details of MySQL server database log files such as Redo, General Query, and Binary Log.
      • Exchange AuditorExchange Server monitoring solution to automate audits, scans and generate reports ìn real-time.
      • Log Analyzer for MS SQLTrack & analyze MS SQL Server database transactions log files.
  • Our Partners
  • Lab Services
  • Support
  • About

Trending Searches

Data Recovery

Photo Recovery

Video Repair

iPhone Data Recovery

File Erasure Software

Exchange Repair

OST to PST

PST Repair

Raid Recovery

MS SQL Repair

Exchange Server 5 minute read

Defrag Exchange Mailbox Database using Eseutil /d PowerShell

Ravi Singh
Written By
Ravi Singh
Shaun Hardneck
Approved By
Shaun Hardneck
stellar calander
Updated on
September 14th, 2022

Summary: Defragmenting Exchange database removes the fragments and arranges data or information in continuous order that helps ensure database health and improve read performance. It also shrinks the database by wiping the 'White Space,' which helps reduce the database size and save the drive storage. In this blog, we have shared the steps to defragment and optimize the Exchange mailbox database using the PowerShell cmdlets.

Free Download for Windows

Contents

  • Why Defrag Exchange Mailbox Database?
  • Things to Remember Before Defragging Exchange Mailbox Database using Eseutil /d
  • Steps to Defrag Exchange Mailbox Database using Eseutil /d cmdlet
  • To Conclude

In Microsoft Exchange Server, the database size increases as more mailboxes are created, and data is generated by the users as they send/receive emails.

When some mail items are deleted from the mailboxes or mailboxes are removed from the Exchange databases, the free storage left by deleted items is not reclaimed.

For instance, if the database size is 10GB and you remove a mailbox ~2GB, the database will remain 10GB. The 2GB space left by the deleted mailbox is called ‘White Space.’  

Thus, it’s important and a best practice to reclaim the White Space by defragmenting the Exchange database. It will reduce the database size and help prevent database corruption issues caused by low or no storage.

Why Defrag Exchange Mailbox Database?

Defragmentation is a process of cleaning all unused storage or reclaiming White Space from the database, removing data fragments, and arranging the information in the contiguous regions for quick access.

From the performance point of view, defragmentation (Eseutil /d) makes the database access faster as the Exchange Server would not have to process a large file in memory or open and search the file, which can incur a large number of input/output from the storage for nothing.

Another thing is the operation of the server. As you may know, Exchange Server is sensitive about the database’s health if there is no storage or a shortage.

Databases tend to fill the hard drive with unused space or log files. If the storage is not increased or logs are not purged, it can damage the database and lead to corruption. As a result, the Exchange database will dismount, breaking the client-server connectivity and preventing the users from sending or receiving emails

So, it would be wise to set a schedule to check the database state periodically, depending on the size and number of users. A corrupted database can cause loss of data, service, and business.

Things to Remember Before Defragging Exchange Mailbox Database using Eseutil /d

Before running Eseutil /d command to defragment the Exchange database, ensure the following:

  1. To defrag an Exchange Server database, the database must be dismounted. Unfortunately, this means that the users will be unable to access their mailboxes during this operation.
  2. Exchange database defragmentation should be executed only after office hours as it might take some time to finish (depending on the database size and the server/storage).  
  3. It is highly recommended to back up the database before defragmentation for those just-in-case scenarios.
  4. Ensure the drive where the database is stored has enough free storage space, which is equivalent to or larger than the database size (preferably 1.1x or 1.2x size of the database). If you are short on storage capacity, this could cause a problem.

To calculate the required space, you must check the database size in your Exchange Server that requires defragmentation. To do so, you can use the Get-MailboxDatabase PowerShell cmdlet, as given below.

Get-MailboxDatabase -Status | ft name, database size, availablenewmailboxspace –auto

The output will display the database Name, the DatabaseSize, and the AvailableNewMailboxSpace.

get mailbox database status

As you can see from the above example, the Mailbox Database 0954395982 has a size of 247.9 MB.

On the other hand, it also has 74.34 MB of White Space. Of course, this is a small database with a few mailboxes. But on larger databases, defrag (Eseutil /d) will make significant performance improvements on the disks and operation of the server.

You can use the following formulae to calculate the total free space required to defragment the Exchange mailbox database.

  • (DatabaseSize) – (AvailableNewMailboxSpace) = (Actual Database Size).
  • (Actual Database Size) X 1.1= (Space required for defragmentation).

250MB – 75MB = 175MB
175MB X 1.1 = 192.5MB —is the minimum free space required to defrag the Exchange mailbox database.

NOTE: We have rounded off 247.9MB as 250MB in the above calculations.

Steps to Defrag Exchange Mailbox Database using Eseutil /d cmdlet

To defragment and optimize an Exchange mailbox database, follow these steps:

Step 1: Launch the Exchange Management Shell (EMS).

Step 2: Go to the folder location where the database that needs defragmentation is located using the cd command. For instance,

cd "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 0954395982"
defragment database

Step 3: Run the following command to dismount the Exchange mailbox database.

Dismount-Database <database name>
dismount database

Step 4: Once the database is dismounted, use the below EseUtil command to start the defragmentation process.

Eseutil /d "Mailbox Database 0954395982.edb" /t "temp_0954395982.edb"
defragmenting exchange mailbox database in Exchange management shell

Step 5: After the defragmentation (which may take time depending on the performance of the server/storage and the size of the database), mount the database back by using the Mount-Database PowerShell cmdlet.

Mount-Database "Mailbox Database 0954395982"
mount database

Step 6: After mounting the database and testing the connectivity of the affected users, you can test how the database has been defragmented by rechecking the database size using the Get-MaiboxDatabase PowerShell cmdlet.

Get-MailboxDatabase -Status | ft name, databasesize, availablenewmailboxspace -auto

Here you can see that the database has shrunk from 247.9 MB to 56 MB in size with only 512KB of White Space.

check database status

To Conclude

All goes well with the defrag operation if you have not incurred any issues or encountered an error message during the operation. However, there are several factors that may corrupt the database before and during the defrag (Eseutil /d) process. For example, if you have not calculated the free or left enough space for the process to run, this could lead to low or full storage that will halt the server and corrupt the database.

In such situations, for any Exchange Administrator, a third-party Exchange recovery tool such as Stellar Repair for Exchange comes in handy to save the database when a disaster strikes. With Stellar Repair for Exchange, you can repair any corrupt or damaged Exchange Database of any version and recover data to PST or other formats. With this software, you can also directly export the mailboxes from the repaired Exchange database to a live database in your Exchange Server and an Office 365 tenant.

About The Author

Ravi Singh

Ravi Singh is a Senior Writer at Stellar®. He is an expert Tech Explainer, IoT enthusiast, and a passionate nerd with over 7 years of experience in technical writing. He writes about Microsoft Exchange, Microsoft 365, Email Migration, Linux, Windows, Mac, DIY Tech, and Smart Home. Ravi spends most of his weekends working with IoT (DIY Smart Home) devices and playing Overwatch. He is also a solo traveler who loves hiking and exploring new trails.

Best Selling Products

Stellar Repair for Exchange

Stellar Repair for Exchange

Software recommended by MVPs & Administr

Read More
Stellar Toolkit for Exchange

Stellar Toolkit for Exchange

5-in-1 suite of specialized tools, highl

Read More
Stellar Converter for EDB

Stellar Converter for EDB

Stellar Converter for EDB is a professio

Read More
Stellar Converter for OST

Stellar Converter for OST

Powerful software trusted by Microsoft M

Read More

Table of Contents    arrow

  1. Why Defrag Exchange Mailbox Database?
  2. Things to Remember Before Defragging Exchange Mailbox Database using Eseutil /d
  3. Steps to Defrag Exchange Mailbox Database using Eseutil /d cmdlet
  4. To Conclude

Categories

offer banner

Related Posts

related post
Exchange Server

Exchange DAG Cluster Service Terminated with Error 7024

Stellar Author Shelly Bhardwaj March 14, 2023 Read More
related post
Exchange Server

How to Use Remove-DatabaseAvailabilityGroupServer?

Stellar Author Eric Simson February 10, 2023 Read More
related post
Exchange Server

How to Fix the Exchange Server 2019 Upgrade Error 5506?

Stellar Author Eric Simson January 31, 2023 Read More

Free Trial for 60 Days

Technology You Can Trust A Brand Present Across The Globe

  • tuv1
  • tuv2
  • Nist
  • hipa

Stellar Official Website

Stellar Data Recovery Inc.
48 Bridge Street Metuchen,
New Jersey 08840,
United States

ALSO AVAILABLE AT

ALSO AVAILABLE AT

About

  • About us
  • Career
  • ISMS Policy
  • Privacy Policy
  • Terms of Use
  • License Policy
  • Refund Policy
  • End User License Agreement

RESOURCES

  • Blog
  • Articles
  • Product Videos
  • Knowledge Base
  • Case Studies
  • Whitepapers
  • Software Catalog

NEWS & EVENTS

  • News
  • Events

PARTNERS

  • Affiliates
  • Resellers
  • Distributors

Useful Links

  • Contact Us
  • Support
  • Special Offers
  • Student Discounts
  • Awards & Reviews
  • Downloads
  • Store
  • Sitemap

Stellar & Stellar Data Recovery are Registered Trademarks of Stellar Information Technology Pvt. Ltd. © Copyright 2023 Stellar Information Technology Pvt. Ltd. All Trademarks Acknowledged.

Follow Us Facebook Twitter Linkedin Youtube

  • Notron
  • dcma

This website uses cookies in order to provide you with the best possible experience and to monitor and improve the performance of the site in accordance with our cookie policy. You can reject cookies at any time in your browser settings.

cookies-cross
Got it