April 29, 2004 at 4:48 am
I've got a database that went suspect, due to a log file that's gone corrupt. I've got recent backup's, but they are a day old, and want to try and recover the database without a restore. I am not running a full recovery model.
I have detached the database, renamed the log file, and tried to attach it with 'sp_attach_single_file_db', with the following error message:
Could not open new database 'mydb'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'c:\log\mydb_log.ldf' may be incorrect.
Now 'c:\log\mydb_log.ldf', is the previous log path and file name. There is plenty of disk space, and I am logged in as an administrator.
Does anyone know of another way to create a new logfile?
Robert
April 29, 2004 at 10:28 am
Have you tried using the "WITH MOVE" option to set the log file to a different name?
April 29, 2004 at 11:09 am
Hi,
I am currently using attaching the database with the single file method ('sp_attach_single_file_db'). Does the "WITH MOVE" work with this stored proc? I can't get the syntax right
Thanks for your reply.
Robert
May 2, 2004 at 7:45 pm
I expect you have detached the database.
From a theoretical point of view, it appears that SQL server is trying to create a new log file on top of the old one. Therefore try to rename the log file to something_log.old and then attach using sp_attach_single_file_db.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply