Avatar of Richard Lloyd
Richard Lloyd

asked on 

I cannot shrink my MSSQL TempDB

I have a MSSQL instance (14.0.1000.169) that has various databases.

My tempdb seems to have grown to 50GB and I and trying to shrink the size as it is taking too much disk space. 99% of the allocated space is free, see screenshot.User generated image
I have tried using Management Studio to shrink the files and the database, I have restarted the MSSQL service and have performed a hardware reboot of the server. Nothing seem to reduce the file sizes.

When I try
DBCC SHRINKDATABASE(tempdb, 10);

I get the following:
DBCC SHRINKDATABASE: File ID 1 of database ID 2 was skipped because the file does not have enough free space to reclaim.
DBCC SHRINKDATABASE: File ID 3 of database ID 2 was skipped because the file does not have enough free space to reclaim.
DBCC SHRINKDATABASE: File ID 2 of database ID 2 was skipped because the file does not have enough free space to reclaim.

Can anyone suggest a another way to reduce the amount od space the temdb is taking up?


Microsoft SQL Server

Avatar of undefined
Last Comment
Richard Lloyd
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

If TempDB grew to 50GB then it means this space was necessary in the past. The TempDB returns into the initial size after SQL Server service restart. You may set the initial size in TempDB properties:
User generated image
Avatar of Richard Lloyd
Richard Lloyd

ASKER

Thanks. I have tried this, but it did not work.

I'll try it again!
SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Richard Lloyd
Richard Lloyd

ASKER

Thanks. I'll give it a try later when I have less users on the system.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

And I agree, if there are actively working users in the TempDB then the size update may be more complicated task...
Avatar of Richard Lloyd
Richard Lloyd

ASKER

OK. I'm going to restart my server completely this evening.
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo