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

What will happen if the hard drive with the data file goes to zero space? Expand / Collapse
Author
Message
Posted Thursday, November 28, 2013 1:47 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 29, 2013 10:06 AM
Points: 1, Visits: 10
SQL Server 2008 R2

The drive with our main database file is almost out of disk space. We are getting new drives prepared but in the mean time I have a couple questions. I want to avoid a database shrink unless it is an absolute emergency. I've deleted hundreds of thousands of old unneeded records and this is increased the unallocated database space by quite a bit but it has of course not increased any free hard drive space.

Even with the unallocated space the free hard drive space is daily shrinking lower and lower. I had hoped SQL Server would use only unallocated space first before using any more new disk space but apparently it is not. So, will my database crash if the drive space runs out or will it use up the unallocated space at that point? Also, at what point should I bite the bullet and run the database shrink?
Post #1518401
Posted Thursday, November 28, 2013 9:55 PM
SSC-Enthusiastic

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

Group: General Forum Members
Last Login: Thursday, May 29, 2014 11:29 PM
Points: 147, Visits: 587
Hi,

dropping objects or deleting rows will not reclaim occupied space unless you explicitly run commands to reclaim space.

when your file group is full and no more able to allocate additional space through auto growth or through manual process it stats throwing you error and will not make use of unused free space.

one solution may be to set a small autogrowth for the datafiles may be 1MB, that will not cause the disk to run out of space in single growth.
last solution would be to shrink you data files to release space to OS, but shrink operation creates massive index fragmentation.




Praveen D'sa
MCITP - Database Administrator 2008
http://sqlerrors.wordpress.com
Post #1518437
Posted Thursday, November 28, 2013 10:30 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:06 AM
Points: 42,315, Visits: 35,369
ryan.costello (11/28/2013)
I've deleted hundreds of thousands of old unneeded records and this is increased the unallocated database space by quite a bit but it has of course not increased any free hard drive space.


No, that will only increase the free space in the file

I had hoped SQL Server would use only unallocated space first before using any more new disk space but apparently it is not.


It will do that. It could be that the free space you created is free space on allocated pages, not empty, unallocated pages. SQL can't use free space on a page belonging to tableX for tableY. You probably need to rebuild indexes to see that free space made available to the rest of the DB.

Don't shrink, you want free space in your database to let SQL reuse that free space. That's not what shrink does.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1518439
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse