On the weekend we had a huge deployment run that affected a large chunk of our system. It was all run in one massive transaction (probably the wrong thing to do). As a result our TempDB DatabaseFile has grown from ~5GB to ~30GB.
This is causing some space issues on the drive that it is located on. The server is Windows 2003 and we are running SQL 2005.
This was a one off event and so we don't want the TempDB file to stay that large. I have tried running
DBCC SHRINKDATABASE and
DBCC SHRINKFILE commands however it says:
Page 1:571344 could not be moved because it is a work table page.
I saw this question TempDB data files don't shrink well on SQL 2008 and was wondering if I need to free all system cache before I can shrink the database down. Obviously I don't want to do that on a live database if I can help it.
Is there any other way that I can shrink TempDB's MDF file?