September 1, 2004 at 10:44 am
Hi everyone, I am running a shrinkfile on a datafile that is 107GB and 56GB is used. It has been running for over 24 hours. Is there any way of finding out at what stage the shrink is?
Another question, does shrinkfile generate log entries?
Thanks in advance for your help.
September 1, 2004 at 10:52 am
I do not believe that info messages are sent with this command. I tend to issue the shrink in small chunks in case I need to cancel it.
September 2, 2004 at 1:39 am
September 2, 2004 at 1:57 am
DBCC SHRINKDATABASE does not show it's progress, and how quick it will go depends on how much data needs to be moved, the speed of your server, and whatelse it's currently doing.
The option TRUNCATE_ONLY removes the empty pages from the end of the file, but if you have a single bit of data somewhere out near the end of the file, then the file wont shrink like you expect.
Without the TRUNCATE_ONLY option, SQL Server is defragging the file as well: moving all the data pages to the front of the file, before removing the empty pages from the end of the file.
If you have your large database split into multiple files, you can use the DBCC SHRINKFILE command to shrink one file at a time. This reduces the length of each individual shrink.
Julian Kuiters
juliankuiters.id.au
September 2, 2004 at 10:44 am
There is a way to find out how much time approximately takes the shrink.
Go to profiler>On Select the performance object> select - SQL Server Databases.
On SelectCounter from list > Select -ShrinkDataMovementBytes?sec and select the instance name for which you are running the shrink. Calculate this with your database size and you will get a rough estimate.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply