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


Need to maintain the databases


Need to maintain the databases

Author
Message
bubby
bubby
SSC Veteran
SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)

Group: General Forum Members
Points: 254 Visits: 357
I have a database in a simple mode as we do not use transaction logs for restore purposes, I ran some queries to delete some data and not nsed tables to free up some space.
I give you an example, I have a database 70 GB in size, I deleted the data and I still see my database is showing the same size, can I shrink the data files,

what is the risk please? Can I get the best way to go around to get the space freed up,

Thanks in Advance,

Bubby
Vegard Hagen
Vegard Hagen
Mr or Mrs. 500
Mr or Mrs. 500 (519 reputation)Mr or Mrs. 500 (519 reputation)Mr or Mrs. 500 (519 reputation)Mr or Mrs. 500 (519 reputation)Mr or Mrs. 500 (519 reputation)Mr or Mrs. 500 (519 reputation)Mr or Mrs. 500 (519 reputation)Mr or Mrs. 500 (519 reputation)

Group: General Forum Members
Points: 519 Visits: 367
Deleting data will only free up space within the database, not actually deallocate any pages, hence your data files will remain exctly the same size after a delete (your log files may actually grow if you run large delete operations since they too have to be logged). If you are sure you will not need that space again in the foreseeable future, you may shrink the database to free up disk space, but be sure to rebuild indexes afterwards because shrinking tends to mess up the physical order of your data on the disk. Also, don't shrink it just to shrink it. You should only do this if you know you're not going to need that space again for this DB and/or the space is urgently needed for other purposes.

The main risk is that shrinking databases that only have to grow again shortly afterwards wastes both time and resources and actually harms performance.



Vegard Hagen
Norwegian DBA, blogger and generally a nice guy who believes the world is big enough for all of us.

@vegard_hagen on Twitter
Blog: Vegard's corner (No actual SQL stuff here - haven't found my niche yet. Maybe some day...)

"It is better to light a candle than to curse the darkness."
(Chinese proverb)


bubby
bubby
SSC Veteran
SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)SSC Veteran (254 reputation)

Group: General Forum Members
Points: 254 Visits: 357
Thanks a Lot, I will keep this in mind,
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