Database in order to better achieve the security of data, half will have a log file to facilitate the database in case of unexpected recovery operations. Although SQLite is a single-file database, but perfectly formed, it will have a corresponding security mechanism exists
This journal file is a temporary log file for SQLite, which is mainly used for sqlite transaction rollback mechanism, which is generated at the beginning of the transaction and deleted at the end of the transaction. When a program crashes or the system loses power, the file remains on disk so that the next time the program runs, the transaction is rolled back.
In Android mode, the journal file is permanently left on the disk and will not be automatically erased. If a transaction rollback does not occur then the size of the. db-journal file is 0, which avoids the overhead of generating and deleting journal files each time.
Therefore, it is better to back up two files at the same time for data backup.
Why Android automatically generates a db-journal file when it calls the SQLite database