Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4689

.mdf file gives error not a primary database file while attaching

$
0
0

Hi All,

  I am facing a error while attaching a .mdf file to DB. I am getting an error .mdf is not a primary database file.

When i try to attach using sp_attach_db i get the below error. Is there anyway to recover the file?

exec sp_attach_db 'SPDEV_Content_Portal1','R:\Program Files\Microsoft SQL Server\MSSQL11.ODDEV\MSSQL\Data Encrypt\SPDEV_Content_Portal.mdf',
'T:\Program Files\Microsoft SQL Server\MSSQL12.ONEDATADEV\MSSQL\DATA','T:\Program Files\Microsoft SQL Server\MSSQL12.ONEDATADEV\MSSQL\DATA\SPDEV_Content_Portal_log.ldf'


Msg 824, Level 24, State 6, Line 1

SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x7cb3089c; actual: 0xa4f23959). It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'R:\Program Files\Microsoft SQL Server\MSSQL11.ODDEV\MSSQL\Data Encrypt\SPDEV_Content_Portal.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.

Regards

Rajesh



Rajesh Kumar


Viewing all articles
Browse latest Browse all 4689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>