On 10 Feb 2015, at 9:32am, 博协软件-张涛 <2718894...@qq.com> wrote:

> WHERE A POWER LOSS OR  SIGNAL 'KILL -9' HAPPEND IN LINUX SYSTEM,HOW CAN I 
> MAKE SURE THE DB FILE HAVE THE fewest  LOSS! At the same time, THE  kernel 
> CPU period IN 30MS~50MS OR LESS.
> 
> 
> I HAVE TRIED  TO USE  WAL JOURNAL ‍MODE, IN THIS MODE ,when POWER DOWN  OR 
> RESET, THE DB DATA  IS OK ?

WAL mode is no more safe or less safe than the original journal made.  To make 
your database more safe

1) Keep it on the boot volume, not a network or external drive.
2) Set a long busy_timeout, perhaps several minutes. (see "PRAGMA busy_timeout")
3) PRAGMA synchronous = FULL

The following things will make your journal less safe:

1) PRAGMA data_store_directory to anywhere other than the boot volume
2) PRAGMA ignore_check_constraints = YES
3) PRAGMA journal_mode = MEMORY
4) PRAGMA journal_mode = OFF
5) PRAGMA synchronous = OFF
6) PRAGMA temp_store_directory to anywhere other than the boot volume

Do not do any of those things if you want your database to be as safe as 
possible.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to