Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


What will happen if the hard drive with the data file goes to zero space?


What will happen if the hard drive with the data file goes to zero space?

Author
Message
ryan.costello
ryan.costello
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 13
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?
PravB4u
PravB4u
SSC-Enthusiastic
SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)

Group: General Forum Members
Points: 147 Visits: 600
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
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47259 Visits: 44389
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, MVP, M.Sc (Comp Sci)
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search