Link to home
Start Free TrialLog in
Avatar of Damian Gardner
Damian Gardner

asked on

Moved a SQL SERVER 2005 log file, causing the database to fail on startup

I have a 2005 SQL Server database running on Windows 2003 Server.  I wanted to separate the log file from the mdb file, and thought I could move it and repoint it.  When I wasn't able to access it afterwards, I put the log file back to it's original location, with the mdb file, but it still does not start now.  Does it need a Alter statement to kickstart it?  Any help is much appreciated.  Thanks
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

how exactly did you "move" the file?
did you stop sql server during that?
or did you use the sp_detach_db and sp_attach_db procedures ?
Avatar of Damian Gardner
Damian Gardner

ASKER

I stopped the entire SQL system, went to windows explorer to cut and paste the log file onto a different physical drive location, then started the SQL system back up.  I was expecteing to be able to change the properties on the DB to change the path of the file, but it's blocking me out now, and failing to start.  I moved the file back into place, but no luck.  
> I was expecteing to be able to change the properties on the DB to change the path of the file,
how do you expected sql server to "find" the new location of the db file?
note: the actual location is stored in the master db, except for the location of the master db itself.

now, which db file(s) did you move? the ones of master itself?

I really hope you did not do this on a production system... these things are to be tested first on a dummy system first....
This is a test USER database.  With the file back in place, can an ALTER stmt be issued to bring it online possibly?
I also have a backup of the database from Friday.
Well - I just issued an sp_attach_db command, reaffirming the location of the mdf and ldf files, and it's back online.  I think the step I missed was detaching the db first. Do you agree?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok - thanks for your help Angel.