Seeking some help/pointers on how one of the production databases at one of our 
customers got corrupted. The customer started with 3.6 and upgraded to 3.7 on 
windows.

Attached:

a) output of pragma quick_check
b) pretty print of the first page
c) pretty print of the corrupted page

I used  content in http://www.sqlite.org/fileformat2.html to write the pretty 
print utility.

The (db_pages * page_size) matches the file size shown by ‘ls –l’.

Any thoughts/hypothesis much appreciated.

Regards
--sharad

a) OUTPUT OF PRAGMA QUICK_CHECK

sqlite> pragma quick_check;
*** in database main ***
Page 1331646: btreeInitPage() returns error code 11
On tree page 1331638 cell 17: Child page depth differs
On tree page 1331647 cell 44: 4 of 4 pages missing from overflow list starting 
at -2112224253
On tree page 1331647 cell 52: invalid page number 909014121
On tree page 1331647 cell 53: 7 of 7 pages missing from overflow list starting 
at -39619475
On tree page 1331647 cell 54: invalid page number 1811978616
On tree page 1331647 cell 65: 7 of 7 pages missing from overflow list starting 
at -39619475
Corruption detected in cell 2 on page 1331647
Corruption detected in cell 39 on page 1331647
Corruption detected in cell 40 on page 1331647
Corruption detected in cell 42 on page 1331647
Corruption detected in cell 43 on page 1331647
Corruption detected in cell 44 on page 1331647
Corruption detected in cell 45 on page 1331647
Corruption detected in cell 46 on page 1331647
Corruption detected in cell 47 on page 1331647
Corruption detected in cell 48 on page 1331647
Corruption detected in cell 49 on page 1331647
Corruption detected in cell 51 on page 1331647
Corruption detected in cell 52 on page 1331647
Corruption detected in cell 53 on page 1331647
Corruption detected in cell 54 on page 1331647
Corruption detected in cell 55 on page 1331647
Corruption detected in cell 56 on page 1331647
Corruption detected in cell 57 on page 1331647
Corruption detected in cell 58 on page 1331647
Corruption detected in cell 59 on page 1331647
Corruption detected in cell 60 on page 1331647
Corruption detected in cell 61 on page 1331647
Corruption detected in cell 63 on page 1331647
Corruption detected in cell 64 on page 1331647
Corruption detected in cell 65 on page 1331647
Multiple uses for byte 88 of page 1331647
On tree page 1331638 cell 18: Child page depth differs

b) PRETTY PRINT OF THE FIRST PAGE

header = SQLite format 3
page_size = 1024
write_version = 1
read_version = 1
reserved = 0
max_fraction = 64
min_fraction = 32
leaf_fraction = 32
fc_counter = 119344
db_pages = 1392744
freelist_trunk_page = 1392693
freelist_pages = 2
schema_cookie = ea
schema_format = 1
default_cache_size = 0
largest_root_btree_page = 0
encoding = 1
user_version = 0
incremental_vaccum = 0
future[0] = 0
future[1] = 0
future[2] = 0
future[3] = 0
future[4] = 0
future[5] = 0
version_valid_for = 119344
sqlite_version = 3007000

btree_type = 5 (interior table node)
freeblock_offset = 0
numcells = 7
cellcontent_offset = 989
frag_freebytes = 0
rptr = 36 (0x24)
cell[0]=1019
cell[1]=1014
cell[2]=1009
cell[3]=1004
cell[4]=999
cell[5]=994
cell[6]=989


c) PRETTY PRINT OF PAGE 1331647

btree_type = 10 (leaf index node)
freeblock_offset = 0
numcells = 66
cellcontent_offset = 199
frag_freebytes = 0
cell[0]=199
cell[1]=223
cell[2]=5207
cell[3]=279
cell[4]=306
cell[5]=327
cell[6]=352
cell[7]=373
cell[8]=397
cell[9]=421
cell[10]=445
cell[11]=469
cell[12]=494
cell[13]=518
cell[14]=542
cell[15]=566
cell[16]=590
cell[17]=614
cell[18]=638
cell[19]=662
cell[20]=686
cell[21]=711
cell[22]=735
cell[23]=759
cell[24]=783
cell[25]=807
cell[26]=831
cell[27]=855
cell[28]=879
cell[29]=903
cell[30]=928
cell[31]=952
cell[32]=976
cell[33]=1000
cell[34]=928
cell[35]=952
cell[36]=976
cell[37]=1000
cell[38]=88
cell[39]=1027
cell[40]=5892
cell[41]=805
cell[42]=1024
cell[43]=64931
cell[44]=21581
cell[45]=12336
cell[46]=12336
cell[47]=12311
cell[48]=1027
cell[49]=9476
cell[50]=253
cell[51]=41840
cell[52]=24438
cell[53]=25970
cell[54]=26982
cell[55]=31022
cell[56]=27759
cell[57]=26368
cell[58]=39288
cell[59]=12055
cell[60]=1027
cell[61]=9476
cell[62]=253
cell[63]=41808
cell[64]=24406
cell[65]=25970


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to