Verifying Consistency Before Moving Database Files

 

Unless you are restoring from an online backup, the database files (.edb and .stm) must be in a Clean Shutdown state before they are moved to another storage group.

You can know whether a database is shut down cleanly by using the Exchange Server Database Utilities (Eseutil.exe) tool and examining each file with the command Eseutil /mh [database filename].edb. In Exchange 2000 Service Pack 1 and later versions, a line in the output of this command reads either "State: Clean Shutdown" or "State: Dirty Shutdown." Prior to this version of Exchange, the same state is reported as "State: Consistent" or "State: Inconsistent."

Run Eseutil.exe against both the .edb and .stm files to verify the shutdown state. Below is an example of the output from Eseutil /mh (important lines are highlighted):

Microsoft(R) Exchange Server Database Utilities

Version 6.5

Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating FILE DUMP mode...

Database: priv1.edb

File Type: Database

Format ulMagic: 0x89abcdef

Engine ulMagic: 0x89abcdef

Format ulVersion: 0x620,9

Engine ulVersion: 0x620,9

Created ulVersion: 0x620,9

cbDbPage: 4096

dbtime: 20887 (0-20887)

Log Required: 0-0

Streaming File: Yes

Shadowed: Yes

Last Objid: 127

Scrub Dbtime: 0 (0-0)

Scrub Date: 00/00/1900 00:00:00

Repair Count: 0

Repair Date: 00/00/1900 00:00:00

Microsoft(R) Exchange Server Database Utilities

Version 6.5

Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating FILE DUMP mode...

Database: priv1.stm

File Type: Streaming File

Format ulMagic: 0x89abcdef

Engine ulMagic: 0x89abcdef

Format ulVersion: 0x620,9

Engine ulVersion: 0x620,9

Created ulVersion: 0x620,9

cbDbPage: 4096

dbtime: 0 (0-0)

Log Required: 0-0

Shadowed: Yes

Last Objid: 0

Scrub Dbtime: 0 (0-0)

Scrub Date: 00/00/1900 00:00:00

Repair Count: 0

Repair Date: 00/00/1900 00:00:00

To be absolutely sure that the .edb and .stm files are a matched set, you can also compare the DB Signature and Last Consistent lines from the Eseutil.exe output. The DB Signature is a unique value that identifies a particular database. If the values of the .edb and .stm files differ, the files do not match, regardless of the shutdown state.

The Last Consistent line verifies that the files were last shut down simultaneously. The timestamp for Last Consistent does not have to match, but the numbers in parentheses should match exactly. These numbers indicate the current transaction log file in use at the time of the shutdown (in this example, the database was in transaction log 3), and how much of the log file has been filled (in this example, the shutdown occurred 0x46 sectors into the log file and 0xDC bytes into that sector).