Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / July 2008

Tip: Looking for answers? Try searching our database.

mdf is not a primary database file (SQL Server 2005 Express)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rbfigueira - 30 Jun 2008 20:51 GMT
Hi,

I want to recover data from one database (*.mdf) file:

1- One app were using one sqlserver 2005 express database file.
2- I dont have any backup file from that database
3- The desktop disk stop working
4- One firm recover the disk and the files (MYDATABASE.mdf and
MYDATABASE_log.lbf).
5- I dont know but I think that both files are corrupt.

I have tried to attach that file using the SQL Management express.
Error:

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MYDATABASE.mdf is
not a primary database file. (Microsoft SQL Server, Error: 5171)

I have tried 3 party apps and some tips from friends BUT i dont have any
success!
There is any way to see if that file can be fix or if there are any data
(table) that can be recover ?

Thanks
Aaron Bertrand [SQL Server MVP] - 30 Jun 2008 21:02 GMT
Did you try sp_attach_single_file_db ?  If that doesn't work, are you going
to be more careful about actually taking backups in the future?  :-)

On 6/30/08 3:51 PM, in article
054ED919-5CCC-4B9A-82F5-506ACC5AE1A3@microsoft.com, "rbfigueira"

> Hi,
>
[quoted text clipped - 19 lines]
>
> Thanks
rbfigueira - 01 Jul 2008 10:14 GMT
Hi Aaron,

Not work!! Dam!!
I must recover that db! More tips ?
Thanks

> Did you try sp_attach_single_file_db ?  If that doesn't work, are you going
> to be more careful about actually taking backups in the future?  :-)
[quoted text clipped - 25 lines]
> >
> > Thanks
rbfigueira - 01 Jul 2008 10:47 GMT
I get this error:

Msg 824, Level 24, State 6, Line 1
SQL Server detected a logical consistency-based I/O error: torn page
(expected signature: 0xffffffff; actual signature: 0x815340c3). It occurred
during a read of page (0:0) in database ID 0 at offset 0000000000000000 in
file 'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\MYDATABASE.mdf'.  Additional messages in the SQL
Server error log or system event log may provide more detail. This is a
severe error condition that threatens database integrity and must be
corrected immediately. Complete a full database consistency check (DBCC
CHECKDB). This error can be caused by many factors; for more information, see
SQL Server Books Online

> Hi Aaron,
>
[quoted text clipped - 31 lines]
> > >
> > > Thanks
Tibor Karaszi - 01 Jul 2008 11:24 GMT
Page 0 is the file header page, and the file is the primary database file (the mdf file). You have a
problem with a "root" page for the "root" file for your database. I guess you can open a case with
MS support but I'd be extremely surprised if they can do anything about this one.

I guess you can create a new database with same filenames as this one, stop SQL Server, and "slide
in" these files instead of the newly created db files. Again, probably a waste of time, though.

There exist at least one type of recovery tool for SQL Server out there. I've never used it, I
should add...
http://www.officerecovery.com/mssql/

Signature

Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi

>I get this error:
>
[quoted text clipped - 45 lines]
>> > >
>> > > Thanks
rbfigueira - 01 Jul 2008 11:36 GMT
Hi Tibor,

I have tried all! Not work
Also several recover tools and not work!!

I think I have lost this database!!! DAM!
I give up!!

> Page 0 is the file header page, and the file is the primary database file (the mdf file). You have a
> problem with a "root" page for the "root" file for your database. I guess you can open a case with
[quoted text clipped - 56 lines]
> >> > >
> >> > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.