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
Exchange Database Size Limit Reached
Printers not showing up in 'Printers and Faxes'
Merging two arrays in Ruby
SQL COUNT statement using JOIN between TBLS
T-SQL for last date
looping frames
2 Exchange accounts on 1 Windows Mobile 5 phone (Motorola Q - Verizon)
VPN cannot be established outbound from workstations on our SBS 2003 network - Error 800. VPN outbound from our SBS Server is successful.
Need to restore from NTUSER Registry but cannot read because corrupted
A selected word is not overwritten in Word & Outlook