Can we Attach database files with out detaching?

  • Can we Attach MDF and LDF files for the ones that were not detached.

    Why I ask?

    I have system thats crashed due to power fluctuations. And seems like, something got fried that shows the BSOD.

    stating MACHINE_CHECK_EXCEPTION with error code/Technical information:

    *** STOP: 0x0000009C (0x0000000000000000, 0XFFFFFADF298E1240, 0x00000000f2000840,

    0x0000000050000400)

    Figuring out what is fried is a different task. I need to bring the databse back up again.

    My question is, Can I take a different box and Plug these drives in. And then install a new instance of SQL Server 2005 std edition (on win2003) and Attach the Datafiles directly to make a new databse in the management studio?

    and ofcourse rename this new box to what the old box was called.

    Thank you

    Kindest Regards,
    Shivaram Challa
    (http://challa.net - Home of the "Excel to CSV converter & Browsepad applications".)
    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • You can, but you need to also be aware of logins. You can install SQL Server on the new box, attach the MDF/LDF as a new database, and you'll have your data, objects, users, and database security. But you won't have logins, and you'll need to add them to the new master.

    You could restore the master, but if paths are different, or builds different, you could have issues.

  • That should work as long as the databases did not get corrupted.

  • Actual database files are organized on D:,E:,F:,G:

    And this crash occured due to multiple power failures. Which makes me think that its the boot sector thats corrupt.

    I was thinking that when we detach a database, the files will be somehow marked as detached. Looks like its not the case.

    Once I get this new machine, I will attach the database's and see what happens.

    Crossing my fingers that the data disk isn't corrupt. :crying:

    Kindest Regards,
    Shivaram Challa
    (http://challa.net - Home of the "Excel to CSV converter & Browsepad applications".)
    Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • If the straightforward method doesn't work - you MIGHT get away with, well, cheating..:)

    Create a blank database with the same name and filenames as the one you're trying to attach, leave them attached, and stop SQL server. Once the service is stopped - replace the files you just created with the ones you salvaged, and try restarting. The files may come up suspect, but there are repair options at that point that MIGHT get you past the issues (not an expert in corruption, so I will quit while I'm ahead).

    Needless to say - try this with COPIES of whatever you salvaged.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply