key and data segments do not match

Jose Lerebours fp at fpgroups.com
Sat Jul 26 11:22:11 PDT 2008


Brian posted:
>> I just received a call from a very old friend of mine. He is having problems
>> where the error message key and data segments do not match or something
>> to that effect is given when he tries to access a file. I have not seen this in
>> such a long time I can only speculate that it means "the map was changed
>> by using vi while file is segmented between key and data thus causing map
>> + data association to be corrupt"
>>
>> OR
>>
>> "an old copy of the map was restored overriding the earlier map and the
>> restored map file does not match data segments"
>>
>> Whatever the reason, I wonder, what is the way out of this one?
>
>p, A - Expand Files, select the file, add 10 or 100 records.
>

No, I do not think this would help.  He said he hat tried this before 
he called me and the problem was still there.

>How does it happen? Who knows, probably more than one way anyways.
>

My guess is that he edited the map using 'vi' trying to get away with
editing a map while people were online.  This file has close to or over 
1M records.

>Is there a bad record somewhere now, even though the file "works" again? 
>Probably. Probably at the end, >since fp usually only changes the size 
>of key or data when increasing it, meaning the discrepency was most likely 
>caused while adding a new record. So just go to the highest record number 
>(minus the new empty 100) and verify/fix/delete that record. Go to the 
>record by record number, since the indexes may be buggy until after you 
>clean up the bad record and then rebuild indexes.
>So, "ddir file -L ;dxmaint file -ra -e" after fixing the bad record is 
>probably a good idea too. (delete lockfile, rebuild all indexes, so, not 
>while users are in.)

Not sure what the data condition was.  I was not able to go in and help
him
out since his company and mine (our employers) are not in good terms and
my
walking into his building may be viewed or exploited by their legal
dept. as
intrusion or an opportunity to suit my employer (long story).  We used
to be
one big, happy family and one became two and none get alone ...

I did advised him to restore from tape the "map" file and see what
happened.
After having done that, problem went away.  While he did not admit
having 
done anything to cause such problem (CHA - one normally uses CYA) I
suspect
he 'vi' the map thus corrupting the segments.

After restoring, I advised him of the possibility that a few records
were
added which are now themselves corrupt and he needed to do some house 
keeping.

Given the tense situation between companies, there is not much I can so
for
him.  So, I advised him to subscribe here and search for paid help ... 

Thanks!


--
Jose Lerebours
http://www.fpgroups.com
954-559-7186
filePro + PHP Solution Developer





More information about the Filepro-list mailing list