Monday, December 22, 2014

Defrag Exchange Server 2010 with eseutil

Step by step guide to defrag Exchange 2010 server

1. Check first how much white space there is in your Exchange databases by running the following in Exchange Management Shell.
Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto
2. Check you have a backup of the Exchange Server (just in case!)

3. Disable any reboots of the Exchange Server or Domain Controllers if they are going to clash with the work.

4. You will need 110% of the largest database size as free space, either on the same server or elsewhere on the network.

5. Stop the Microsoft Exchange Information Store service.

6. Open command prompt and run
eseutil /d "d:\Program Files\Microsoft\Exchange Server\V14\Mailbox\DB01\DB01.edb" /t  "e:\DB01temp.edb"(The first path points to the Exchange database - edb file - that you wish to run the eseutil /d against, the other path is the the temp location used for the defragmentation process)

This can take a few hours. The command window will keep you updated of the progress, which is in two stages - the defragmentation and then the moving of the new edb file from the temp to the original location.

Run for all databases

7. When the process is finished, you can now restart the Microsoft Exchange Information Store service.

8. In the Exchange Management Console, check all databases have mounted. Check you can send and receive internal and external email.

9. In my case, I then shutdown the VM and removed the temp VHD from Hyper-V Manager. (I also deleted this VHD to reclaim space on the Cluster Storage Volume)..

10. Power on the server. Final test of inbound and outbound email.

11. Re-enable any server reboots you disabled earlier.

12. Run Get-MailboxDatabase -Status | ft name,databasesize,availablenewmailboxspace -auto in Exchange Management Shell and see your databases are now much smaller from when you started.

No comments:

Post a Comment