Temp db files showing different size

SVA 121 Reputation points
2022-09-05T09:21:48.137+00:00

Hi

TempDB file size showing different in disk and database.

In disk tempdev showing the size as 31.2 GB but in tempdb database it is showing 16384.00 MB.

file name is tempdb.mdf

Tried to shrink but not shrinking.

SQL Server | Other
{count} votes

4 answers

Sort by: Most helpful
  1. Noel Kipyegon 1 Reputation point
    2022-09-05T12:17:29.007+00:00

    Change the Database Recovery Model to "Simple" under option and Shrink the "temp" data file once more.

    Once done, return the Recovery Model option to "Full".

    237806-image.png


  2. Olaf Helper 47,586 Reputation points
    2022-09-05T14:01:41.487+00:00

    but in tempdb database it is showing 16384.00 MB.

    Where is that value shown?

    0 comments No comments

  3. Bjoern Peters 8,921 Reputation points
    2022-09-05T15:04:27.967+00:00

    Hi @SVA ,

    as @Olaf Helper stated :

    It would be nice to see some screenshot of your SSMS and your Filesystem to better understand what you see in which location.

    0 comments No comments

  4. PandaPan-MSFT 1,931 Reputation points
    2022-09-06T01:47:46.367+00:00

    Hi @SVA ,
    Actually, If you restart the SQL Server, tempdb will rebuild automatically. If you can't restart the SQL Server for some reasons. You may try the following order,which i'm not sure if you had tried already...
    USE [tempdb]
    GO

    DBCC FREESYSTEMCACHE ('ALL')

    GO
    238012-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment"


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.