Consultor Eletrônico



Kbase 2073: How to Correct Corrupted Data Errors and Their Causes?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/25/2006
Status: Unverified

SYMPTOM(s):

How to repair your database if it contains corrupted data?

How to Correct Corrupted Data Errors?

What are the possible causes of Data corruption?

SYSTEM ERROR: Record continuation not found, fragment recid <recid>. (137)

SYSTEM ERROR: Database block <nbr> has incorrect recid: <nbr>. (355)

** Error : Unable to allocate more memory for records or variables. (4)

SYSTEM ERROR: Cannot read field from record, not enough fields. (450)

SYSTEM ERROR: Memory violation. (49)

bfxpnd -- Unable to allocate more memory for records or variables. (5)

SYSTEM ERROR: copditm -- maxdlen, data item too large, try to increase -s. (65)

SYSTEM ERROR: wrong dbkey in block. Found <dbkey>, should be <dbkey2> (1124)

CAUSE:

Hardware Failure

CAUSE:

A System error of this type is usually caused by disk (hard drive) or other hardware failure.

-Check your system log and PROGRESS log for indications of abnormal terminations or system failure.

-Run disk diagnostics to be sure you do not have bad spots or sectors on your disk.

-Look for physical I/O errors represented as PROGRESS error 290 in the PROGRESS log file. I/O errors indicate the operating system error that has occurred. For example, I/O error 5 and i/o error 9 indicate physical device errors on UNIX. If you have I/O errors, check your operating system documentation for information on the error number displayed.

Once you determine what caused the error, correct the problem immediately, or additional data or index corruption may occur when writing to the database again.

FIX:

If the error message suggests increasing a PROGRESS startup parameter (For example errors 4 or 5 above) then try increasing the startup parameter. If, after raising the parameter to it's maximum, the error still occurs, most likely your data is corrupted.

To find out if your data is corrupt, perform this test. At the PROGRESS edit line type:

FOR EACH <filename> by <field-name>:
DISPLAY <filename.fieldname>.
END.

The <filename> is the file you were accessing when the error occurred.
If the data is corrupt, you receive the same error message when you run this program. If you do not receive an error message, you may have used the wrong file. Look at the procedure that was running when you first received the error for names of other files that it opens. Try each of these file names in the procedure (above).

If you still receive no errors, then use the PROGRESS Data Dictionary Dump Data option to dump ALL of the files in your database. During the dump procedure PROGRESS fails on corrupt data records and gives one of the errors listed above. This indicates which file is corrupt.

Now that you have determined which file(s) is corrupt, you can choose one of the following options:

1) Continue the dump process and reload all files into a new database (which requires that you also recompile your
entire application).

2) Restore your database from a backup taken prior to when the error occurred.

3) Dump around the bad records and then rebuild the file.

If you are running a QUERY or RUNTIME version of PROGRESS you are not allowed to create procedures that modify the database schema, so only options 1 and 2 (above) are suitable to your environment.
If you have a RUNTIME version of the product, whoever distributed PROGRESS to you provided a utility for dumping and reloading the database. Consult the documentation you got from the developer on how to do this, or contact the application developer directly.

If you have FULL PROGRESS, choose from any of the 3 options above. If your database is large, you probably won't choose option 1 since it can be time-consuming to dump and reload a large database. If you choose option 3, to dump around the bad records and rebuild the file, follow these steps:

1) Export the records starting at the top of the file, until the error occurs, writing to an output file name <filename>.d., where <filename> represents the name of the corrupt database file currently in the data dictionary as follows:

OUTPUT TO <filename>.d.
FOR EACH <filename> BY <field-name>:
EXPORT <filename>.
END.

note: You can also define another output stream to display the primary index within the FOR EACH loop. You do this to see the last index value dumped before the error occurs.

2) Export the records starting at the bottom of the file, until the error occurs, writing to the same output file as in step 1
as follows:

OUTPUT TO <filename>.d APPEND.
FOR EACH <filename> BY <field-name> DESCENDING:
EXPORT <filename>.
END.

3) Use the PROGRESS Data Dictionary "Dump Data Definitions" to dump the schema of the corrupt file.

4) Use the PROGRESS Data Dictionary "Delete" option to delete the corrupt table.

5) Use the PROGRESS Data Dictionary "Load Data Definitions" to load in the schema dumped in step 3.

6) Use the PROGRESS Data Dictionary "Load. File Contents" to load in the data from the file created in steps 1 and 2.

7) Recompile all procedures that use this file.

Progress Data Dictionary Dump and Load Utilities. The Dictionary procedures (.ps) are available in the PROGRESS prodict directory under DLC.
.