none
How to fix file index corruption? RRS feed

  • Question

  • Our clients use VFP 9 and some apps build in it. Recently they are found a files index corruptions. The situations in which this issue occurring are: the index file is not in sync with the table; tables are opened with the index (use, order); setting the index order for a table and also indexseek.

    As a result number of records in the index file is disagree with the number of records in the table when the table is opened without an index.

    I think it may be because of using of multiple OS versions such as XP, Vista and 7. Can it be the main problem? If no then what can it be?

    Wednesday, February 4, 2015 9:51 AM

Answers

  • I know only the one problem which often corrupts cdxes and it is a SMB2 protocol problem about locking. If I am right, then such commands as indexseek, oder, use and so on are not matter, it is only the fact of usage of cdxes fails with corrupted indexes.

    I want to say that it is not good idea to mixing multiple OSes together. You better not to try to detect index corruptions to reindex it, but solve the root problem in turning off smb2.

    It can be more than meets the eye to get your files back. Unfortunately, I cannot give you any step-by-step guide. You can find a solution related with your issue on the internet. Or you can find a third-party tool which will do all for you. I know Recovery Toolbox for DBF, it helped me time ago  https://dbf.recoverytoolbox.com/   Maybe it will help in your case.

    • Marked as answer by Xilonene Sunday, February 8, 2015 4:39 PM
    Sunday, February 8, 2015 8:50 AM
  • hi

    One Menu Item  System -> Under that a PAD -> Refitting or Reindexing.  

    When user Clicks on that, a program should run which deletes all index and re-creates them.  

    This Should be run by User Every Morning before commencing Transactions.  

    Force in the program by having a flag not to start the program unless re-indexing is done.


    Lakshmi

    Thursday, February 5, 2015 4:20 AM

  • I think it may be because of using of multiple OS versions such as XP, Vista and 7. Can it be the main problem? If no then what can it be?

    This could be possible if the collation sequence is different from Machine. Namely double byte code pages could cause indexing problems because various Windows versions handle double byte collations different way and index updates may result in certain ambiguities...

    OTOH, the most obvious reason of index corruption is unstable network environment and also SMB2 in newer operating systems.

    Thursday, February 5, 2015 9:10 AM
    Moderator

All replies

  • It is a structural index (CDX) or an external index (IDX)
    CDX should remain sync with the file, while IDX needs to be open at all time to keep being updated. 
    Had you try to recreate the index? what happen?


     
    Wednesday, February 4, 2015 12:26 PM
    Moderator
  • hi

    One Menu Item  System -> Under that a PAD -> Refitting or Reindexing.  

    When user Clicks on that, a program should run which deletes all index and re-creates them.  

    This Should be run by User Every Morning before commencing Transactions.  

    Force in the program by having a flag not to start the program unless re-indexing is done.


    Lakshmi

    Thursday, February 5, 2015 4:20 AM

  • I think it may be because of using of multiple OS versions such as XP, Vista and 7. Can it be the main problem? If no then what can it be?

    This could be possible if the collation sequence is different from Machine. Namely double byte code pages could cause indexing problems because various Windows versions handle double byte collations different way and index updates may result in certain ambiguities...

    OTOH, the most obvious reason of index corruption is unstable network environment and also SMB2 in newer operating systems.

    Thursday, February 5, 2015 9:10 AM
    Moderator
  • As already said USE with order clause doesn't tell us if IDX or CDX is used and IDX gets easily out of sync.

    A natural reason for an index order to filter data and limit the accessable records while it is active is a filtered index.

    So are you getting an error, and which?

    19,20,26,114, 1141...

    There are many index related error messages.

    Bye, Olaf.


    Olaf Doschke - TMN Systemberatung GmbH http://www.tmn-systemberatung.de

    Thursday, February 5, 2015 4:31 PM
  • I know only the one problem which often corrupts cdxes and it is a SMB2 protocol problem about locking. If I am right, then such commands as indexseek, oder, use and so on are not matter, it is only the fact of usage of cdxes fails with corrupted indexes.

    I want to say that it is not good idea to mixing multiple OSes together. You better not to try to detect index corruptions to reindex it, but solve the root problem in turning off smb2.

    It can be more than meets the eye to get your files back. Unfortunately, I cannot give you any step-by-step guide. You can find a solution related with your issue on the internet. Or you can find a third-party tool which will do all for you. I know Recovery Toolbox for DBF, it helped me time ago  https://dbf.recoverytoolbox.com/   Maybe it will help in your case.

    • Marked as answer by Xilonene Sunday, February 8, 2015 4:39 PM
    Sunday, February 8, 2015 8:50 AM