Friday, November 4, 2011

Moving TempDB

The following script will allow you to move tempdb to a new location. After the script has run, a restart of the sql server services is required. You will probably want to delete the old files in their old locations after the move and restart.

USE master
GO
ALTER DATABASE tempdb
     MODIFY FILE (NAME = tempdev, FILENAME = 'T:\tempdb.mdf')
GO
ALTER DATABASE tempdb
     MODIFY FILE (NAME = templog, FILENAME = 'T:\templog.ldf')
GO

No comments:

Post a Comment