January 14, 2004 at 3:50 pm
I've got a detached SQL2K SP3a database that has both the MDF and LDF. However, the LDF is corrupted due to a disk failure.
Both sp_attach_db and sp_attach_single_file_db fail.
Any ideas how to reattach the MDF whilst ignoring/bypassing the LDF?
January 14, 2004 at 4:02 pm
Rick,
Just move the corrupt LDF file to another directory or rename it. The system will complain about the missing log file but will create a new one for you.
Almost forgot. I don't know if this works non-gui but will work via EM
Good Luck
Good Hunting!
AJ Ahrens
webmaster@kritter.net
January 16, 2004 at 8:11 am
Both of these work
January 16, 2004 at 8:13 am
Oops sorry - too fast with the Enter ! EXEC sp_attach_single_file_db @dbname = 'dbname', and in sql 200 you'll get an error like Device activation error. The physical file name 'f:\dbname _log.ldf' may be incorrect. but it works anyway
January 16, 2004 at 8:32 am
Unfortunately neither of these are working. I wish that they would...
January 16, 2004 at 8:59 am
Can you post the text of the error message when you try this ?
January 16, 2004 at 9:06 am
It looks like the other DBA has been messing around with the environment -- so it's now "game over".
Thanks for your help anyway.
January 16, 2004 at 9:23 am
If you can't attatch the MDF file because it is corrupt, can you find the latest backup and restore it? I am sure you have it backup every night.
mom
January 16, 2004 at 12:12 pm
A question... In SQL Server 7.0 also works? Only with attach?
January 16, 2004 at 4:42 pm
Yes EXEC sp_attach_single_file_db and sp_attach_db .Quite useful
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply