Need Help - integrity_check


#1

Hello, i am very new to SQL and my knowledge is very limited. I have tried to open up a “.db” file and one of the tables fails to list the data. when i did a integrity check i am listed by the following log. currently i am trying to recover the data by importing and exporting back as SQL DB as i read about it in another a forum.

any help or advice is appreciated. thanks in advance.

“*** in database main ***
On tree page 33245 cell 10: Failed to read ptrmap key=34378218
On tree page 33245 cell 10: invalid page number 34378218
On tree page 33245 cell 9: Extends off end of page
On tree page 33245 cell 8: Failed to read ptrmap key=760245867
On tree page 33245 cell 8: invalid page number 760245867
On tree page 33245 cell 7: Rowid 93285 out of order
Page 30026: btreeInitPage() returns error code 11
Page 24954: btreeInitPage() returns error code 11
Page 23030: btreeInitPage() returns error code 11
Page 22989: btreeInitPage() returns error code 11
Page 22261: btreeInitPage() returns error code 11
On tree page 6329 cell 4: Rowid 547341 out of order
On tree page 6329 cell 4: Failed to read ptrmap key=610891268
On tree page 6329 cell 4: invalid page number 610891268
On tree page 6329 cell 3: Extends off end of page
On tree page 6329 cell 0: Extends off end of page
On page 6412 at right child: Rowid 21063 out of order
On tree page 3018 cell 1: Extends off end of page
Page 27613: btreeInitPage() returns error code 11
On tree page 3141 cell 276: Failed to read ptrmap key=50332193
On tree page 3141 cell 276: invalid page number 50332193
On tree page 3141 cell 266: Failed to read ptrmap key=84082690
On tree page 3141 cell 266: invalid page number 84082690
On tree page 3141 cell 263: Failed to read ptrmap key=84082690
On tree page 3141 cell 263: invalid page number 84082690
On tree page 3141 cell 253: Failed to read ptrmap key=1996817152
On tree page 3141 cell 253: invalid page number 1996817152
On tree page 3141 cell 225: Failed to read ptrmap key=84082690
On tree page 3141 cell 225: invalid page number 84082690
On tree page 3141 cell 220: Failed to read ptrmap key=50332193
On tree page 3141 cell 220: invalid page number 50332193
On tree page 3141 cell 204: Failed to read ptrmap key=84082690
On tree page 3141 cell 204: invalid page number 84082690
On tree page 3141 cell 199: Failed to read ptrmap key=50332193
On tree page 3141 cell 199: invalid page number 50332193
On tree page 3141 cell 195: Failed to read ptrmap key=50332193
On tree page 3141 cell 195: invalid page number 50332193
On tree page 3141 cell 182: Failed to read ptrmap key=50332193
On tree page 3141 cell 182: invalid page number 50332193
On tree page 3141 cell 178: Failed to read ptrmap key=2081536768
On tree page 3141 cell 178: invalid page number 2081536768
On tree page 3141 cell 175: Failed to read ptrmap key=50332193
On tree page 3141 cell 175: invalid page number 50332193
On tree page 3141 cell 174: Failed to read ptrmap key=35734533
On tree page 3141 cell 174: invalid page number 35734533
On tree page 3141 cell 173: Failed to read ptrmap key=234972945
On tree page 3141 cell 173: invalid page number 234972945
On tree page 3141 cell 151: Failed to read ptrmap key=50332193
On tree page 3141 cell 151: invalid page number 50332193
On tree page 3141 cell 137: Failed to read ptrmap key=1886389024
On tree page 3141 cell 137: invalid page number 1886389024
On tree page 3141 cell 123: Failed to read ptrmap key=20972070
On tree page 3141 cell 123: invalid page number 20972070
On tree page 3141 cell 114: Failed to read ptrmap key=2097480544
On tree page 3141 cell 114: invalid page number 2097480544
On tree page 3141 cell 111: Failed to read ptrmap key=17929826
On tree page 3141 cell 111: invalid page number 17929826
Multiple uses for byte 2056 of page 3141
Page 28194: btreeInitPage() returns error code 11
On tree page 28969 cell 54: Failed to read ptrmap key=808859955
On tree page 28969 cell 54: invalid page number 808859955
On tree page 28969 cell 48: Failed to read ptrmap key=909129273
On tree page 28969 cell 48: invalid page number 909129273
On tree page 28969 cell 44: Failed to read ptrmap key=857903669
On tree page 28969 cell 44: invalid page number 857903669
On tree page 28969 cell 41: Failed to read ptrmap key=842464115
On tree page 28969 cell 41: invalid page number 842464115
On tree page 28969 cell 39: Failed to read ptrmap key=26394164
On tree page 28969 cell 39: invalid page number 26394164
On tree page 28969 cell 37: Failed to read ptrmap key=1007728498
On tree page 28969 cell 37: invalid page number 1007728498
Multiple uses for byte 2098 of page 28969
Page 39581: btreeInitPage() returns error code 11
Page 28434: btreeInitPage() returns error code 11
Page 27561: btreeInitPage() returns error code 11
Page 22990: btreeInitPage() returns error code 11
Page 22992 is never used
Page 23031 is never used
Page 24955 is never used
Page 30027 is never used
Page 33247 is never used
Page 33248 is never used
Page 39580 is never used”


#2

Hello @Vishal_Chacko - are you using SQLCipher, or this is just a standard SQLite database? If the database is corrupted then SQLite isn’t really going to be able to automatically fix it for you. You might try the .dump command from the shell to see if you can get some/all the data out. Do you have a backup of the database that you can restore from? If not, you might be able to try a repair / recovery tool, e.g. https://www.stellarinfo.com/sqlite-repair.php - note however that we have not tried that tool or any others first hand, so we can’t recommend it other than to point out that it exists.


#3

Hi I thank you for the reply. I guess this is a standard db and this is a single copy from the Whatsapp folder. all my other copies from different dates open and only this one fails to open. I am going to try dumping as much as data i can and see.

Thank you.