Shrink TEMP DB

Hi folks,

we had a curious issue. The TEMP DB database of the SQL Server 2008 has grown disproportionately and even after restarting the database and the SQL server itself don’t helps.

A colleague found this little script:

  1.  ALTER DATABASE tempdb MODIFY FILE
  2.  (NAME = ‘tempdev’, SIZE = target_size_in_MB)
  3.  –Desired target size for the data file
  4.   ALTER DATABASE tempdb MODIFY FILE
  5.   (NAME = ‘templog’, SIZE = target_size_in_MB)
  6.   –Desired target size for the log file
  7.   Restart SQL Service

And it works.

 

No comments yet.

Leave a Reply