August 12, 2008 at 9:51 am
Is there a T-SQL command/function that will allow you to input a list of .mdf, .ndf, and .ldf files and check their integrity, similar to the RESTORE VERIFYONLY that you can use to verify SQL backups?
I've had a couple of situations in the past few months where I tried to attach a DB, and the files I used to attach were corrupt enough it hangs on the attach, and won't let go until a server reboot. I'm trying to think of a way to verify that the files are in good shape before I attach them.
The Redneck DBA
August 12, 2008 at 10:02 am
have the backup verify the files at backup time. if storing on a backup on a network,
backup to local drive first then copy to network
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
August 12, 2008 at 10:07 am
Perry Whittle (8/12/2008)
have the backup verify the files at backup time. if storing on a backup on a network,backup to local drive first then copy to network
It's not backup files I want to verify, it's the actual .mdf, .ldf, .ndf files of a database.
The Redneck DBA
August 12, 2008 at 10:18 am
The question you are asking is similar to asking about database verification which means running DBCC CHECKDB command.
MJ
August 12, 2008 at 10:21 am
What syntax do you use to run that before it is attached?
The Redneck DBA
August 12, 2008 at 2:19 pm
Check out dbcc checkprimaryfile this is used by SQL before the attachment occurs, don't know what checks it does other than reading the .mdf but it's what SQL uses initial as part of the attachment process.
Andrew
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply