Question Locked

SQL Database is corrupted....... plz help.

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Respected Sir,

unfortunately hard disk of my system is damaged, now i recovered my database. but it cannot be attached again to SQL management studio 2005.
the error is myfile.mdf is not a primary database file. (SQL server , error 5171)

plz sir help me...

8 replies

by jason31burns

Any uncertain like virus attack, power failure, hardware issue, OS malfunction, sudden system shutdown, so on. When a SQL server data file (.mdf) is corrupt then DBAs can try several methods to repair and recover data from it.

• Run DBCC CHECKDB: It checks & reports all the error message in errorlog, if there is any problem with the database. Try to analyze & understand the error message logged in the errorlog. Re-run DBCC CHECKDB with the recommended minimum repair option to repair the file.
Detailed information about DBCC CHECKDB is available here: https://www.techrepublic.com/forums/discussions/sql-database-recovery-from-corrupt-database-file/

• Restore from backup: If above command fails to fix the error message the try to restore the database from clean backup.
• 3rd party tool: Try 3rd party Recovery Toolbox for SQL Server to recover data from corrupt mdf file.

Most of the software have demo version that shows the preview of corrupt SQL server data file.

http://www.sql.recoverytoolbox.com/

by ericschweizer

1
Open Enterprise Manager, expand your server group and then expand the desired server.

2
Navigate to the "Databases" folder and right-click on the database you wish to restore.

3
Hover over "All Tasks" within the pop-up menu and then select the "Restore Database" menu item.

4
Ensure the "Database" radio button is selected and that the desired database is listed in both the "Restore as database" and the "Show backups of database" drop-down lists.

5
Select a backup set to restore from the "First backup to restore" and then mark the check boxes up to the date and time you want to restore to.

6
Click the "OK" button to start the restore process, and then click "OK" again once the process has completed.

by johan.mark25

Don't worry SQL Repair Software was specially designed to recover such types of database corrupt file. I have also used this software and I god good result. this software support multiple MDF file recovery options and you can recover keys, triggers, indexes and stored procedures. this software is supported by all SQL Server versions. you can download and run free trial version visit - http://www.sqlrepair.org/

by cathrinegarcia24

Hi,
As SQL Server database is dominating the enterprise market as the most preferred database management system.But the issue arise that this application is not immune to corruption.Mostly these database get corrupted due to virus attack, power failure etc.
User can go for manual solutions :-
1. Run Hardware diagnose
2. Restore From Backup
3. Run DBCC CHECKDB command
But in most cases above mentioned fails as sometimes backup not maintained or a threat of losing data using DBCC CHECK command terrify the user .
So the best alternative is to use a third party tool for this and for your problem can visit http://www.sqlrecoverysoftware.net/blog/attach-sql-database.html this will provide you the necessary steps.
Thanks & Regards

by naresh.p1007

What I am of the opinion is :

.mdb and .ldb are two different file extensions
SQL and MS Access are two different entities. Thus, the way of handling solutions should be different.

Hope to get a proper solution for the original question.

This discussion is closed to new replies.