Cleaning up your Exchange Mail Store!
I was recently tasked with cleaning up an exchange mail store that was nearing the 75 GB limit for the Exchange 2003 server it was being used on. (In actually, the mail store was 45GB and the public folder store was 26GB putting the total for the store near 71GB.) The event log indicated that Exchange 03 didn’t like the fact that the mail store was reaching it’s limit and was complaining via a periodic mounting and dismounting of the mail store.
After quick review of the companies employee rouster, it occured to me that over half the employees with mailboxes were no longer with the company, and no longer recieving mail. OK, so what needed to be done was to backup (remove) the mailboxes not in use, and then defragment the mailstore to clean up all the “white space” in the database. (Note: just deleting the mailboxes will not create more space in the exchange mail store database due to the way “single instance storage” works in exchange, so you have to perform a defragment manually.)
Here’s how it went down:
- First, I did a Brick Level mail back up of the mailboxes I intended to remove using EXMERGE. I dumped these to the file server and later transferred them to removable media.
- Second, after business hours, I dismounted the mailstore and backed it up to the file server. This way i could do a complete restore if needed.
- Third, I went into Exchange System Manager>Domain>Administrative Groups>First Administrative Group>Servers>MAIL>First Storage Group>Mailbox Store>Mailboxes and deleted (emptied) the mailboxes I had previously backed up in step one.
- Forth, the next day the mailboxes showed up as empty in Exchange System Manager (Noted by the little red X next to the name of the maibox). I then proceeded to remove them with a right click and “delete”.
- Fifth, after business hours I AGAIN dismounted the mail store and backed it up to the file server. (You can NEVER be to careful with back ups and it is essential that you back up the mail store BEFORE defragmenting, as there is always the possibility of causing data corruption when defragmenting.)
- Sixth, I used ESEUTIL to perform the defragment. Then I remounted the mailstore, restarted all the exchange services, and tested mailflow to bring the project to completion.
The rest of this article will be on the correct procedure to use ESEUTIL for defragmentation of an exchange 2000/2003 :
Before Getting Started:
1. Make sure you have free disk space equal to 110 percent of the end size of the database that you want to process (the end size being the current file size minus the size of the white space in the file).
2. Dismount the database before defragmenting as Eseutil performs an offline defragmentation. During the offline defragmentation the dismounted database will be inaccessible to clients.
To Begin:
1. In Exchange System Manager, right-click the database that you want to defragment, and then click Dismount Store.
2. At the command prompt, change to the Exchsrvr\Bin folder, and then type the Eseutil /d command, a database switch, and any options that you want to use. For example, the following command (all on one command line) runs the standard defragmentation utility on a mailbox database:
C:\program files\exchsrvr\bin> Eseutil /d “c:\progra~1\exchsrvr\mdbdata\priv1.edb”
Use the following database switch to run Eseutil defragmentation on a specific database:
Eseutil /d <database_name> [options]
More Information can be found HERE and HERE!