Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Database is corrupted....... plz help. Expand / Collapse
Author
Message
Posted Thursday, August 21, 2014 4:25 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 4:11 PM
Points: 1, Visits: 0
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...
Post #1606069
Posted Thursday, August 21, 2014 6:38 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 9:06 AM
Points: 20,858, Visits: 32,878
Not a lot of info from which to work. Your best bet is to use your latest backup to recover your database.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1606081
Posted Friday, August 22, 2014 5:57 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 8:22 AM
Points: 14,205, Visits: 28,534
Yep, go to your backups. That's the safest road to recovery here.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server Query Performance Tuning
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1606216
Posted Friday, August 22, 2014 6:59 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:36 AM
Points: 40,615, Visits: 37,080
shahtisaipur (8/21/2014)
the error is myfile.mdf is not a primary database file. (SQL server , error 5171)


With that error, restore from your last good backup. That error suggests that the file header page is damaged, that's not repairable and can't be worked around.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1606258
Posted Friday, August 22, 2014 7:28 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:27 AM
Points: 35,770, Visits: 32,437
If you don't actually have a good backup (shame on you), perhaps there's some hope. In no way, shape, or form is this an endorsement of any kind because I haven't actually used their software but check out the product at the following URL. For what they claim it does, it seems relatively inexpensive compared to losing the crown jewels of a company. Also remember that repairs of any kind might still not be as good as the original and you should be testing backups on a regular basis.
http://www.stellarinfo.com/sql-recovery.htm


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1606279
Posted Monday, September 8, 2014 7:00 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, October 29, 2014 2:23 AM
Points: 45, Visits: 54
The best option to recover SQL database is to restore from full backup. In case backup is not available then must go with entrusted tool.

SSMS Expert
Post #1611421
Posted Wednesday, December 3, 2014 7:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, December 3, 2014 7:04 AM
Points: 1, Visits: 0
I think this site can help you . Find here some info
https://social.msdn.microsoft.com/Forums/en-US/6562f8be-1916-491c-a69c-e8904c3b9251/sql-database-recovery-from-corrupt-database-file?forum=sqltools

Post #1641083
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse