I wonder if someone can clarify a couple of points for me:
When I test DBCC SHRINKDB against a snapshot of a production database, to get an accurate estimate of how long an outage I need to carve out to complete this operation, the following happens:
1. the DBCC SHRINKDATABASE seems to run forever (60h and not finished??)
2. having made the mistake of losing the session where this was running, I ran it again (yes, over top of the already running DBCC - oops) and it ran in 30 seconds, doing nothing to the size, and generating no errors. The earlier instance of DBCC continued to run without a hiccup.
3. While this first never-ending shrink is running, the database performance deteriorates by factor of 3, but seems eminently usable.
4. so following the advice of some listers here, I set the database to single user mode and re-ran. So far (5 hours), I see no change in device size and it's not done
Can anyone give me an expectation for how long it will take to shrink this database (or any database, for that matter, of a given size), and whether it can be accomplished while the database is in service?
Juan Cristián Vera
Database Architect
Ecast, Inc.
MS Sql Server LazyDBA home page