Shrinking Tempdb

  • We've got a problem with Microsoft's SMS on SQL Server 7 whereby it runs a monthly update that does lots of work with temp tables. We already set the temp db size to be about 400Mb over 4 files but we still find it filling up all the additional space on the server (mostly in the transaction log). Is it valid to run a SHRINKDB command on tempdb at regular intervals or would you think it would cause more problems than it solved?

  • An easy way to 'shrink' the tempdb is to stop and restart the services when you are done with all your transactions. This will cause tempdb to be rebuilt based on the model database.

    -SQLBill

  • Hmm. Could do but I don't think I'll be allowed to take this server down as its got some other apps running on it 24/7.

  • It seems safer to me to issue SHRINKFILE against tempdbs log file and to leave the data files alone.

  • quote:


    we still find it filling up all the additional space on the server (mostly in the transaction log).


    Make sure database recovery mode is set to 'trunacte log at checkpoint'.

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

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