Question about live backups

41 views
Skip to first unread message

Silvio

unread,
Nov 11, 2021, 5:08:36 AM11/11/21
to H2 Database
Hello all,

We use H2 (1.4.200) extensively in production environments. Our backup mechanism consists of:

- stopping the process
- backing up a directory tree including hundreds/thousands of H2 databases
- starting the process

Bringing the process down is because of the fact that the H2 databases can not be backed up on the file system level when they are still open.

For some of the environments the down-time is becoming an issue and we are thinking of using the H2 "BACKUP TO xxx" to push out all backups from inside the process itself and subsequently backing up the rest of the files.

Is there any risk in using the BACKUP command with databases being in (heavy) use? Any increased chance of database corruption? Will it dramatically slow down database  access?

If any of the H2 experts could reflect on this that would be great. And if anyone can share any experience in this area that would be great also.

Noel Grandin

unread,
Nov 11, 2021, 5:27:18 AM11/11/21
to h2-da...@googlegroups.com
On 2021/11/11 12:08 pm, Silvio wrote:
>
> Is there any risk in using the BACKUP command with databases being in (heavy) use? Any increased chance of database
> corruption? Will it dramatically slow down database  access?
>
>

In theory, using the BACKUP command on a live MVStore database is possible, what it does is temporarily prevent re-using
blocks for the duration of the backup.

So as long as your backup happens fairly quickly, or your database has a fairly light write-load, you should be fine.

However, I stress that I don't know that anyone has tested this particularly well.

Regards, Noel.
Reply all
Reply to author
Forward
0 new messages