move tempdb log file to a new location

navajo26354
navajo26354 used Ask the Experts™
on
I need to move the log file for tempdb.  The datafile can stay where it is.  Is there a way to move just the log file to a new location without restarting SQL?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Scott PletcherSenior DBA
Most Valuable Expert 2018
Top Expert 2014

Commented:
Maybe.

You can add another log file.  Then when SQL starts using it as the main log file, you can remove the original log file.

Tricky part is getting SQL to use the other log file, esp. on tempdb.

AFTER adding the new log file, you could try shrinking the existing log file in tempdb, but I'm not 100% sure that's 100% safe -- that is, it might cause something running to fail (maybe).
Commented:
Nope. A restart is a must for tempdb to use moved files. Else it will keep on using the same one.
Scott PletcherSenior DBA
Most Valuable Expert 2018
Top Expert 2014

Commented:
??

Log files will roll over if you have more than one.  And you can remove unused log files.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial