Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

mdf file is corrupted in ms sql server 2008 database

database

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 pasqualeottavi

pasqualeottavi

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 16 March 2015 - 04:22 PM

Hi guys,
 
My database .mdf file got corrupted and I have no means to get my schema s.I tried with a few soft wares available on the internet but its turns out that all of them being demo versions don't give back the repaired file.
 
Is there any other means by which I can restore my db?
 
I am using MS SQL 2008.
 
Please, any help!


#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts

Posted 17 March 2015 - 04:29 AM

Options:

1) Restore from nightly backup (you do have a backup routine, right?)

2) Pay for one of the software recovery tools

3) Consider this a very hard lesson learned and start implementing nightly backups.

 

I'm kind of confused as to why you haven't just paid for one of the recovery tools you already found.


Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#3 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 18 March 2015 - 02:16 AM

Welcome aboard,

 

As mentioned earlier, why not pay for something that works?

About your trouble, one thing is for certain, prevention helps a lot.

 

Anyway, try the Sql Server Recovery Toolbox.



#4 arturdal

arturdal

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 21 March 2015 - 07:22 AM

There is a manual solution to fix this problem, but you need to have Microsoft SQL Server Management Studio for that. If you have it, you need to follow the steps given below:
 
Open Microsoft SQL Server Management Studio on your system.
Now click on New Query button.
A new query page will be opened. Write the SQL scripts (shown below) on the page:
 
EXEC sp_resetstatus [YourDatabase]; 
ALTER DATABASE [YourDatabase] SET EMERGENCY  
DBCC checkdb ([YourDatabase]) 
ALTER DATABASE [YourDatabase] SET SINGLE_USER WITH ROLLBACK IMMEDIATE 
DBCC DATABASE ([YourDatabase], REPAIR_ALLOW_DATA_LOSS) 
ALTER DATABASE [YourDatabase] SET MULTI_USER 
 
Now click on Execute.
 
Now you can see the file is not tagged as Suspect.

Edited by WingedPanther, 23 March 2015 - 04:24 AM.
delete spammy links.