Friday, June 11, 2010

Exchange 2007 Database Defragmentation

Last week due to an issue with the anti-spam client on my exchange server, I had to defrag the default "Mailbox Database". Below are the steps I performed to accomplish the task.

In my environment the Exchange databases are located on the D: drive.

  1. Dismount the database in question via the Exchange Management Console

  2. Via the command line, move to directory C:\Program Files\Exchange Server\Bin

  3. Test the information Store of the server. (my server is named MailLady)

    isinteg.exe -s MailLady -test allfoldertests


  4. Type the number of the database and hit Enter. Confirm with Y and then Enter again

  5. If all tests pass then run an integrity check on the database

    eseutil.exe /g " D:\Exchange Databases\Mailbox Database.edb" /t "D:\Exchange Databases\Temp\temper.edb"


  6. If that passes then run a defrag of the database

    eseutil.exe /d " D:\Exchange Databases\Mailbox Database.edb" /t "D:\Exchange Databases\Temp\temper.edb"


  7. After that finishes then mount the database via the Exchange Management Console

By default the eseutil command creates a temporary database inside the Bin directory on the system drive. Since my Exchange Server didn't have that much free room on the system drive I had to use the /t switch to move the temp database to a drive with more room.

No comments: