The Exchange Tool ESEutil
SyntaxFunctionESEUTIL /dIt performs offline compaction of a database.ESEUTIL /rIt recovers a database.ESEUTIL /gIt verifies the integrity of a database.ESEUTIL /pIt repairs a corrupted database.ESEUTIL /cIt restores information.ESEUTIL /yIt copies a database streaming file or log file.
There are three sides to this utility that any Microsoft Exchange administrator should know how to use. The harmless checking options, the hairier defragmentation option, and finally the scariest restore options.
On a side note it should be mentioned to any new Microsoft Exchange administrators that ESEUTIL is not a part of the PATH system variable, and as such must be run from the Exchange/bin folder. If you find yourself using ESEUTIL frequently I would suggest adding it to your path as I have.
Eseutil some feel comfortable with this tool others don't; Eseutil should not be taken lightly, some modes of Eseutil that can reak havock if not used in the correct situation or with the correct procedure.
Eseutil is used in the majority of situations when you experience issues with your Exchange Information Store not starting or misbehaving but there are some senarios were this migh not be the case.
Let's look at the what this tool does, Eseutil.exe can be used to analyze/verify and then modify/repair your exchange Information Store database files, these files in a default setup are named priv1.edb priv1.stm pub1.edb pub1.stm. It should be noted now with the release of Exchange 2007 (only with the Exchange 2007 version of the tool) eseutil can be used to perform these tasks against the ESE database files on the Exchange 2007 Edge Transport and Hub Transport servers along with the mailbox and public folder stores.
Using the Exchange tool ESEUTIL to Ensure the Health of your Information Store
Before you start using ESEUTIL ensure the following:
- Make a backup of your Exchange databases even if you think the files are damaged and lost
- Use ESEUTIL with some understanding about what these tools really do
- Ensure that you have done all other tests before you use ESEUTIL
- Dismount the store (then it is accessible for offline defrag, tests and more)
ESEUTIL is located in the \EXCHSRVR\BIN directory. This directory is not in the system path so you must open the tool in the BIN directory or enhance the system path with the \EXCHSRVR\BIN directory.
Defrag
ESEUTIL /D <database name> [optoins]
Exchange 2003 defragments the Exchange database every night. But this is only an online defrag of the database. An online defrag doesn't reduce the size of the information store. To reduce the size of the databases, you must use an offline defrag.
Under normal conditions you don't need an offline defrag, but when you add tons of new users due to a merger or aquisition or when you delete many objects from the store it can be necessary to do an offline defrag.
You can do a space dump with ESEUTIL /MS to determine the space. Also ensure that you have 110% free diskspace associated with the Exchange database size.
Depending on the size of the information store and your hardware, the defrag process can consume a lot of time.
Check the integrity of the Exchange database
You can check the integrity of your Exchange database with ESEUTIL /G.
To start the integrity check for the PRIV1.EDB database, type the following command:
ESEUTIL /G „C:\Program files\exchsrvr\mdbdata\priv1.edb"
Disaster recovery
With a good backup in hand and Exchange databases and logfiles on different hard drives, it is no problem to recover from an Exchange disaster.
Just restore the data from backup and initiate a roll forward of the transaction logs. Well done, the Exchange information store goes online.
But what should you do when your backup isn't readable or you don't have a backup? Here's how these tools come to play.
Before you start:
- Make sure that the databases are really not startable
- Check the Application log for Exchange events that can tell you the cause of the failure
- Make a backup of the database
- Restart the server so that a soft recovery can be done
ESEUTIL /P parameters
ESEUTIL /p repairs a corrupted or damaged database. Ensure that you have a minimum of 20% free disc capacity in association to the Exchange database size.
Example:
ESEUTIL /P „c:\program files\exchsrvr\mdbdata\priv1.edb" /Se:\exchsrvr\mdbdata\priv1.stm /Te:\tempdb.edb
This command will repair the database PRIV1.EDB. If you have no .STM file, you can create one with ESEUTIL /CREATESTM.
After running ESEUTIL, you can open a detailled logfile called >database<.integ.raw to see the results.