1 Answer
- Newest
- Most votes
- Most comments
1
Monitor the Growth:
After the instance restarts, monitor the growth of tempdb to ensure that it doesn't grow excessively again. You might need to review and optimize the queries and processes that are used.
and here is a complete T-SQL script to modify the tempdb file sizes:
USE master;
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = tempdev, SIZE = 4096MB);
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = temp2, SIZE = 4096MB);
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = temp3, SIZE = 4096MB);
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = temp4, SIZE = 4096MB);
GO
ALTER DATABASE tempdb
MODIFY FILE (NAME = templog, SIZE = 1024MB);
GO
answered 2 years ago
Thanks, I was trying to set the size another way and that was not working. This approach works.
Relevant content
- asked 3 years ago
- asked 3 years ago
- asked 4 years ago

By adjusting the initial sizes of the tempdb files and rebooting the instance, you should be able to reduce the size of tempdb and manage disk space usage more effectively. Regular monitoring and query optimization can help prevent tempdb from growing excessively in the future.