DBCC Shrinkfile

  • Hello everyone.

    Quick question , anyone able to give me an idea of how long this will take to run?

    dbcc shrinkfile (customer_data01, 25000). 8 processor server , W2k OS , SQL 2000 sp4

    Shrinking from 95Gb to 25Gb.

    Cheers all.

  • Most of your time will be spent in I-O, so your 8 processors will not get overworked.

    The time will depend on the I-O rate of your disk system, and how much data has to be moved.  If you are extremely lucky all of your 25GB will be in the first 25GB of your data file(s), so the shrink will take seconds.  If you are very unlucky all of your data will be in the last 25GB of your data file, so all of it will need to be rewritten.  A more typical scenario is that your data is more or less spread all over your data file, so about 14GB will need to be rewritten.

    I would allow between 2 to 4 hours for such a shrink to complete on my system, but yours may be different.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • We can't tell you. We don't know all the facts. Like, what else will be happening on the database? The more transactions occuring, the longer it will take.

    That said......I just ran it on my database. Data file had 93 GB of data and 48 GB of free space. It took 4.5 hours to shrink the file, using 95000.

    -SQLBill

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply