dbcc shrinkfile

  • Hi All,

    I've noticed this topic has popped up a few times in this forum. I have a 60GB database that is in simple recovery mode. The database started out with 17 GB free space and I have managed to trim 8 GB, one gig at a time. When I originally ran the shrinkfile command it ran all day before I decided to stop it. However one gig at a time was reasonably quick. Now I'm at a point where the shrinkfile command is only taking 250 MB at a time?

    Does anyone have any clues as to why this might be occuring?

     

    Regards,

    Terry

  • This was removed by the editor as SPAM

  • hi ,

     

    in simple recovery mode u cant shrink the file it should be in full or bulk mode.

    Secondly before u run the shrinkfile command run backup log command.

    before u do this stop and restart ur sql services.

    from

    Killer

  • Since the db is in simple mode that should keep transaction log files size in check..

    If u see lot of free space in the data files and uneed to release the space to OS then u can use the truncateonly option with shrinkfile command. More Info BOL..

    I would recommend to see the fragmentation of the objects in the databas and Avg. Page density  and Avg. Bytes free per page that should answer ur question..

    And based on the scan density and logical scan fragmentation you can defrag or rebuild the table...

     

    Thx,

    Krishnan Kaniappan

     

     

    -Krishnan

  • Defragging the tables and indexes in the database only increased the amount of unused space in the database. Switching to full recovery mode didn't make a difference. Truncateonly and notruncate options had no effect.

     

    Regards,

    Terry

Viewing 5 posts - 1 through 4 (of 4 total)

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