>1) Keep it on the boot volume, not a network or external drive. >The following things will make your journal less safe:
>1) PRAGMA data_store_directory to anywhere other than the boot volume I presume you mean "local filesystem" not "boot volume". The problem is that "remote" filesystems (aka network filesystems) usually do not support locking semantics properly -- but most local filesystems do. So for example putting the database on a local NTFS or ext<x> volume is fine, as is putting it on a local filesystem where the underlying block storage is remote (whether a few inches by the data cable or ten thousand miles by fibre) is also fine. Using a Network File System (NFS, CIFS, AFS, etc) is bad. --- Theory is when you know everything but nothing works. Practice is when everything works but no one knows why. Sometimes theory and practice are combined: nothing works and no one knows why. >-----Original Message----- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of Simon Slavin >Sent: Tuesday, 10 February, 2015 08:41 >To: General Discussion of SQLite Database >Subject: Re: [sqlite] 转发:SQLITE3 JOURNAL MODE > > >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 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users