Saturday, November 3, 2007

Exchange 2003 Offline Defrag

We run a SBS 2003 Standard box at the office for AD, Exchange, etc. Not exactly my preferred server OS, but inherited systems are like that.

Lately, some users have been recieving duplicate incoming emails. Everything in the AD configuration seemed correct, so after some Googling I decided to do an offline defragmentation of the private mailbox store using eseutil.

Eseutil works by copy all of the store data into a new DB file set, thus reducing (eliminating?) fragmentation. The store has to be dismounted first by right-clicking it in Exchange System Manager and selecting 'dismount'.

Then we can do the defrag from the cli. Eseutil is located in the \Program Files\Exchsrvr\bin directory (it was for me anyway).

eseutil /d "d:\Program Files\Exchsrvr\MDBDATA\priv1.edb" /p /t f:\exchange\priv1.edb /f f:\exchange\priv1.stm

/d = Perform a defrag, followed by the path and name of the exchange DB (edb). The associated streaming (stm) file is included by default.
/p = Don't overwrite the existing file at completion. By default eseutil uses a temp output file then overwrites the actual DB with it when it's done.
/t & /f = Location for the output edb and stm files.

I decided to use an alternate physical location for the output, to reduce the amount of time taken. The server is a ML350G3 with 3x 146GB in RAID5. Disk performance is pretty average, so a different output location made sense. We have a nice quick gigabit network, so I just mapped a drive (F:) to my desktop for the output files.

The defrag took about 1 hour to complete. Once done I moved the old DB files out from the MDBDATA directory, copied the new output files from my desktop to the server and re-mounted the store in System Manager.

There was a pleasant benefit of the DB files dropping in size:
  • priv1.edb: 12GB => 10GB
  • priv1.stm: 13GB => 7GB

The server doesn't have a lot of free disk space, so picking up 8GB for free is always a bonus.

I probably won't know for a couple of days yet whether the defrag has fixed the duplicate emails. TBA.

No comments: