> From: Stephan Buchert [mailto:stephanb007 at gmail.com]
> Sent: Saturday, May 07, 2016 12:10 AM

> Copying the WAL files is probably more efficient than the SQL text solutions 
> (considering that roughly 5 GB of binary data are weekly added), and it seems 
> easy to implement, so I'll probably try this first. I guess that simply 
> opening the primary database for read before starting the insert/update 
> process would prevent WAL checkpointing until I have a chance to copy the WAL 
> (and SHM) files?

It sounds like that would work. You would need to be careful with your process. 
At a minimum, you need to be sure that full checkpoints don't occur, except in 
conjunction with your copies. It would probably be very easy to do an 
"accidental" checkpoint simply running the sqlite3 command-line tool after a 
reboot. I believe the no-auto-checkpoint setting is per-application, not 
per-database.

I suppose you could change the checkpoint-code so that after a full checkpoint, 
the WAL file is renamed (with a counter suffix), rather than deleted. You 
incremental backup would just need to copy (and perhaps delete) all of the 
renamed WAL files, and process them, in order. That would have the advantage 
that you don't need to let the WAL file grow so large, and you don't have to do 
anything to the main data base while you are doing the incremental backup. 
You'd still have to be careful with your process. Run some sqlite program that 
doesn't have your "changed" checkpoint-code, and you might lose a WAL file.

Regards,
Bill


**************************************************************************************
This e-mail and any attachments thereto may contain confidential information 
and/or information protected by intellectual property rights for the exclusive 
attention of the intended addressees named above. If you have received this 
transmission in error, please immediately notify the sender by return e-mail 
and delete this message and its attachments. Unauthorized use, copying or 
further full or partial distribution of this e-mail or its contents is 
prohibited.
**************************************************************************************

Reply via email to