TEMPDB File size inconsistent file size

pdsqsql 431 Reputation points
2021-01-05T16:12:37.41+00:00

Hello,
I have Sql Server 2014 and i have added temp Db file as already we have two mdf and 1 ldf files.

I already resized file using following command but it still shows that inconsistent file size:

alter database tempdb modify file (name = tempdev1, size = 1024 MB, filegrowth = 128 MB)
GO

alter database tempdb modify file (name = tempdev2, size = 1024 MB, filegrowth = 128 MB)
GO

alter database tempdb modify file (name = tempdev, size = 1024 MB, filegrowth = 128 MB)
GO

alter database tempdb modify file (name = templog, size = 1024 MB, filegrowth = 128 MB)
go

But one of tool complaining that TEMPDB File size inconsistent file size.
When I checked, all the files it shows following:

Logical file Name Initial Size (MB) Auto Growth
TEMPDEV 6912 128 MB
TEMPDEV1 6784 128 MB
TEMPDEV2 6912 128 MB
TEMPLog 1024 128 MB

I tried few time but still shows inconsistent file size.
Is it I need to Restart the Service so it will reinitialize again the changes?

Thanks for your help!

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. pdsqsql 431 Reputation points
    2021-01-07T14:32:23.97+00:00

    Thank you Criszhan.
    I can see right now after restarting Service, it shows all same size.

    **DBNAME    LOGICAL_FILENAME    SIZE_MB**
    tempdb  tempdev                     1024
    tempdb  templog                     1024
    tempdb  tempdev1                 1024
    tempdb  tempdev2                 1024
    
    **name  Initial Size (MB)   Current Size (MB)   Used (MB)**
    tempdev         1024.000000 1024.000000         3.375000
    templog         1024.000000 1024.000000         21.375000
    tempdev1    1024.000000 1024.000000         1.187500
    tempdev2    1024.000000 1024.000000          1.375000
    
    1 person found this answer helpful.

5 additional answers

Sort by: Most helpful
  1. Shashank Singh 6,251 Reputation points
    2021-01-05T16:49:40.453+00:00

    I vaguely remember that you might need a SQL Server service restart to reflect this in SSMS GUI. Anyways what does below return

    SELECT DB_NAME(DATABASE_ID)DBNAME, [NAME] LOGICAL_FILENAME, *8/1024 SIZE_MB
    FROM SYS.MASTER_FILES
    WHERE DB_NAME(DATABASE_ID) = 'TEMPDB'
    

  2. Tom Phillips 17,771 Reputation points
    2021-01-05T16:54:17.903+00:00

    That is perfectly normal. Not all files grow at the same time.

    What do you think is wrong with the data you posted?


  3. Cris Zhan-MSFT 6,661 Reputation points
    2021-01-06T04:43:58.89+00:00

    Hi @pdsqsql ,

    >Is it I need to Restart the Service so it will reinitialize again the changes?

    Yes.
    According to my test, when using the statement - alter database tempdb modify file(...) to modify the size of specified database files, if the specified size is greater than the size of the current database files, then in the SSMS UI (Properties-Files) and the size of actual physical files can show changes.

    But if the specified size is smaller than the current file size, it will not be displayed in the SSMS UI, and the actual physical file will not change. Until the SQL Server service is restarted.

    You can always verify the current set size of the database files by running the following command:

    SELECT DB_NAME(DATABASE_ID)DBNAME, [NAME] LOGICAL_FILENAME, Size*8/1024 SIZE_MB
    FROM MASTER.SYS.MASTER_FILES
    WHERE DB_NAME(DATABASE_ID) = 'TEMPDB'


  4. pdsqsql 431 Reputation points
    2021-01-08T23:03:41.86+00:00

    Thanks everyone for your help!

    0 comments No comments

Your answer

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