Skip to Content
avatar image
Former Member

New SQL Databse

I have a DB that I stupidly detached when I was having problems with it (corrupt LDF it seems). Unfortunately this (previously assumed unimportant) DB has no backup history. I have recently inherited this server.

So I have the mdf and I am trying to create dbname file = ....mdf for attach/repair/rebuild
No matter what I try I get the same error saying that :
The header for file 'g:\sqllogs\dbname.LDF' is not a valid database file header. The PageAudit property is incorrect.  I've tried the sp_attach_single_file_db but that also complains about the LDF.
What are my options to retrieve this db?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 25, 2016 at 10:32 AM

    “I've tried the sp_attach_single_file_db but that also complains about the LDF.”


    Either rename the existing log file or move it to a different folder from where it was when it was detached.
    IF you have the original mdf, before any attaches were tried, copy that back over the mdf that has previous attach attempts.  If possible, always go back to a fresh, non-previously-attached version of the mdf to attempt a new attach.

    Then, and only then, try the :


    EXEC sp_attach_single_file_db


    If all is unsuccessful, then you can try this sql mdf repair tool like MDF Repair Kit. There is a demo version and you can make a choice it useful to you or not. http://www.mdf.repair/

    Also if you have tried the sp_attach_single_file_db and has not been successful then check out Paul Randal's suggestions here:

    http://social.msdn.microsoft.com/forums/en-US/sqldisasterrecovery/thread/189be01f-23de-48b0-96cc-8f1292c13c54/

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 22, 2016 at 02:38 PM

    Hello,

    please open an OSS Case for this in component BC-DB-MSS, so that we can help you.

    Best regards

       Clas Hortien

    Add comment
    10|10000 characters needed characters exceeded