Click here to monitor SSC
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 (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)

Group: General Forum Members
Points: 123 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-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45002 Visits: 39880
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.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
pietlinden
pietlinden
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2178 Visits: 12498
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 (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)

Group: General Forum Members
Points: 123 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-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: 47198 Visits: 44367
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-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36070 Visits: 18736
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
SSChasing Mays
SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)SSChasing Mays (651 reputation)

Group: General Forum Members
Points: 651 Visits: 613
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 (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)SSC-Enthusiastic (123 reputation)

Group: General Forum Members
Points: 123 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-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45002 Visits: 39880
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.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

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