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

Need to maintain the databases Expand / Collapse
Author
Message
Posted Friday, April 26, 2013 6:43 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 10:56 AM
Points: 242, Visits: 322
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
Post #1446932
Posted Friday, April 26, 2013 7:00 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Friday, April 11, 2014 6:50 AM
Points: 517, Visits: 346
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)

Post #1446945
Posted Friday, April 26, 2013 7:15 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 10:56 AM
Points: 242, Visits: 322
Thanks a Lot, I will keep this in mind,
Post #1446972
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse