SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 My db in sql server fix
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

TsonsiHons
Starting Member

Thailand
1 Posts

Posted - 08/12/2014 :  15:37:24  Show Profile  Reply with Quote
After the failure of electricity, and my database in sql server corrupted. Tried to return the backup, but when importing, there is an error that the database is corrupted. What should I do, tell me?

tkizer
Almighty SQL Goddess

USA
37129 Posts

Posted - 08/12/2014 :  15:39:40  Show Profile  Visit tkizer's Homepage  Reply with Quote
If you have a SQL Server backup, then you should be running the RESTORE DATABASE command using that backup. I am not sure what you are trying to import. Please define what you mean by backup.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/

Edited by - tkizer on 08/12/2014 15:40:00
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
37129 Posts

Posted - 08/12/2014 :  15:40:23  Show Profile  Visit tkizer's Homepage  Reply with Quote
Also, how do you know the database is corrupted? Have you run DBCC CHECKDB against it? If so, please post the entire output.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

prett
Posting Yak Master

USA
203 Posts

Posted - 08/13/2014 :  01:47:05  Show Profile  Visit prett's Homepage  Reply with Quote
What is the error message when you try to restore database from backup?

Without knowing error message, it is very hard to reply.
Go to Top of Page

Lincolnburrows
Starting Member

42 Posts

Posted - 08/21/2014 :  06:46:58  Show Profile  Reply with Quote
There might be other options out there. This is something that worked for me once but there are no guarantees that it will work at all times.

Stop SQL Server instance -> Copy MDF and LDF files to another location -> Delete original MDF and LDF files -> Start SQL Server instance again -> Create new database with exact same name and file names -> Stop SQL Server -> overwrite newly created MDF and LDF.

After this your database should be back online. If it is then go ahead and put it into EMERGANCY mode and SINGLE USER mode.

Finally go ahead and execute DBCC CHECKDB like this

DBCC CHECKDB (databaseName, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS

If you can get to this and execute last command successfully you should be good. If not then your only options are restoring from backup and/or using 3rd party tools.

Go to Top of Page

prett
Posting Yak Master

USA
203 Posts

Posted - 09/02/2014 :  04:28:00  Show Profile  Visit prett's Homepage  Reply with Quote
Below is the list of top 10 SQL database recovery software that you can try to recover data from corrupt database.

http://www.thetoptens.com/best-sql-recovery-software/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000