2015-02-09 42 views
1

在我的應用程序中,我使用了SQLite v3.8.4的合併嵌入版本。在過去,我有關於page_size> 32768的v3.7兼容性問題。現在我想用v3.6.20(RHEL6上的默認值)保持數據庫文件的向後兼容性,但是當我嘗試在RHEL6上打開我的數據庫文件時機器,我看到的錯誤:與sqlite DB的向後兼容性

Error: file is encrypted or is not a database 

我可以將數據庫轉儲到一個SQL文件,然後再導入到3.7版。這看起來可以在v3.6.20上讀取,但我的數據庫大小爲3 GB,對於每次轉儲等待2小時並不可行。

我可以在我的v3.8上設置什麼選項來生成v3.6兼容數據庫?

數據庫轉儲

$ hexdump -C works-on-3.6.20.sqlite | head -n 8 
00000000 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 |SQLite format 3.| 
00000010 04 00 01 01 00 40 20 20 00 00 00 01 00 2d 8c 51 |[email protected] .....-.Q| 
00000020 00 00 00 00 00 00 00 00 00 00 00 12 00 00 00 01 |................| 
00000030 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 |................| 
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 |................| 
00000060 00 2d e2 21 05 00 00 00 02 03 f6 00 00 22 fd 07 |.-.!........."..| 
00000070 03 fb 03 f6 01 8f 02 38 00 7c 01 61 81 62 07 07 |.......8.|.a.b..| 
$ hexdump -C fails-on-3.6.20.sqlite | head -n 8 
00000000 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 |SQLite format 3.| 
00000010 80 00 02 02 00 40 20 20 00 00 00 04 00 00 00 2b |[email protected] .......+| 
00000020 00 00 00 00 00 00 00 00 00 00 00 14 00 00 00 01 |................| 
00000030 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 |................| 
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 |................| 
00000060 00 2d e6 04 0d 7f fc 00 18 75 a4 00 7f 36 7f c9 |.-.......u...6..| 
00000070 7e 6b 7f 0b 7d 8f 7e 38 7c 7e 7d 62 7b ab 7c 47 |~k..}.~8|~}b{.|G| 
+1

'hexdump -C databasefile | head -n 8'爲工作和非工作文件? – 2015-02-09 15:58:24

+0

@CL。編輯問題 – vz0 2015-02-09 16:02:27

回答

3

非工作數據庫啓用WAL mode,這是在3.7.0版本中引入的。 Disable它。

+0

就是這樣。我已通過手動發佈PRAGMA journal_mode = DELETE更新了數據庫;現在可以工作了,謝謝! – vz0 2015-02-09 16:12:15