Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 7-Jul-19 22:15pm

1 solution

 
Share this answer
 
Comments
paul_vin 8-Jul-19 5:50am    
how I can find what process is using that work table
OriginalGriff 8-Jul-19 5:58am    
Follow the link and start reading some of the answers - and follow the links there as well!
Maciej Los 8-Jul-19 14:16pm    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900