TEMPDB now at 4 GB

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Deaconess

    TEMPDB now at 4 GB

    I have shut down the SQL agent, rebooted the box and still my TEMPDB
    is at 4 GB plus. Is there any way to shrink it another way?
  • Erland Sommarskog

    #2
    Re: TEMPDB now at 4 GB

    Deaconess (steve.archer@d eaconessokc.org ) writes:[color=blue]
    > I have shut down the SQL agent, rebooted the box and still my TEMPDB
    > is at 4 GB plus. Is there any way to shrink it another way?[/color]

    Did you try DBCC SHRINKFILE?


    --
    Erland Sommarskog, SQL Server MVP, sommar@algonet. se

    Books Online for SQL Server SP3 at
    SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

    Comment

    • Deaconess

      #3
      Re: TEMPDB now at 4 GB

      Will DBCC Shrinkfile need to run in single usermode or can I run it
      against TEMPdb with users online to other databases on the Sql Server

      Comment

      • Erland Sommarskog

        #4
        Re: TEMPDB now at 4 GB

        Deaconess (steve.archer@d eaconessokc.org ) writes:[color=blue]
        > Will DBCC Shrinkfile need to run in single usermode or can I run it
        > against TEMPdb with users online to other databases on the Sql Server[/color]

        Did you check Books Online? It says:

        The database being shrunk does not have to be in single-user mode; other
        users can be working in the database when the file is shrunk. You do not
        have to run SQL Server in single-user mode to shrink the system
        databases.

        What does not spell out equally clear is that Books Online is that
        DBCC SHRINKFILE can take a lot of time, because it moves things
        around, to compact the database. I suppose this can incur some load.

        But there is a remedy for this, the TRUNCATE_ONLY option. On a tempdb
        that swollen up because of a occasional extreme query, this is likely
        to have good effect.

        You should probably try to figure out what you think is a good size
        for your tempdb. If that is, say 100 MB, and you shrink it all the
        way down to 10 MB, you will face autoloads that takes load on the
        machine.

        If your tempdb after shrinking, again swells up to 4GB, you need to
        investigate what might be causing this.



        --
        Erland Sommarskog, SQL Server MVP, sommar@algonet. se

        Books Online for SQL Server SP3 at
        SQL Server 2025 redefines what's possible for enterprise data. With developer-first features and integration with analytics and AI models, SQL Server 2025 accelerates AI innovation using the data you already have.

        Comment

        Working...