What does DBCC SHRINKFILE do?

230    Asked by ColemanGarvin in SQL Server , Asked on Mar 17, 2023

 I have a database which is 11TB in size. I recently truncated over 5TB of data from this database.


(I am fully familiar with all the reasons why you would not normally shrink a database please)


I'm curious about what the DBCC SHRINKFILE command is actually doing because when I run the command to shrink a file which is about 650000 MB in size with 45% free space it doesn't seem to actually move any pages around.


The code in question is:


USE [CAF] 
GO 
DBCC SHRINKFILE (N'FILENAME' , 650239) 
GO
When I monitor the performance metrics of the server on executing DBCC SHRINKFILE I see the following
Answered by Claudine Tippins

Your Answer

Interviews

Parent Categories