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


Faster way to release the Unused Space back to Disk


Faster way to release the Unused Space back to Disk

Author
Message
dan-572483
dan-572483
SSCrazy Eights
SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)

Group: General Forum Members
Points: 9093 Visits: 2026
This is the second time? If you shrink a database at all, it should be one-off job following a one-off large data deletion. If it grows "too large" again, then the DB needs extra space for its operations.

One thing to look at is if the autogrow settings are too large. If you have a 5GB DB set to grow 5GB at a time and it results in 48% free space, then you might want to shrink again (to a size that that includes a more reasonable amount of free space), then set the autogrowth smaller to a setting that allows for growth but makes growths unlikely to happen very often.
Mac1986
Mac1986
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3587 Visits: 791
I have done the things that you have suggested but still in the next ETL run, again the Datafile size is boosted up and used space by the file is way less.

Can you please suggest. What can be done now..
crazy4sql
crazy4sql
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10786 Visits: 4556
why dont you change your recovery model to "bulk logged" while your ETLs are scheduled?

----------
Ashish
GilaMonster
GilaMonster
SSC Guru
SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)

Group: General Forum Members
Points: 554446 Visits: 47746
Mac1986 (12/21/2012)
I have done the things that you have suggested but still in the next ETL run, again the Datafile size is boosted up and used space by the file is way less.

Can you please suggest. What can be done now..


If the space in the data file is used up and the file grows during ETL, then leave the data file alone, it needs to be the size it is.

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


GilaMonster
GilaMonster
SSC Guru
SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)SSC Guru (554K reputation)

Group: General Forum Members
Points: 554446 Visits: 47746
crazy4sql (12/21/2012)
why dont you change your recovery model to "bulk logged" while your ETLs are scheduled?


Not going to affect the size or usage of the data file in any way.

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


crazy4sql
crazy4sql
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10786 Visits: 4556

Not going to affect the size or usage of the data file in any way.


sorry for my Friday hangover, I thought the complain is about log file Smile

----------
Ashish
Mac1986
Mac1986
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3587 Visits: 791
I have 2 quick questions on Data file size usage behavior

1) I see that Indexes have heavy fragmentation levels: This effects the DML Performance for sure, but will this allow the data file size to grow extra than actual consumed space?

2) Will adding few indexes at appropriate places reduce the Data file to not pre capture so much disk space than actual consumed space.?
Bhuvnesh
Bhuvnesh
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32624 Visits: 4079
Mac1986 (1/2/2013)
1) I see that Indexes have heavy fragmentation levels: This effects the DML Performance for sure, but will this allow the data file size to grow extra than actual consumed space?

NO there is no 'extra' or 'actual consumed' kind of thing in index fragmentation level. framentation happens due to page split whch is dependent on fill factor.

Mac1986 (1/2/2013)
(2) Will adding few indexes at appropriate places reduce the Data file to not pre capture so much disk space than actual consumed space.?
NO. index addition always cost you space/disk and it helps you to retrieve the data faster but slow down your DML operation

for more details see this link http://blogs.msdn.com/b/pamitt/archive/2010/12/23/notes-sql-server-index-fragmentation-types-and-solutions.aspx

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
huishi.ca
huishi.ca
SSC-Enthusiastic
SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)

Group: General Forum Members
Points: 155 Visits: 453
I know it's an old thread. If you really want to shrink your datafile and release it back to disk, the fastest way would be create a new empty datafile in the same filegroup and empty
the existing one to the new datafile. The size of datafile should be equated to the size of would-be shrinked datafile. Once migrated, you can remove the old datafile.

This is the fastest way.. of course, shrinking data file is never recommended in many references.
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