x

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

more ▼

asked Jan 20, 2010 at 02:37 AM in Default

Santhosh_y gravatar image

Santhosh_y
1 1 1 1

(comments are locked)
10|1200 characters needed characters left

4 answers: sort voted first

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.

more ▼

answered Jan 20, 2010 at 03:50 AM

Rob Farley gravatar image

Rob Farley
5.7k 15 18 20

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?
Jan 20, 2010 at 05:35 AM Fatherjack ♦♦

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
Jan 20, 2010 at 06:02 AM sp_lock

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
Jan 20, 2010 at 06:18 AM Santhosh_y
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.....)
Jan 20, 2010 at 06:38 AM Kev Riley ♦♦
(comments are locked)
10|1200 characters needed characters left

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

more ▼

answered Jan 20, 2010 at 10:11 AM

Henrik Staun Poulsen gravatar image

Henrik Staun Poulsen
579 13 15 16

(comments are locked)
10|1200 characters needed characters left

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.

more ▼

answered Jan 20, 2010 at 10:40 AM

TimothyAWiseman gravatar image

TimothyAWiseman
15.5k 20 23 32

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x1947
x241
x126
x19

asked: Jan 20, 2010 at 02:37 AM

Seen: 3460 times

Last Updated: Jan 20, 2010 at 02:37 AM