[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 8925
  • Last Modified:

Can't Mount Database

I had a hardrive failure and recovered from a back-up and now exchange does not work and this is the error i get when i try to mount it


Failed to mount database 'Mailbox Database'.  Mailbox Database Failed Error: Exchange is \First Storage Group\Mailbox Database; Error code: MapiExceptionJetErrorAttachedDatabaseMismatch: Unable to mount database. (hr=0x80004005, ec=-1216) .
0
danhartke
Asked:
danhartke
  • 32
  • 24
  • 8
  • +1
1 Solution
 
pritamshCommented:
Follow this steps;

Run eseutil  /Mh  and eseutil /ML gainst database and logs respectively.
Check for database shutdown state.
If it is clean shutdown than copy all log files to different location and try to mount database
If it is in dirty shutdown check for which log file is missing and try to replace log files form backup
else run eseutil /r (soft recovery) for repairing corrupt database.

Before doing above mentioned steps i'll recommend uncheck option 'Start database at startup' and restart server then try to mount database.

Let me know it this helps.
0
 
danhartkeAuthor Commented:
Forgive me, my exchange skills are seriously weak.
I am in a bit over my head

Where am I running those commands from?
Exchange Shell?


0
 
aoakeleyCommented:
Assuming exchange 2003?

Then these commands can be found in c:\program files\exchsrvr\bin

open a command prompt and navigate to that directory
cmd
#> c:
#> cd c:\program files\exchsrvr\bin
#> eseutil /mh c:\program files\exchsrvr\MDBDATA\priv1.edb

Look at the output and see if the database is in "Clean Shutdown" or "Dirty shutdown"
(I am guessing dirty and there is something wrong with the logs or log file missing, but you might get lucky)

Generally in these cases it is better to recover from abckup and replay the log files (assuming that circular logging is not turned on.

Exchange recovery can be a long process, but if you can give us as much info about the backups you do have and your current setup we will do our best to assist you through the recovery.

Andy
0
Easily manage email signatures in Office 365

Managing email signatures in Office 365 can be a challenging task if you don't have the right tool. CodeTwo Email Signatures for Office 365 will help you implement a unified email signature look, no matter what email client is used by users. Test it for free!

 
danhartkeAuthor Commented:
I am running Exchange Server 2007 on Small Business Server 2008
0
 
aoakeleyCommented:
What backup are you running?
0
 
danhartkeAuthor Commented:
Microsoft Server Back-up for Server 2008
0
 
aoakeleyCommented:
As per above (@pritamsh) we should still find out if the DB is in a clean or dirty shutdown.

same process...
eseutil is in: C:\Program Files\Microsoft\Exchange Server\Bin
path to mailbox is probably C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group\

If database is in clean shutdown then
- remove logs
- mark database as "able to be over written by restore (scroll down: http://www.ibackup.com/online-backup-exchange-server/ibwin_new_ex_restore.htm)
- mount database

If in dirty shutdown let us know
0
 
pritamshCommented:
I have mentioned that opiton as well ;)
0
 
aoakeleyCommented:
PS. don;t delete log file - just move them somewhere else - we might need them again
0
 
aoakeleyCommented:
@pritamsh - yes, you will notice I gave you credit for it. I just expanded on your suggestion :)
0
 
pritamshCommented:
Thank you Aoakeley..
0
 
danhartkeAuthor Commented:
I am getting this error when I put the command in

C:\Program Files\Microsoft\Exchange Server\Bin>eseutil /mh D:\Exchange\Mail Data
base\Mailbox Database.edb

Usage Error: Invalid argument 'Database\Mailbox'. Options must be preceded by '-
' or '/'.
0
 
aoakeleyCommented:
put the D:\Exchange\Mail Database\Mailbox Database.edb in """"

eseutil /mh "D:\Exchange\Mail Database\Mailbox Database.edb"
0
 
danhartkeAuthor Commented:
Returns

Initiating FILE DUMP mode...
Error: Access to source database 'D:\Exchange\Mail Database\Mailbox Database.edb
' failed with Jet error -1811.

Operation terminated with error -1811 (JET_errFileNotFound, File not found) afte
r 0.0 seconds.
0
 
aoakeleyCommented:
So is D:\Exchange\Mail Database\Mailbox Database.edb really there?
Any typo?

Please confirm the file exists?
0
 
danhartkeAuthor Commented:
Initiating FILE DUMP mode...
         Database: D:\Exchange\Mail Database\Mailbox Database.edb

        File Type: Database
   Format ulMagic: 0x89abcdef
   Engine ulMagic: 0x89abcdef
 Format ulVersion: 0x620,12
 Engine ulVersion: 0x620,12
Created ulVersion: 0x620,12
     DB Signature: Create time:05/02/2011 02:02:23 Rand:5915623 Computer:
         cbDbPage: 8192
           dbtime: 279440470 (0x10a7ec56)
            State: Dirty Shutdown
     Log Required: 0-0 (0x0-0x0)
    Log Committed: 0-0 (0x0-0x0)
   Streaming File: No
         Shadowed: Yes
       Last Objid: 80591
     Scrub Dbtime: 0 (0x0)
       Scrub Date: 00/00/1900 00:00:00
     Repair Count: 2
      Repair Date: 05/02/2011 02:02:23
 Old Repair Count: 0
  Last Consistent: (0x0,0,0)  00/00/1900 00:00:00
      Last Attach: (0x0,0,0)  05/02/2011 02:02:23
      Last Detach: (0x0,0,0)  00/00/1900 00:00:00
             Dbid: 1
    Log Signature: Create time:00/00/1900 00:00:00 Rand:0 Computer:
       OS Version: (6.0.6001 SP 1 NLS 500100.50100)

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

Previous Copy Backup:
        Log Gen: 0-0 (0x0-0x0)
           Mark: (0x0,0,0)
           Mark: 00/00/1900 00:00:00

Previous Differential 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 0.234 seconds.
0
 
aoakeleyCommented:
OK your database is in
State: Dirty Shutdown

Before you proceed further please confirm for me if you have "Circular Logging" enabled. This will be critical in determining how to go forward from here. See http://technet.microsoft.com/en-us/library/bb331968%28EXCHG.80%29.aspx for how to tell. Do not change anything - just let us know.

You could try running eseutil with the /r switch (as @pritamsh) suggested. But this is for soft recovery and will most likely not work anyway. Exchange performs a soft recovery when you try to mount the database.

You could try to *move* all log files and mount the dirty shutdown database (very slight chance it will mount)

the best solution is probably
1. Mark the databases as "able to be overwritten by a restore" using the Exchange Management Console
2. leave all the log files where they are and run an Exchange Restore from the windows backup utility
3. It will restore the database from the last backup and replay the log files.

Worst case scenario we can fix the database with eseutil /p - but that can damage the database.

Let us know about circular logging and we will proceed from there.

Andy




0
 
danhartkeAuthor Commented:
Circular logging is not enabled
I am waiting for the server to reboot after changing the drive letter assignment
When I restored the drive it changed the drive letter, hence the command not working

0
 
aoakeleyCommented:
OK it is good that circular logging is not enabled.

Which drive letter changed?
- for the exchange databases to mount the drive letters need to be EXACTLY as there were before the server was recoverd.
- If the exchange database/log file drive letter was changed and you have no corrected that the databases may just mount now.
- Please confirm that you have/have not changed any database or log file paths in Exchange Management Console or Exchange Powershell since the server was recovered?


0
 
danhartkeAuthor Commented:
I changed the drive letter back to what it was before restore.

0
 
aoakeleyCommented:
If you have not changed/deleted any log files, or changed the exchange configuration in any way, you may find that the database simply mounts now. X fingers.
0
 
danhartkeAuthor Commented:
Microsoft Exchange Error
--------------------------------------------------------
Failed to mount database 'Mailbox Database'.

Mailbox Database
Failed
Error:
Exchange is unable to mount the database that you specified. Specified database: NUTTINGSERVER\First Storage Group\Mailbox Database; Error code: MapiExceptionJetErrorAttachedDatabaseMismatch: Unable to mount database. (hr=0x80004005, ec=-1216)
.




--------------------------------------------------------
OK
--------------------------------------------------------
0
 
danhartkeAuthor Commented:
I see no option to do an exchange recover in the back-up utility
0
 
aoakeleyCommented:
Before you do a restore, just try marking the database as "this database can be overwritten by a restore" and mounting it again.
0
 
danhartkeAuthor Commented:
no luck with that
0
 
aoakeleyCommented:
See screenshot.

If you have setup the Windows sbs2008 backup you shold be able to restore exchange as per screenshots Restore Exchange
0
 
danhartkeAuthor Commented:
I only see sharepoint services, not exchange there
0
 
aoakeleyCommented:
Damn... you are in a world of hurt then.

So I can have some more insight into the failure and give you the next best way forward
1. When did the disk fail? (exact date and time please)
2. When was the backup? (exact date and time please)
3. Do you still have access to the old disk? is anything on it readable?

thanks

Andy
0
 
danhartkeAuthor Commented:
The disk failed saturday afternoon
I just restored it this morning to a functional back-up from Friday at noon

The disk that failed was the data disk, not the operating system.

Data on the drive is spotty, but somewhat readable
0
 
aoakeleyCommented:
Are the reansaction logs and the database files in the same folder?
Is this D:\Exchange\Mail Database\
 - or what is the new drive letter?
0
 
aoakeleyCommented:
just composing some commands for you... what do the log files start with? will be E00 or E01 etc
0
 
danhartkeAuthor Commented:
no the logs are not in the same directory

Log Path C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group

Database Path: D:\Exchange\Mail Database\Mailbox Database.edb
0
 
danhartkeAuthor Commented:
Log Files start with E0000021FBB, E0000021FBA
0
 
aoakeleyCommented:
this is good if you have the transaction logs and the database and circular logging is off we should be able to replay the transaction logs.
the only issue is that your database does not know what log it should be replaying.
            State: Dirty Shutdown
     Log Required: 0-0 (0x0-0x0)
infact it thinks it is up-to-date

Try this from an elevated (run as administrator) command prompt. Assume everything is from an elevated prompt from here on in.


#> path=%path%;C:\Program Files\Microsoft\Exchange Server\Bin
#> d:
#> cd "D:\Exchange\Mail Database\"
#> eseutil /R E00 /I /D /L"C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" /Sd:
0
 
aoakeleyCommented:
Here is some info on eseutil /R so you can interpret the commands yourself
http://technet.microsoft.com/en-us/library/bb123479%28EXCHG.80%29.aspx 
0
 
aoakeleyCommented:
any news?
0
 
danhartkeAuthor Commented:
Performing Soft Recovery Curently from the last set of instructions

I restored what I know to be a good directory first (Before I started tweaking things around)

Seems to be running though
0
 
aoakeleyCommented:
Excellent. Generally soft recovery will fail right away if it is not going to work. So if it is running that is an excellent sign. Make sure that if this works you also assign points to @pritamsh.

You could technically assign all points to him. His first post was technically correct. I just tent to ask more questions to ensure my answers are as well targeted as possible.
0
 
danhartkeAuthor Commented:
It is working, but very slow
Database was about 60gigs
I hope I can award some points after this one and Exchange works again :)
0
 
pritamshCommented:
We are more concerned about your Exchange server than gaining points, right Aoakeley :)
0
 
aoakeleyCommented:
5gb per hour is the processing speed of eseutil. Because you are just replaying the logs it will not have to process all 60GB but can still take a while

@pritamsh - I go through phases. Mostly it is for my own amusement. Today I looked for the potentially most complex case in my field and jumped on it, (Exchange recovery is always fun). Some other days I try to pick off easy points. sometimes I go for weeks without doing an EE. but it is ALWAYS satisfying seeing someones problem solved.

Lets hope we are not jumping the gun and this actually fixes it :)
0
 
danhartkeAuthor Commented:
Initiating RECOVERY mode...
    Logfile base name: E00
            Log files: C:\Program Files\Microsoft\Exchange Server\Mailbox\First
Storage Group
         System files: d:
   Database Directory: <current directory>

Performing soft recovery...
                      Restore Status (% complete)

          0    10   20   30   40   50   60   70   80   90  100
          |----|----|----|----|----|----|----|----|----|----|
          ........



Operation terminated with error -515 (JET_errInvalidLogSequence, Timestamp in ne
xt log does not match expected) after 1512.984 seconds.
0
 
pritamshCommented:
Danhartke,

are you ok with performing hard recovery? Hard recovery will involve loss of email.

Switch to run hard recovery : eseutil/ P
0
 
danhartkeAuthor Commented:
How much loss of email are we talking about?
0
 
pritamshCommented:
Totally depends upon corruption may vary from 1 MB to complete database..

Just run eseutil /ML and eseutil /K and it will tell you how much logs are missing.
0
 
aoakeleyCommented:
Potentially every email in the database could lose their attachments if the attachment table is deleted by eseutil /p

I would like to see if we can avoid eseutil /p if we can. Zero loss restore should be possible.

Did you run eseutil with all the switches I specified?
0
 
danhartkeAuthor Commented:
Yes I pasted it into Command Prompt
0
 
aoakeleyCommented:
do what @pritamsh says with /ML and /K (you should be able to figure out the syntax yourself by now) and post results while I have a quick think.
0
 
danhartkeAuthor Commented:

C:\Program Files\Microsoft\Exchange Server\Bin>eseutil /ML "C:\Program Files\Mic
rosoft\Exchange Server\Mailbox\First Storage Group"

Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 08.02
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating FILE DUMP mode...

      Base name: Fir
      Log file: C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage
 Group
                ERROR: Cannot open log file (C:\Program Files\Microsoft\Exchange
 Server\Mailbox\First Storage Group). Error -1032.

Operation terminated with error -1032 (JET_errFileAccessDenied, Cannot access fi
le, the file is locked or in use) after 10.31 seconds.
0
 
aoakeleyCommented:
We can give this one a crack... (personally I have not had opportunity to use this on a live system yet, you you might have to tweak the syntax. Not sure if the /I is still applicable )

1. If the is an e00.chk in D: created by running the last command - delete it
2. #> ESEUTIL /R Enn /A /D /L"C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group" /Sd:

Recovering a database that has missing log files

In Exchange Server 2007, a new feature named Lost Log Resilience (LLR) protects Exchange databases from losing the last few log files, and enables faster recovery. When an LLR-protected log file is missing or corrupted, typical database mounting or recovery by using Eseutil fails and does not provide the new /A recovery option. Event ID 523 is logged to the Event log and states the kind of failure that occurred. On a database on which an LLR-protected log file is missing or corrupted, you can run Eseutil recovery by using the /A option in recovery mode as follows:

ESEUTIL /R Enn /A
0
 
aoakeleyCommented:
with the /ML specify the full path to the EDB file - same as the /MH we ran earlier
0
 
aoakeleyCommented:
@pritamsh - ever use eseutil /A ?
0
 
pritamshCommented:
nope..what exactly it does?
0
 
aoakeleyCommented:
Sorry - meant eseutil /R /E00 /A as per my earlier post?
0
 
pritamshCommented:
use...last time i faced similar issue...i used this command eseutil /R /Enn /A /8
0
 
aoakeleyCommented:
@pritamsh - Thanks for pointing out the /8 as ex2007 has 8K page size (used to be 4K)

From the eseutil /ML output
cbDbPage: 8192

Though I believe when running eseutil on the exchange server the databases come from we do not need to specify the page size.....

Lets see what the Author comes back with, we have given him quite a fw things to do now :) ...
0
 
aoakeleyCommented:
OK Guys,

I am going to have to hit the sack (getting late here) so danhartke I will leave you with these points

1. use eseutil /p only as a last resort this is a destructive repair and you may not notice the database damage until days or week later, by which time it will not be possible to recover from.  Best case scenario after this restore you will be back to the time the backup was taken, no transaction log replay occurs. You will need to delete all the log files aftere eseutil /p for the database to mount.

2. use eseutil /MH before you mount the database to check if it is in a "clean Shutdown" state. A database in a  clean shutdown state can be mounted without any transaction logs. So if you get the DB into this state delete all the transaction logs and the database will mount

3. Tick the "this database can be over written by a restore" before mounting the database after any of these commands

4. use eseutil /K E00 to check the consistency of all the log files. If there is a berak in the log files it is most likely right at the end.

5. eseutil /R E00 /A should be able to assist you with missing log files. You can also use this trick to close out a log file sequence http://social.technet.microsoft.com/Forums/en-US/exchangesvrgeneral/thread/cc4f08f8-f422-4914-bb92-dc81966297b0/

6. Don't rush you should be able to get a 0 loss restore or very close to it. See the info here http://technet.microsoft.com/en-us/library/aa998249%28EXCHG.80%29.aspx for more detailed info on eseutil. note each command description has a "brief summary" and a detailed "how to run" section.

7. When this is all done and dusted make sure you have an "Exchange Aware" backup, or fix the windows backup (which is actually very good) so it recognises Exchange as an application.

8. did I mention don't rush

9. @pritamsh will be able to help you

10. you can also "request Attention" to get assistance from other experts. I have sent an email to a friend of mine who will also take a look in here

Good luck

Andy
0
 
danhartkeAuthor Commented:
It sems to be stotpping in the same place on each one

D:\Exchange\Mail Database>ESEUTIL /R E00 /A /D /L"C:\Program Files\Microsoft\Exc
hange Server\Mailbox\First Storage Group" /Sd:

Extensible Storage Engine Utilities for Microsoft(R) Exchange Server
Version 08.02
Copyright (C) Microsoft Corporation. All Rights Reserved.

Initiating RECOVERY mode...
    Logfile base name: E00
            Log files: C:\Program Files\Microsoft\Exchange Server\Mailbox\First
Storage Group
         System files: d:
   Database Directory: <current directory>

Performing soft recovery...
                      Restore Status (% complete)

          0    10   20   30   40   50   60   70   80   90  100
          |----|----|----|----|----|----|----|----|----|----|
          ........



Operation terminated with error -515 (JET_errInvalidLogSequence, Timestamp in ne
xt log does not match expected) after 816.937 seconds.
0
 
aoakeleyCommented:
Can we get the output from /K and /MH please?

1.
#> cd C:\Program Files\Microsoft\Exchange Server\Mailbox\First Storage Group
#> eseutil /K E00

2.
#> eseutil /MH "D:\Exchange\Mail Database\Mailbox Database.edb"
0
 
aoakeleyCommented:
sorrt meant ML
#> eseutil /ML "D:\Exchange\Mail Database\Mailbox Database.edb"
0
 
danhartkeAuthor Commented:
eseutil /K E00 is running with tons and tons of files. so far everything saying OK
Been running for about 10minutes
0
 
aoakeleyCommented:
How many log files have you got? and how far back do they go?
0
 
danhartkeAuthor Commented:
50,729 ot March of last year
0
 
aoakeleyCommented:
OK that is how long it has been since you last had an "Exchange Aware" backup. Strange that you have not run out of disk space. Each time exchange is backed up with an "exchange aware" backup program it commits all the log files and purges them. The chance of you having a complete sequence is quite unlikely, somewhere in there is bound to be a damaged file from a server shutdown or something.

Right I am getting super tired...

 To verify both sequence and integrity of a set of log files

    Run the following command syntax:

    ESEUTIL /ML Enn

    For example:

    ESEUTIL /ML E00

By specifying only the log file prefix, rather than a particular log file name, all log files in the current folder will be scanned and validated. You must run this command from the folder where the log files exist. Processing each log file will take a few seconds. To process the current log file in a running storage group, all databases in the storage group must be dismounted.

ESEutil /K http://technet.microsoft.com/en-us/library/bb124581%28EXCHG.65%29.aspx

We can probably make life a bit simpler for ourselves by tring to determine the last log file committed to the database files you have restored. What is confusing me is that your last eseutil /MH showed the following

     DB Signature: Create time:05/02/2011 02:02:23 Rand:5915623 Computer:
         cbDbPage: 8192
           dbtime: 279440470 (0x10a7ec56)
            State: Dirty Shutdown
     Log Required: 0-0 (0x0-0x0)
    Log Committed: 0-0 (0x0-0x0)

Though this was before you restored the database again. If you could run /MH again on a newly restored database, if there is some info in the /MH output that gives you the last committed log file you can delete everything prior to that log.

goodnight

0
 
sunnyc7Commented:
hey andy. Sorry i got to this a little late. Looks like you fixed the issue. Great Job.
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 32
  • 24
  • 8
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now