question

Santhosh_y avatar image
Santhosh_y asked

How to read or validate database mdf file when sql server is not running or offline

I have detached one database from Sql server . I have database( .mdf and .ldf ) files with me. Now how can i read that database file. I want to validate that database is good or not. Means i want the similar to DBCC CHECKDB command to check the database with out attaching it to Sql server.

Is there any way or any FREE tool provided by microsoft .

Thanks in advance

sql-server-2005databaseadministrationcorruption
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rob Farley avatar image
Rob Farley answered

If you're only using an instance of SQL Server for DR purposes (and not using it for production at all), then it doesn't need to be licensed. So the free tool you can use is another copy of SQL Server itself.

But you might have been better off taking a backup and restoring that. If a restored database successfully passes DBCC CHECKDB, then the original one must be fine too.

4 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rob - hadnt heard about this ability to install SQL without a license if its only for DR, other than as a mirror server. What can you do - log shipping, backup/restore? Or is it only allowed to be a running server with no DBs online? Is there a Miscrosoft page to read about it?
0 Likes 0 ·
FatherJack.. Passive/Standby servers do not need licensing. Be sure to read the "Passive/Failure" section, as it include some restrictions with regards to how long the standby server can be Active. http://www.microsoft.com/sqlserver/2005/en/us/Special-Considerations.aspx
0 Likes 0 ·
Hi Rob, My requirement is like need to validate the database files without attaching to sqlserver. Before attaching it to sql server i need to check or validate is that database is in good state or any corruption happend. Microsoft is providing Eseutil.exe for Exchange to do Offline validation. Like that is there any tool for SQLServer provided by Microsoft. (Or ) any other method to do this check. thanks Santhosh
0 Likes 0 ·
Jonlee: that page states that a passive server requires licensing if 'queries are being run' - does DBCC constitute a query? (Hmm.. this may need taking off this question and asked elsewhere.....)
0 Likes 0 ·
Henrik Staun Poulsen avatar image
Henrik Staun Poulsen answered

A suggestion: Instead of de-taching it in the first place; do a backup of the database, and run RESTORE VERIFYONLY ... on the backup.

It does take up extra diskspace, but your database stays online all the time.

HIH

Henrik Staun Poulsen www.stovi.com

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

TimothyAWiseman avatar image
TimothyAWiseman answered

The best way is probably to bring it into a copy of SQL Server. If you need to verify it before it gets to a production machine, you can use a copy on test server. If it is smaller than 4 GB you can use SQL Server Express for free.

I am not aware of anything besides SQL Server that can do the equivalent of MDCC commands to a SQL Server file.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.