UPDATE: Please ignore this one. The shrink finally finished and now I have a different problem. The data file is still 22GB but the shrink dialogue reckons it has -495% free space. I can feel a service restart coming on!
We had some problems overnight and my tempdb data file went up to 22GB. It's usually about 250MB. It was only using about 170MB so I used the GUI to shrink it back to 250MB. It's been stuck on 'Executing' for hours now. Yikes!
Activity Monitor shows it's suspended with a wait type of SLEEP_LOCK which seems to mean 'no specific reason'. No blocking or blocked by SPIDs. The actual SQL is dbcc shrinkfile (N'database-name', 250)
. sys.dm_exec_requests says it's just over 1% complete. It looks like it might be getting little slices of work from SQL because it has a last_wait_type of SLEEP_TASK and the wait_time is about 20% of the wait time in the Activity Monitor.
Could it be stuck because we're using read committed snapshot in our user databases and it can't clear something because a row version is still in use?
It's not causing any noticeable problems on the server.
Any ideas, please? Can I just kill the SPID?