How to move tempdb

As a DBA sometimes we have to move our tempdb to other drive due to I/O or space issue.

Here we will look into how to move tempdb
Since tempdb is recreated every time we start server we dont have to move files physically.



Get name of files for tempdb database.

SELECT name, physical_name
FROM sys.master_files
WHERE database_id = DB_ID('tempdb');
GO


USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = , FILENAME = );

Now when we will restart server again at that time tempdb will be created at new location.

No comments:

Post a Comment

Amazon Contextual Product Ads

Popular Posts