We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

Medium Priority
272 Views
Last Modified: 2012-05-06
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
Comment
Watch Question

Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
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 ?
Damian GardnerIT Admin

Author

Commented:
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.  
Guy Hengel [angelIII / a3]Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009

Commented:
> 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....
Damian GardnerIT Admin

Author

Commented:
This is a test USER database.  With the file back in place, can an ALTER stmt be issued to bring it online possibly?
Damian GardnerIT Admin

Author

Commented:
I also have a backup of the database from Friday.
Damian GardnerIT Admin

Author

Commented:
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?
Billing Engineer
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2009
Commented:
yes. always properly detach the db.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Damian GardnerIT Admin

Author

Commented:
Ok - thanks for your help Angel.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.