Thursday, May 4, 2006

Exchange 2003 : Compressing Mailbox Store

Overview :

Over time, the mailbox store grows and also becomes fragmented with the constant addition and deletion of mailboxes and messages. After clearing out old user mailboxes and deleting large volumes of messages, the data store file needs some housekeeping i.e. compacting and reordering.

Notes :

Perform the following steps when no users are using the mail server (preferably out of hours).

Solution :

1 Ensure you have up to date backups of mail data.

2 Disable the NIC (network interface card) by right clicking it's icon in the task bar (labelled Local Area Connection') and selecting 'disable'.

3 Stop all the Exchange services. These are easily identified as they all start with 'Microsoft Exchange'. To control services, go to 'Control Panel' , 'Administrative Tools' and then 'Services'.

4 Start a DOS session by selecting Start > Run , then typing 'cmd' .

5 Change to drive c: by typing 'c:'

6 Change the working directory to the exchange application directory by typing 'cd program files\exchsrvr\bin' .

7 Assuming the location of the message store files has not changed, type the following to compact the mailstore.
eseutil /d /o 'c:\program files\exchsrvr\mdbdata\priv1.edb'

This task may take a while depending on the volume of work it has to do.
The following test is taken from a screenshot when the task completes.

C:\Program Files\Exchsrvr\BIN>eseutil /d /o 'c:\program files\exchsrvr\mdbdata\priv1.edb'
Initiating DEFRAGMENTATION mode...
Database: c:\program files\exchsrvr\mdbdata\priv1.edb
Streaming File: c:\program files\exchsrvr\mdbdata\priv1.STM
Temp. Database: TEMPDFRG5160.EDB
Temp. Streaming File: TEMPDFRG5160.STM
Defragmentation Status (% complete) 0 10 20 30 40 50 60 70 80 90 100
|----|----|----|----|----|----|----|----|----|----| ...................................................
Moving 'TEMPDFRG5160.EDB' to 'c:\program files\exchsrvr\mdbdata\priv1.edb'... DONE!
Moving 'TEMPDFRG5160.STM' to 'c:\program files\exchsrvr\mdbdata\priv1.stm'... DONE!

It is recommended that you immediately perform a full backup of this database.
If you restore a backup made before the defragmentation, the database will be rolled back to the state it was in at the time of that backup.
Operation completed successfully in 369.938 seconds.

C:\Program Files\Exchsrvr\BIN>

To complete the task, restart the server. This will re-establish all the exchange services on startup.
The server should be rebooted periodically anyway hence this is an ideal opportunity.

1 comment:

Alex said...

I came form the Institute and found out that my Exchange info had been lost. I kept my head and luckily solved out my trouble with the aid of an one utility. Which might be proper in this situation - exchange inbox repair tool.