July 3, 2007 at 1:52 pm
I had a user perform a detach and reattach of a database in order to clear out a ldf that thought it was 62gb. It worked OK. The problem is that he had a problem about a week later and he performed the procedure, but this time when he tried to reattach the mdf, it comes up with
Server: Msg 1813, level 16, State 2, Line 1
Could not open new database 'db name'. CREATE DATABASE is aborted.
Device activation error. The physical file name dbname.ldf may be incorrect.
We had renamed to existing ldf to .old, so that sql would create a blank ldf when it attached the db. Is there something resident inside the mdf that thinks there is an ldf? If so, how would I find out what it thinks the ldf file name is?
July 3, 2007 at 4:57 pm
August 24, 2007 at 2:31 pm
.MDF as nothing do with .LDF as there are no data pages in LDF & .LDF is log files with LSN. when you try to attach DB see the physical file location of that .MDF
When you try to attach single MDF file using "sp_attach_single_file_db" this is going to automatically create LDF for you at the location of MDF. if LDF already exsit at the same location then attach will fail.
Also try to see if you have rename the LDF file correctly.
I hope this helps.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply