<body>

Thursday, October 04, 2007

MS Exchange : ESEUTIL > Fixing a corrupt / inconsistent Exchange Database ;)

I do a lot of testing on exchange servers. Exchange gets tricky at times and cause unnecessary headaches. One of them being Storage group(s) that fail to mount due to a database corruption / inconsistency.

The error below is a typical database corruption error:


Using ESEUTIL will fix most corruptions but there may be situations where a database is so badly corrupted that it may not be repairable :(

ESEUTIL is supported on the following Exchange servers :
- Microsoft Exchange Server 2003 Enterprise Edition
- Microsoft Exchange Server 2003 Standard Edition
- Microsoft Exchange 2000 Server Standard Edition
- Microsoft Windows Small Business Server 2003 Premium Edition
- Microsoft Windows Small Business Server 2003 Standard Edition


Following the steps from this article should fix it. I will go through the steps covered in the article and include the output in this post - helping first time ESEUTIL users to know what to expect:

1. Repair the information store:

At a command prompt, change to the drive:\Program Files\Exchsrvr\Bin folder, where drive is the letter of the drive on which Exchange is installed. Use one of the following commands:

1.1. Restoring a mailbox store: type eseutil /p "drive:\Program Files\Exchsrvr\MDBDATA\priv1.edb", and then press ENTER.

If the restore is successful the following output is expected:


Initiating REPAIR mode...
Database: C:\Program Files\Exchsrvr\MDBDATA\priv1.edb
Streaming File: C:\Program Files\Exchsrvr\MDBDATA\priv1.STM
Temp. Database: TEMPREPAIR2924.EDB

Checking database integrity.
The database is not up-to-date. This operation may find that this database is corrupt because data from the log files has yet to be placed in the database.

To ensure the database is up-to-date please use the 'Recovery' operation.

Scanning Status (% complete)

0 10 20 30 40 50 60 70 80 90 100
+---+---+---+---+---+---+---+--+
...............................
Integrity check successful.

Note:
It is recommended that you immediately perform a full backup of this database. If you restore a backup made before the repair, the database will be rolled back to the state it was in at the time of that backup.

Operation completed successfully in 27.125 seconds.


1.2.Restoring a public folder store, type eseutil /p "drive:\Program Files\Exchsrvr\MDBDATA\pub1.edb", and then press ENTER.

If the restore is successful the output will be the same as the expected output from 1.1


2. Verify the consistency of the store that was restored:

2.1.At the command prompt, type eseutil /mh "drive:\Program Files\Exchsrvr\MDBDATA\priv1.edb" (or pub1.edb), and then press ENTER to verify the consistency information that is returned.

If the consistency check is successful the following output is expected:


C:\Program Files\Exchsrvr\bin>eseutil /mh "C:\Program Files\Exchsrvr\MDBDATA\priv1.edb"
Microsoft(R) Exchange Server Database Utilities Version 6.5 Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating FILE DUMP mode...
Database: C:\Program Files\Exchsrvr\MDBDATA\priv1.edb

File Type: Database
Format ulMagic: 0x89abcdef
Engine ulMagic: 0x89abcdef
Format ulVersion: 0x620,11
Engine ulVersion: 0x620,11
Created ulVersion: 0x620,9
DB Signature: Create time:02/20/2007 15:25:23 Rand:2953079 Computer:
cbDbPage: 4096
dbtime: 157891 (0x268c3)
State: Clean Shutdown
Log Required: 0-0 (0x0-0x0)
Streaming File: Yes
Shadowed: Yes
Last Objid: 204
Scrub Dbtime: 0 (0x0)
Scrub Date: 00/00/1900 00:00:00
Repair Count: 0
Repair Date: 00/00/1900 00:00:00
old Repair Count: 0
Last Consistent: (0x5A,1A,CD) 06/20/2007 16:33:10
Last Attach: (0x5A,1B,13E) 06/20/2007 16:33:09
Last Detach: (0x0,0,0) 06/20/2007 16:33:10
Dbid: 1
Log Signature: Create time:02/20/2007 15:25:22 Rand:2913863 Computer:
OS Version: (5.2.3790 SP 2)

Previous Full Backup:
Log Gen: 0-0 (0x0-0x0)
Mark: (0x0,0,0)
Mark: 00/00/1900 00:00:00
Previous Incremental Backup:
Log Gen: 0-0 (0x0-0x0)
Mark: (0x0,0,0)
Mark: 00/00/1900 00:00:00
Current Full Backup:
Log Gen: 0-0 (0x0-0x0)
Mark: (0x0,0,0)
Mark: 00/00/1900 00:00:00
Current Shadow copy backup:
Log Gen: 0-0 (0x0-0x0)
Mark: (0x0,0,0)
Mark: 00/00/1900 00:00:00
cpgUpgrade55Format: 0
cpgUpgradeFreePages: 0
cpgUpgradeSpaceMapPages: 0

ECC Fix Success Count: none
Old ECC Fix Success Count: none
ECC Fix Error Count: none
Old ECC Fix Error Count: none
Bad Checksum Error Count: none
Old bad Checksum Error Count: none

Operation completed successfully in 2.109 seconds.


2.2.At the command prompt, type eseutil /d "drive:\Program Files\Exchsrvr\MDBDATA\priv1.edb" (or pub1.edb), and then press ENTER to defrag and to compact the database.

If the database is successfully compact and defrafmented the following output is expected:


C:\Program Files\Exchsrvr\bin>eseutil /d "C:\Program Files\Exchsrvr\MDBDATA\priv1.edb"
Microsoft(R) Exchange Server Database Utilities Version 6.5 Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating DEFRAGMENTATION mode...
Database: C:\Program Files\Exchsrvr\MDBDATA\priv1.edb
Streaming File: C:\Program Files\Exchsrvr\MDBDATA\priv1.STM
Temp. Database: TEMPDFRG4412.EDB
Temp. Streaming File: TEMPDFRG4412.STM

Defragmentation Status (% complete)

0 10 20 30 40 50 60 70 80 90 100

+---+---+---+---+---+---+---+--+
...............................

Moving 'TEMPDFRG4412.EDB' to 'C:\Program Files\Exchsrvr\MDBDATA\priv1.edb'...DONE!
Moving 'TEMPDFRG4412.STM' to 'C:\Program Files\Exchsrvr\MDBDATA\priv1.stm'...DONE!

Note:

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 6.94 seconds.

3.At the command prompt, type ISINTEG -S Server_Name -FIX -TEST ALLTESTS, and then press ENTER. Repeat this several times until it reports zero fixes and zero errors.
4.Mount the store.
5.Back up the store.

Labels:

0 Comments:

Post a Comment

<< Home