Exchange 2013 corrupted mailbox database

People don’t give backups the importance it deserves. Today I’ve been woked up by a call asking for help with an Exchange Server.

Digging into Event logs I found the problem: Corrupted Mailbox Database.

1
At '03/08/2015 08:22:08', the copy of database 'Mailbox Database 0640250043' on this server encountered an error during the mount operation. For more information, consult the Event log on the server for "ExchangeStoreDb" or "MSExchangeRepl" events. The mount operation will be tried again automatically.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Active Manager failed to mount database Mailbox Database 0640250043 on server LITIO. Error: An Active Manager operation failed. Error: The database action failed. Error: Operation failed with message: MapiExceptionDatabaseError: Unable to mount database. (hr=0x80004005, ec=1108)
Diagnostic context:
Lid: 65256
Lid: 10722 StoreEc: 0x454
Lid: 1494 ---- Remote Context Beg ----
Lid: 45120 dwParam: 0xEF3D1
Lid: 57728 dwParam: 0xEF4DB
Lid: 46144 dwParam: 0xEF577
Lid: 34880 dwParam: 0xEF577
Lid: 34760 StoreEc: 0xFFFFFDE3
Lid: 41344 Guid: a0598b5b-82db-45a7-8309-4ba865de95e2
Lid: 35200 dwParam: 0x340C
Lid: 46144 dwParam: 0xEF79A
Lid: 34880 dwParam: 0xEF79A
Lid: 54472 StoreEc: 0x1388
Lid: 42184 StoreEc: 0x454
Lid: 1750 ---- Remote Context End ----
Lid: 1047 StoreEc: 0x454
1
2
3
Information Store - Mailbox Database 0640250043 (13252) Mailbox Database 0640250043: Unable to read the header of logfile C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 0640250043\E00.log. Error -541.
For more information, click http://www.microsoft.com/contentredirect.asp.

When I asked for backups I’ve got the worst answer possible: They were from 3 weeks ago. Unacceptable.

Let’s try a recovery of the current database.

1
[PS] E:\MailboxDatabase>eseutil.exe /p ".\Mailbox Database 0640250043.edb" /g

Some errors had been fixed, but the database still unmountable because of the error in the log file E00.log. So it’s time to accept risks. Let’s get rid of the current logs.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
[PS] C:\>
[PS] C:\>cd "C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 0640250043"
[PS] C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 0640250043>mkdir bkp
Directory: C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 0640250043
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 03/08/2015 13:33 bkp
[PS] C:\Program Files\Microsoft\Exchange Server\V15\Mailbox\Mailbox Database 0640250043>move * bkp

Checking the database status it seems ok to get up.

1
[PS] E:\MailboxDatabase>eseutil.exe /mh ".\Mailbox Database 0640250043.edb"

After this command new clean logs were generated for the database.

1
[PS] C:\>Mount-Database "Mailbox Database 0640250043"

It worked.