December 1, 2009 at 5:36 am
I have a replicated database that has grown to 51Gb. I'm limited to 60Gb, so I need to do something to shrink this guy. I've deleted several thousand rows of data, but the File Manager is still showing 51Gb. Can I reclaim this space or is it ok as is?
December 1, 2009 at 6:48 am
doug turner (12/1/2009)
I have a replicated database that has grown to 51Gb. I'm limited to 60Gb, so I need to do something to shrink this guy. I've deleted several thousand rows of data, but the File Manager is still showing 51Gb. Can I reclaim this space or is it ok as is?
Hi,
Delete ll not reclaim the space .
QotD-->Reclaiming freed space [/url]
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/
December 1, 2009 at 6:53 am
How much of the 51gb is free space?
SQL server will hold the free space for re-use unless you shrink the file, if there is space avialable then SQL server will use this before growing the file
December 1, 2009 at 6:57 am
you will have freed up space within the database file so what you have done has helped and bought you time. As the previous poster said deleting data does not cause the database file size to decrease, extents within the database just become free.
You need to investigate whether extra data will be added over time which will cause the database to grow, if so extra disc space might be a necessity.
In the meantime check out the growth factor for the file and make sure it is something sensible (100 - 200MB).
If you still feel you need to shrink the database file check out DBCC SHRINKFILE in books Online. shrink it to your desired size in chunks not one go. This is not a task to run other than ad-hoc as it will fragment your data badly, so run a reindex afterwards.
---------------------------------------------------------------------
December 1, 2009 at 7:06 am
December 1, 2009 at 7:32 am
Running sp_spaceused shows:
Reserved Data Index Size unused
51204224 KB22733928 KB28460576 KB9720 KB
December 1, 2009 at 7:39 am
So there's only 9 MB free in a 51 GB database. Definitely not worth a shrink.
If you rebuild all the indexes on the table that you deleted rows from, does the unused space increase?
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
December 1, 2009 at 7:44 am
I'm more of an Oracle person than SQL Server. How do I reindex?
December 1, 2009 at 7:53 am
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
December 1, 2009 at 8:13 am
having read up on it there are scripts for it on this site and also in BOL under sys.dm_db_index_physical_stats.
Another quick way is to use the reindex maintenance plan task via SSMS.
---------------------------------------------------------------------
December 1, 2009 at 8:20 am
doug turner (12/1/2009)
I'm more of an Oracle person than SQL Server. How do I reindex?
Hi
Read the 1'st link added in my Signature.
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/
December 1, 2009 at 8:29 am
Thanks. The indexing helped a little. I'm up to 1.6Gb free now. It looks like some major table cleanup is in order to really free up some space.
December 1, 2009 at 8:35 am
doug turner (12/1/2009)
Thanks. The indexing helped a little. I'm up to 1.6Gb free now. It looks like some major table cleanup is in order to really free up some space.
1.6 GB free space is approx 3% of your DB size, which would still cause the problem in near future.
Yes, you need to either perform a clean up of unwanted data or get additional storage space.
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
December 1, 2009 at 8:39 am
doug turner (12/1/2009)
Thanks. The indexing helped a little. I'm up to 1.6Gb free now. It looks like some major table cleanup is in order to really free up some space.
Please schedule the Rebuild index job weekly
INDEX DEFRAGMENTATION[/url]
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply