Run DBCC SHRINKFILE

Vijay Kumar 1,846 Reputation points
2021-04-29T00:07:20.007+00:00

DBCC SHRINKFILE (N'ABCD_AppData01' , EMPTYFILE)

This file size is around 1.2 TB.

This file is in PROD, As part of maintenance we need to empty this file. Before this we testing in QA whic configuration is identical to PROD (40 Vcpu)
But i ran for 3 hours but only ocmpleted 3%

Is there any way we can speedup or any alternative to EMPTY 1.2 TB file?

This is SQL Server 2016 ENT

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
8,502 questions
{count} votes

Accepted answer
  1. CathyJi-MSFT 20,661 Reputation points Microsoft Employee
    2021-04-29T03:23:02.61+00:00

    Hi @Vijay Kumar ,

    > Is there any way we can speedup or any alternative to EMPTY 1.2 TB file?

    No. DBCC SHRINKFILE with the EMPTYFILE parameter will move all data out of a specified file into other files in the same filegroup. Once this is complete, the empty file is essentially marked as read-only, preventing new data from being added. But we don't have control over how quickly the data moves.

    Refer to the blog to get more.


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.

    No comments

0 additional answers

Sort by: Most helpful