Android 簡訊資料庫與連絡人資料下的.db-wal檔案

來源:互聯網
上載者:User

Android 2.3開始採用Sqlite 3.7,而SQLite 3.7開始引入WAL Mode(Write Ahead Log),一種新的事務控制機制,

所以我們會在系統的簡訊與連絡人的資料庫下看到.db-wal的檔案格式,。

引入的目的是為了保證資料庫中的一致性,避免程式發生崩潰的時候也能保證資料庫的一致性。所以,這就是為什麼

第3方的程式有時能夠正常讀到連絡人的資料,有時卻讀不到的原因,使用者遇到這種情況,最好重啟下機器。

WAL檔案格式的詳細說明見: http://www.sqlite.org/fileformat2.html

其中提到:

A WAL file consists of a header followed by zero or more "frames". Each frame records the revised content of a single page from the database file. All changes to the database are recorded by writing frames into the WAL. Transactions commit when a frame is written that contains a commit marker. A single WAL can and usually does record multiple transactions. Periodically, the content of the WAL is transferred back into the database file in an operation called a "checkpoint".

A single WAL file can be reused multiple times. In other words, the WAL can fill up with frames and then be checkpointed and then new frames can overwrite the old ones. A WAL always grows from beginning toward the end. Checksums and counters attached to each frame are used to determine which frames within the WAL are valid and which are leftovers from prior checkpoints.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.