SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Space did not gets released after removing data


Space did not gets released after removing data

Author
Message
SQLAli
SQLAli
SSC-Enthusiastic
SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)

Group: General Forum Members
Points: 175 Visits: 270
Hi,
We have deleted 120GB of data but space did not released even after 2 days. Is there any reason for this? Could any one tell me how exactly it releases the space after truncating a 120GB table?
Thanks.

Thanks,
I’m nobody but still I’m somebody to someone………….
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86580 Visits: 41098
SQLAli (11/21/2013)
Hi,
We have deleted 120GB of data but space did not released even after 2 days. Is there any reason for this? Could any one tell me how exactly it releases the space after truncating a 120GB table?
Thanks.


Space is not deleted from the database after deletes or truncates. It simply becomes unallocated space in the database. Do you have enough room on disk without recovering this space as truly "free space"?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
pietlinden
pietlinden
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4916 Visits: 13173
If you absolutely have to get the disk space free, then you can use SHRINKDATABASE or SHRINKFILE, but it does awful things to your databases. You have to reindex them all etc... not pretty. So only do it if you have to. Definitely read up on it in BOL before doing anything drastic like that.
SQLAli
SQLAli
SSC-Enthusiastic
SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)

Group: General Forum Members
Points: 175 Visits: 270
Pietlinden,
Yes, we shrunk the .mdf and alert moves to Warning from centreon. But i think it is not right resolution.

Jeff,
I understand that space will simply unallocated rather than releasing. But disk got only 9GB free space. I need at least 50 GB of free space.

Thanks,
I’m nobody but still I’m somebody to someone………….
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87733 Visits: 45272
SQLAli (11/21/2013)
Pietlinden,
Yes, we shrunk the .mdf and alert moves to Warning from centreon. But i think it is not right resolution.


If you really do want to release space back to the OS, it's the *only* resolution.

I understand that space will simply unallocated rather than releasing. But disk got only 9GB free space. I need at least 50 GB of free space.


Why? What good does 50GB do sitting unallocated and unused on a disk do? You might as well make the disk 50GB smaller.

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


Steve Jones
Steve Jones
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: Administrators
Points: 62935 Visits: 19111
I'm with Gail on this. If you need the space, then shrink the files, but make sure that you leave space to reindex or perform maintenance.

If you just want xxx space to prevent alarms, you should really evaluate whether you need more space on the drive. If it's for backups, please, please don't store these on the disk with the mdf.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
suneel kamavaram
suneel kamavaram
Say Hey Kid
Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)Say Hey Kid (697 reputation)

Group: General Forum Members
Points: 697 Visits: 614
Did you try rebuilding table including all the indexes? That would release space to database, then shinking file would relase space at OS.
SQLAli
SQLAli
SSC-Enthusiastic
SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)SSC-Enthusiastic (175 reputation)

Group: General Forum Members
Points: 175 Visits: 270
Suneel,
No i did not try to rebuild the indexes. As i explained before i just shrunk the .mdf and space gets released.

Thanks,
I’m nobody but still I’m somebody to someone………….
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86580 Visits: 41098
SQLAli (12/16/2013)
Suneel,
No i did not try to rebuild the indexes. As i explained before i just shrunk the .mdf and space gets released.


You're pretty well screwed then because, except for simple truncation during a shrink, shrink fragments nearly everything to 99% fragmented. You at least need to follow a shrink with a REORGANIZE (although that will only fix the Leaf Level of the indexes and data). Since REORGANIZE doesn't update stats, you should update the stats, as well.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
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