Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Guidelines To Repair Exchange 2010 Database Using Eseutil

 Overview:

With Exchange Server 2010, a tool named ESEutil (Extensible Storage Engine utility)
is available for DBAs that is operated through command-prompt. In this segment,
we will talk about ESEutil in detail and its switches. Also, a discussion on how to
defragment or repair Exchange 2010 database using ESEutil will be done.

 Exchange Server 2010 Database Structure:

Exchange 2010 database is made up of three important constituents: The Database


(.edb) file, the Transaction LOG (.log) file, and the Checkpoint (.chk) file.

The JET Blue (ESE) database engine of Exchange Server works on data saved in
“Pages”. Particularly, for Exchange 2010 edition, each page is of 32 KB and multiple
pages of this kind store data in EDB file (which is a Binary-Tree). When a transaction
occurs, for example deletion of a folder, sending an email, adding a contact, it is first
written into the memory, then to the log files and finally to the database. This
technique is known as Write-Head Logging.

When a log file is filled with maximum number of transactions, a new log file gets
automatically created with a name that continues the previous series. For example:
the first log file was E00.log (where E00 is the prefix) and once it is filled, new series
get generated with changes in prefix like E01.log, E02.log and so on. Log file
numbering is done in hexadecimal format.
How a Transaction is Written to the Database?

1) An operation is first processed into the memory and then dissevered into
pages.
2) When these pages are updated, they form a transaction that gets written to
the LOG files.
3) Updated pages in Server memory are now written to the database.
4) Checkpoint is now updated according to the changes done in transaction log.

 Scenarios Where ESEutil can Help!

An EDB is an open file and the uncommitted transactions still exist in the LOG file.
When DB is mounted on Server, the uncommitted transactions will be written to the
database. When this happens perfectly, it means the database is detached from the
LOG files. Now if this database is dismounted, the checkpoint file will be updated
and DB will be in Consistent state (also known as Clean Shutdown State).

Now, in any situation when Exchange Server is not shutdown properly (example
Server crash or unexpected power-off), the database is left inconsistent (Dirty Shut
Down State). This is because the database was still attached to the LOG files for
updation but the process could not get completed due to Server being shutdown
unexpectedly. In such cases, when the Server starts again, it performs Soft Recovery
of database where log files are replayed using the Checkpoint file. In 90 percent of
the cases, this problem is resolved automatically, and for rest 10 percent, there is
ESEutil for help.
Also, there is possibility that some pages of the EDB file get corrupt in the disk or the
device controller. Such cases result in error -1018 JET_errReadVerifyFailure.
ESEutil helps to deal with file-system (page) level corruption of Exchange database.

 An Introduction to ESEutil and its Switches:

ESEutil is a command-line utility available under Bin Directory that helps to perform
number of operations on database like repair, offline defragmentation, integrity
check, checksum test etc. This utility works on dismounted database and is available
automatically when Exchange Server is installed.

 Repair Exchange 2010 Database Using Eseutil:

Exchange database is a B-Tree structure that consists of pages. Now these pages can
itself hold data in it or can point to other pages in the database. When ESEutil /p
switch is run against the database for repair process, it looks after the table and
records of the EDB file and if any corrupt pages are encountered, it deletes them. If a
leaf node of the B-tree is corrupt, data loss will happen and if the internal node of
the tree is corrupt, then structure of the database will be dis-balanced.

Meanwhile, the repair process with ESEutil is divided into three sections:

 Backup database and repair it using /P switch


 Defragment and rebuild database using /d switch
 Run ISInteg to correct index of the database

This is the state of database before we start repairing it:

Now, to repair Exchange 2010 database, use the syntax:

Once this command is run, the repair database will be in this state:
Now, you could notice the free space in database after running ESEutil /p command.
To rebuild the DB by removing white space from it, perform offline defragmentation
using following syntax:

Now, the state of DB would be like:

Defragmentation will disturb the index of B-tree and thus to do correction in


database at application level, the solution is to run ISInteg utility. The syntax to be
followed is:
After all this processing, the database will be ready to mount on Server:

 Things to Remember:

 Before Starting Repair: The logical drive should be available with 20


percent free space than the size of database.
 Before Starting Defragmentation: The disk should be available with 110
percent free space and the database should be dismounted from Server.

The command-line solution to repair Exchange 2010 database using ESEutil can be
availed in Graphical User Interface through Exchange Recovery software. This tool
will recover EDB file data to PST, MSG, and EML file. Also, mailboxes from EDB file
can be exported to different Exchange Server.

Copyright © 2013 – 2014 | All Rights Reserved


www.exchangerecover.com

You might also like