1. 新空数据库OLD,将oldEDB文件装入新的空数据库

将博客搬至CSDN_第1张图片

Eseutil命令

DESCRIPTION:  Database utilities for the Extensible Storage Engine for Microsoft

(R) Exchange Server.


MODES OF OPERATION:

Defragmentation:  ESEUTIL /d [options]

Recovery:  ESEUTIL /r [options]

Integrity:  ESEUTIL /g [options]

Checksum:  ESEUTIL /k [options]

Repair:  ESEUTIL /p [options]

File Dump:  ESEUTIL /m[mode-modifier]

Copy File:  ESEUTIL /y [options]

Restore:  ESEUTIL /c[mode-modifier] [options]


<<<<<  Press a key for more help  >>>>>

D=Defragmentation, R=Recovery, G=inteGrity, K=checKsum,

P=rePair, M=file duMp, Y=copY file, C=restore


CMD执行,,,

做这些之前先把LOG全部剪贴到其他文件夹

  1. 查看数据库状态是否为State: Dirty Shutdown


C:\Program Files\Microsoft\Exchange Server\V14\Bin>eseutil /mh "D:\Program Files

\Microsoft\Exchange Server\V14\Mailbox\Mailbox Database 1339450694\Mailbox Datab

ase 1339450694.edb"



Rand:1983680 Computer:

cbDbPage: 32768

dbtime: 896820854 (0x35746676)

State: Dirty Shutdown

Log Required: 579051-579057 (0x8d5eb-0x8d5f1)


  1. 确认后执行修复---时间较长, 两次扫描, 100G花费1个半小时

C:\Program Files\Microsoft\Exchange Server\V14\Bin>eseutil /p "D:\Program Files\

Microsoft\Exchange Server\V14\Mailbox\Mailbox Database 1339450694\Mailbox Databa

se 1339450694.edb"


Extensible Storage Engine Utilities for Microsoft(R) Exchange Server

Version 14.02

Copyright (C) Microsoft Corporation. All Rights Reserved.


Initiating REPAIR mode...

Database: D:\Program Files\Microsoft\Exchange Server\V14\Mailbox\Mailbox

Database 1339450694\Mailbox Database 1339450694.edb

Temp. Database: TEMPREPAIR5900.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

|----|----|----|----|----|----|----|----|----|----|

...................................................



Scanning the database.


Scanning Status (% complete)


0    10   20   30   40   50   60   70   80   90  100

|----|----|----|----|----|----|----|----|----|----|

...................................................



Repairing damaged tables.


Scanning Status (% complete)


0    10   20   30   40   50   60   70   80   90  100

|----|----|----|----|----|----|----|----|----|----|

................

Deleting unicode fixup table.


Deleting MSObjids.


Deleting MSysLocales.

...................................

########这里要等待#########


Repair completed. Database corruption has been repaired!


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 with 595 (JET_wrnDatabaseRepaired, Database cor

ruption has been repaired) after 4132.672 seconds.

将博客搬至CSDN_第2张图片


  1. 查看数据库是否为state:clen shutdown

C:\Program Files\Microsoft\Exchange Server\V14\Bin>eseutil /mh "D:\Program Files

\Microsoft\Exchange Server\V14\Mailbox\Mailbox Database 1339450694\Mailbox Datab

ase 1339450694.edb"


DB Signature: Create time:01/14/2012 17:10:18 Rand:60555826 Computer:

cbDbPage: 32768

dbtime: 897394921 (0x357d28e9)

State: Clean Shutdown

Log Required: 0-0 (0x0-0x0)

Log Committed: 0-0 (0x0-0x0)


将博客搬至CSDN_第3张图片

Exchange是丢失老数据库。fix是新建的正在使用的数据库

Get-mailbox -database Exchange | set-mailbox -database fix