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


shrink data files


shrink data files

Author
Message
muth_51
muth_51
SSC Eights!
SSC Eights! (963 reputation)SSC Eights! (963 reputation)SSC Eights! (963 reputation)SSC Eights! (963 reputation)SSC Eights! (963 reputation)SSC Eights! (963 reputation)SSC Eights! (963 reputation)SSC Eights! (963 reputation)

Group: General Forum Members
Points: 963 Visits: 2906
we have deleted some rows and released around 500 GB of space from a table. We applied filters so that this table doesn't grow beyond 600 GB. The table grew to 1.2 TB size. Now we are planning to release the space to OS as that drive holds some other database files also. But the shrink file process is taking too long. Almost 10 hours to shrink 11 GB. That database have LOBs. I am planning to shrink just one data file which has almost 400 GB of free space. I planned to add new file to the existing file group and emptying the file and dropping the old one. But the file group already contains two files and if I add a new file and do the empty file operation, to which file the data will go. Is it the new one or old one? One of the file is set to restricted growth. I am not sure how this process works? Any suggestions on how to release the free space?
sql-lover
sql-lover
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1637 Visits: 1930
How busy that table or database is? If you have users continuously using that table and running queries all the time, it will affect the shrink process and slow it down. If you have a weekly or monthly downtime period and your request is not an urgent one, you may be better shrinking the file that time or maybe during off peaks hours.

Now, regarding to which file the data will go (assuming you have three files and you're emptying one) I think that the data will be evenly dispersed to each of them because both of them are available and they have free space. But I am not so sure about that.
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