Temp database size

  • HI. I just noticed my temp database has grown to a very large size from the norm. Can I shrink this without causing a problem? If I can shrink, how can I be assured that noone is working with that temp database?

    Juanita

     

  • Sure you can shrink tempdb.  You can use either the dbcc shrinkdatabase or the dbcc shrinkfile commands.  If this is a production instance, I would be careful about shrinking tempdb since in most cases it reaches a kind of equilibrium and if you shrink it down, it is highly likely that it will just grow again, but there is overhead in allocating new space on the fly...

    As for existing users, the shrink operations are online so they won't affect space that is currently being used.  Consequently, it is possible that these operations will not free up quite as much space as you think they should.  This is particlularly true of the transaction log file.  Read the details in Books Online.

    /*****************

    If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek

    *****************/

  • You can't be assured that no one is working in temp as ORDER BY, GROUP BY, etc. all use tempdb.

    Use the shrink files from EM (database, right click, all tasks, etc).

  • Thanks so much for the answers !!!

    Juanita

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply