By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Compacting the database

100+
P: 106
Can any one tell me what does compacting do?

Regards,
Tara
Oct 31 '06 #1
Share this Question
Share on Google+
6 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Can any one tell me what does compacting do?

Regards,
Tara
Tara

You will notice over time that the size of your access database keeps getting bigger. That's because access holds everything in memory. Every query, deleted record, etc. Compacting clears the memory.

Mary
Oct 31 '06 #2

Expert 5K+
P: 8,434
Can any one tell me what does compacting do?
Regards,
Tara
For performance reasons, when records are deleted they are not physically removed – merely flagged as “not there”. In other words, there are “holes” in the file where records used to be. Compacting copies it all into one contiguous chunk. (There’s more to it than that, of course.)
Oct 31 '06 #3

Expert 5K+
P: 8,434
One thing to keep in mind - compacting can be dangerous. I recently found myself with a 2GB database mysteriously reduced to less than 300MB in size, with no indication as to why, simply because I hit Ctrl-Break during a compacting operation. The rest of the data had simply vanished.

So, as usual - always make sure you have backups!
Oct 31 '06 #4

100+
P: 106
One thing to keep in mind - compacting can be dangerous. I recently found myself with a 2GB database mysteriously reduced to less than 300MB in size, with no indication as to why, simply because I hit Ctrl-Break during a compacting operation. The rest of the data had simply vanished.

So, as usual - always make sure you have backups!
Thanks every one for your inputs.
I understood now
one more thing
How often it would be good to comact the database or when ?

Regards,
Oct 31 '06 #5

NeoPa
Expert Mod 15k+
P: 31,344
This depends heavily on the data you have in there.
It's mainly a data issue though, so if you have front- (code) and back- (data) end databases, the front-end shouldn't need compacting very often - maybe when you issue a major release.
The back-end could be done once a week to see how much space is recovered.
Performance should improve somewhat, but it may not be noticeable in your environment.
After a couple of weeks you can determine if it should be done more, or less, often.
Oct 31 '06 #6

100+
P: 106
This depends heavily on the data you have in there.
It's mainly a data issue though, so if you have front- (code) and back- (data) end databases, the front-end shouldn't need compacting very often - maybe when you issue a major release.
The back-end could be done once a week to see how much space is recovered.
Performance should improve somewhat, but it may not be noticeable in your environment.
After a couple of weeks you can determine if it should be done more, or less, often.

Thanks guys for explaining
Nov 1 '06 #7

Post your reply

Sign in to post your reply or Sign up for a free account.