Search

Saturday, July 9, 2011

Move TempDB Data and Log file to some other location

Restart SQL Server with the command line parameter -T3608, and then run alter database commands to move the location of TempDB:

ALTER DATABASE TempDB MODIFY FILE  (name = tempdev, filename = 'D:\Data\tempdb.mdf')
GO

ALTER DATABASE TempDB MODIFY FILE (name = templog, filename = 'D:\Logs\templog.ldf')
GO

Restart SQL Server without -T3608, and TempDB should be created in the new location. 
The alternative is to not reconfigure SQL Server at all, but rename an existing disk to the missing drive letter, just to get SQL Server started.

No comments:

Post a Comment