Hello @Babawale Dawodu ,
What the error message that you got when you shrink tempdb?
By default, the tempdb database is configured to autogrow as needed. Therefore, this database may unexpectedly grow in time to a size larger than the desired size. Larger tempdb database sizes won't adversely affect the performance of SQL Server. When SQL Server starts, tempdb is re-created by using a copy of the model database, and tempdb is reset to its last configured size.
You can use below command to shrink tempdb. However, please note that DROPCLEANBUFFERS will remove all the procedure cache, which may slow down some systems right after as they have to rebuild all the procedure cache again. Again, shrink your TempDB ONLY if you are running out of the space or in crucial situations.
CHECKPOINT
GO
DBCC FREEPROCCACHE
GO
DBCC SHRINKFILE (TEMPDEV, 1024)
GO
Or DBCC DROPCLEANBUFFERS: Clears out cached indexes and data pages.
DBCC DROPCLEANBUFFERS WITH NO_INFOMSGS;
GO
We can use DBCC SHRINKDATABASE or DBCC SHRINKFILE to shrink tempdb, please refer to MS document Shrink the tempdb database to get detail information.
Best regards,
Cathy
If the answer is helpful, please click "Accept Answer" and kindly upvote it.