Search

Showing posts with label Move TempDB. Show all posts
Showing posts with label Move TempDB. Show all posts

Wednesday, June 22, 2011

How to Move TempDB

Determine the current location of the MDF and LDF files.
Run the ALTER DATABASE command to move the files


USE master;
GO
ALTER DATABASE tempdb 
MODIFY FILE (NAME = tempdev, FILENAME = 'E:\SQLData\tempdb.mdf');
GO
ALTER DATABASE tempdb 
MODIFY FILE (NAME = templog, FILENAME = 'F:\SQLLog\templog.ldf');
GO


Stop and restart the SQL Server instance
Delete the old MDF and LDF files