question

stoney avatar image
stoney asked

how can I move msdb ldf without restarting sql server

Want to moved the ldf to a different drive but don't want to restart sql server. Is there a way to move it without having to restart sql instance.

sql server 2012sql server 2014
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Kev Riley avatar image
Kev Riley answered

You can move files by detach/attach method and this does not need the SQL instance to be restarted. Obviously the database that you are moving will be unavailable during the operation, but that's unavoidable.

https://docs.microsoft.com/en-us/sql/relational-databases/databases/move-a-database-using-detach-and-attach-transact-sql

3 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks for the quick reply,

But unfortunately I understand you can’t use detach/attach with MSDB

0 Likes 0 ·

Sorry I read the question, and not the title. Hadn't realised it was MSDB.

0 Likes 0 ·

I'm not aware of any method that doesn't involve restarting the services, with it being a system database, it has 'special' qualities

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.