Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Unable to shrink Datafile Expand / Collapse
Author
Message
Posted Friday, September 14, 2012 6:24 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 7:45 AM
Points: 81, Visits: 933
I had a table which was 100 gb and whole database size was 150 GB.
I have archived that table to another server and dropped the table from the existing server and freed 100 GB space but i am unable to shrink my database as it is giving me the below error:-

File ID 1 of database ID 7 was skipped because the file does not have enough free space to reclaim.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.


sp_spaceused output is as follows::

database_name Database Size unallocated space
test 157449.31 MB 113945.80 MB

Post #1359750
Posted Sunday, September 16, 2012 8:17 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 17, 2014 1:48 PM
Points: 177, Visits: 464
Sometimes the file just won't go. Did you check the physical files to make sure that their sizes are as big as the statistics say?

DBCC updateusage

Are you using a TRUNCATE ONLY on the shrinkfile? Did you rebuild all the indexes so table data could be stored at the end of the file?

You are likely to get grilled by a lot of people about to ask why you need to shrink the file to begin with.
Post #1359884
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse