Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help - deleted did not detach database

Status
Not open for further replies.
Apr 11, 2013
1
US
Hello all,

I am new here and to the SQL world. I am creating a DM for Analysis. I received an updated mdf from my DBA so I can continue testing and get the latest information. Instead of being savvy I deleted the Database through SSMS. Did not Detach. I really screwed this up.

So when I tried to attach the new mdf file I receive this message:

File activation failure. The physical file name "c:\Program Files (x86)\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\OFC_Jay_1.LDF" may be incorrect.
The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'ForbeyonOFC'. CREATE DATABASE is aborted.

What do I do? Is there a way to rebuild the Master log? Err. Any help?
 
You could try using sp_attach_single_file.


When your DBA sends you a database, he SHOULD be sending an mdf and an ldf file, or he should send you a backup of the database that you can restore.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Do you have a backup of the original database that you can restore? That will give you the .mdf and .ldf files back....but I don't see how your process will work since the .ldf you have isn't part of the .mdf you got. It might work as I've never tried that, but as George said, you should have gotten a .mdf and .ldf or a backup file from whomever sent it. Another issue will be if they did the copy of the .mdf while the database was still attached, that will make the .mdf unusable.

-SQLBill

The following is part of my signature block and is only intended to be informational.
Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top