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.
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
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?
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.
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?
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:
ASKER
Thanks. I have tried this, but it did not work.
I'll try it again!
I'll try it again!
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks. I'll give it a try later when I have less users on the system.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
And I agree, if there are actively working users in the TempDB then the size update may be more complicated task...
ASKER
OK. I'm going to restart my server completely this evening.