Sql-server – SQL Server 2008 R2 SP1 – Tempdb “Available free space” showing negative value

sql serversql-server-2008tempdb

Please help as this issue is driving me nuts…

Tempdb has four data files and one log file. They are all located on the same dedicated drive.

When I right click on tempdb in SQL Server Management Studio (SSMS) to view Properties –> General…I'm seeing "Size" as ~65000 MB with "Space Available" as ~64000 MB. However, when I try to shrink the files via the GUI, I see that the "currently allocated space" hasn't changed and is still showing the initial size.

This is also where the "Available free space" is shown as a negative number. The only workaround I have found so far is to restart SQL Server to flush out tempdb, but I can't keep on doing this.

Has anyone ever come across this and knows the root cause/permanent solution for it please?

Best Answer

Open Query Analyzer Run DBCC UPDATEUSAGE('tempdb') After it is done, check temdb value and it should show the true values.

Also, this might help you.

Also, check if there are any open transactions using dbcc opentran or sp_whoisactive (Adam Mechanic's SP)

This was a bug in SQL Server 2008 SP1 described here.

Out of curiosity, is it causing any performance problems ?