[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Automatically compact databases from time to time (as a background process) Noel Grandin Wed Feb 15 02:01:17 2012

If you want to look at it yourself, the relevant code is in org.h2.store.PageStore#compact(int)

On 2012-02-15 11:51, IntensiveH2 wrote:
Thanks for the quick answer but currently it's not possible to reboot
my application on a regular basis because my application must ensure
scheduling, failover, HA ....
and it's not possible to stop it.
I really need to have a solution at runtime without restarting my

On 15 fév, 10:40, Noel Grandin<[EMAIL PROTECTED]>  wrote:
Not sure what Thomas' plans are,

but what I can suggest is that you set this setting to a nice large number
And reboot your application on a regular basis.

See herehttp://www.h2database.com/html/grammar.html#shutdown
which sets the maximum time to compact the database on shutdown (in

On 2012-02-15 11:05, IntensiveH2 wrote:

I use H2 in a commercial product and I have an issue regarding the
size of the DB (with a customer).
Currently the DB size is 12 GB and after a shutdown compact/restart
the new size is 800 MB
When you start connection on DB (12 GB) it took around 70 minutes to
start (on solaris) before to shutdow it with the compact option.
This is not acceptable (from customer comment).
NOTE: current version used of h2 are 1.3.159, 1.3.161 and 1.3.163 (the
result is the same for all version)
Do you have planned (urgently) to defragment/compact at runtime
(similar to SHUTDOWN COMPACT) in a background thread?
Do you have another solution to avoid this issue (long startup and
compact at runtime)?
Best regards.

You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at