Eric Grange wrote:
> Given a fairly large database (dozens of gigabytes), which uses WAL, and is
> being accessed continuously (mostly read transactions, but regular write
> transactions as well), what are the fastest and less disruptive ways to
> back it up?

Use the backup API, and copy everything in one step.
(The restart-on-write feature should not be necessary with WAL.)

> A basic ".backup" from the CLI can occasionnally take hours, as it is
> thrown thrown off whenever large write transactions occur.

It calls sqlite3_backup_step() with a size of 100 pages.
I guess you have to implement your own backup tool (or modify the shell).

> I am going on the assumption that if something fails during backup, the
> backup itself will be toast anyway, but is that safe otherwise?

Yes; the backup API uses a transaction, like any other read access.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to