/build/static/layout/Breadcrumb_cap_w.png

Hi everyone, I am hoping that you can help me. I had a SQL that got destroyed by someone re-initializing the disks on a RAID array and destroying the data. Here's the problem:


I have managed to restore the DB from a very old backup, and I tried replacing the MDF and LDF files with the ones that I recovered from a backup.  The problem is that the new MDF and LDF files were not detached in the copy that I have, so when I start up the SQL server EM shows the DB as Loading/Suspect.  I have tried restoring the database using sp_attach_db, sp_attach_single_file_db.  I get the error The log for database DBName is corrupt' when I use sp_attach_db, and when I use sp_attach_single_file_db I get the error 'Database 'DBName' cannot be opened because some of the files could not be activated'

What can I do?  Can a database be restored from an MDF file that wasn't de-attached first?

0 Comments   [ + ] Show comments

Answers (1)

Posted by: smol45 9 years ago
White Belt
1

Hi..U can get info here:

 http://www.filerepairforum.com/forum/microsoft/microsoft-aa/sql-server/569-i-have-a-problem-how-do-i-fix-a-corrupted-database-file

· Click the Windows "Start" button and enter "cmd"into the text box. Press "Enter" to open your command line utility.

·  Type thefollowing command into the command prompt and press "Enter":

cd C:\Program Files\Microsoft SQL Server\100\SetupBootstrap\Release

This points the command prompt to the location of therebuild executable files.

·   Type thefollowing text into the command line and press "Enter":

Setup.Exe /Action=RebuildDatabase/InstanceName=MSSQLSERVER /SqlSysAdminAccounts=Admin

This command rebuilds the database. It may takeseveral minutes to complete. Once it is finished, the command line returns asuccess message.

  

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ