Foxpo DBF Tables Can Be Corrupted During Reindex? (No crashes or crashes)

We have a Foxpro exe application that is used on the server, and about 20 users run it. One of my colleagues told me that if these dbf tables need to be reindexed, he should tell everyone to leave an exe request. If the reindex process starts and some user is still running this application, then the dbf tables will be corrupted.

It intrigued me. Is it possible? It was always believed that when reindexing a DBF Foxprox table, the process itself opens the table in exclusive mode, and if the table is already open in shared mode, it just did nothing for this table. Similar to PAK.

+4
source share
3 answers

Although I agree that FoxPro tables may be corrupted, this is not possible from the situation you described. To reindex, you must have exclusive use of the table. Either you get a file lock or not:

  • If someone is in the application and has an open table, then your reindex procedure will either fail, or it will not be able to reindex files that are open. Your idea that you are doing β€œnothing for this table” is true if programming for reindexing tables processes errors when trying to block tables that are already open.
  • If your reindex program is running and someone enters the application or tries to start the application, they will most likely receive errors and / or application failure because they will not be able to open tables (in shared mode).

Here is a list of the most likely culprits for table corruption . There is a mention of file locking issues, but this is due to tables that contain memo fields. These tables actually consist of 2 files (DBF [table] and FPT [memo]). I had applications running for years without any corruption.

+10
source

Copy the valid memo file through the damaged memo file to access the database again.

NOTE. The original memo field information will be lost if the actual memo file is not an exact backup of the damaged file. All memo backup files have the extension .TBK.

A corrupt memo file will have a .FPT extension, such as OLD.FPT. In the following example, suppose NEW.FPT is a valid memo file. To bypass the error message and access the database again, enter the following command at the MS-DOS command prompt:

copy new.fpt old.fpt

0
source

Another option is to turn off all computers, including the server. Then reboot the terminal (assuming the DBF file is on the server) and run reindex.

0
source

Source: https://habr.com/ru/post/1443045/


All Articles