I want to shrink temp db data files on server. I can not restart service.
a have following query to shrink temp db
USE [tempdb]
GO
DBCC SHRINKFILE (N'tempdev' , 1024)
GO
but It is not shrinking file gives following error
DBCC SHRINKFILE: Page 1:11226848 could not be moved because it is a work table page.
(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
What I have tried:
1)
USE [tempdb]
GO
DBCC FREESYSTEMCACHE ('ALL')
DBCC SHRINKFILE (N'tempdev' , 1024)
GO
-------------------------------------
2)
DBCC FREEPROCCACHE;
GO
DBCC SHRINKFILE (N'tempdev' , 1024)
GO
but in both cases It gives following error
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
DBCC SHRINKFILE: Page 1:11226848 could not be moved because it is a work table page.
(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.