Microsoft
Software
Hardware
Network
Question : SQL Server 2005 ShrinkFile never finishes
I am having a problem shrinking files on a database. My db has 4 data files and is a moderatly active system. I cannot take it down for any period of time.
The 4 data files have grown to about 58-60 GBs. We did maintenance and archiving and I need to shrink them back to around 40 GBs. When I run shrinkfile it gets about 50% complete then hangs, I am checking it in sys.dm_exec_requests and I can see it flounder on wait_resources endlessly.
I just assumed i was trying to go from a too large amount. I have tried ever decreasing sizes, and now I am at 5 MBs and it will not complete (I haven't gotten a single file to shrink by even 1 MB). Trying to shrink by 5mb, it hangs at 99.998% complete for hours. I have tried issuing checkpoints before and after and even durning.
Here is one example.
File size is 58507 and the file is 50% full
I am running DBCC SHRINKFILE (Filename,58505);
This command has been running while I type this for over an hour.
What am I doing wrong? Any advice would be greatly appreciated.
Answer : SQL Server 2005 ShrinkFile never finishes
Ah, you've split it. OK, then this is going to take a LONG time. As I said, I have a 100GB database on a very powerful server (look at the specs for a Dell 6950) and it takes hours to shrink a 100GB database.
Random Solutions
Birthday reminders
Event ID 1173 MSExchangeIS Mailbox Error 0x6bb deleting unused restricted view from folder
Adobe Acrobat freezes when opening documents with tickmarks
How do I store and add values from a repeating section in Infopath?
Excel Time Sheet
How to create a pivot table in SQL Server 2005
Sorting string field in Natural order
Wesite dropped off Yahoo?
Sending HTML email with outlook 2003
How to export autotext entries from Word 2003 and Import them back into a new computer with Word 2003