Difference: FileAnalysisAndRecovery (5 vs. 6)

Revision 62016-01-29 - JeanNeron

Line: 1 to 1
 
META TOPICPARENT name="SystemAdministration"

File Analysis and Recovery

Verifying and Analyzing a File

Added:
>
>
You can verify a file's integrity from the Data File Management menu ('Verify Files') or from the command line. To verify files from the command line:
 
In Windows: %APPXPATH%\..\appx.exe -v={filename}
In Unix: $APPXPATH/../appx -v={filename}
Changed:
<
<
... will manually verify an APPX datafile. This does the same thing as interactive "Verify Files Menu", "Verify Integrity" from the Database, Design File, and System Administration File Management menus, but from a command line.

If the invocation of this command results in no output, then the file passes verification. Any output from this command means that the file fails verification.

>
>
If the invocation of this command results in no output, then the file passes verification. Any output from this command means that the file fails verification.
 
Changed:
<
<
To analyze a damaged file ...
In Windows: %APPXPATH%\..\appx.exe -an={filename}
>
>
The Verify step is a pass/fail test. To get more information about the file you can analyze it via:

In Windows: %APPXPATH%\..\appx.exe -an={filename}
 
In Unix: $APPXPATH/../appx -an={filename}
Changed:
<
<
... gives you a"BRF>" prompt for {filename}. The most useful command at this prompt is ...
>
>
This will give you a"BRF>" prompt for {filename}. The most useful command at this prompt is ...
  VERIFY KEY #ALL
Line: 33 to 34
 VERIFY KEY #2 - verifies the alt index #2, etcetera ...

QUIT - exit the "-an=" utility.

Changed:
<
<
If the file doesn't pass #ALL verification, but does pass COUNT REC verification, then it means that the *.dat portion of the file is probably OK, but the *.key indices are probably damaged. In this case, rename or delete the *.key file, then run 'Create Files' on the Data File or Design File Management menu. This will recreate your indices from scratch.

If the file doesn't pass COUNT REC analysis, you have a seriously damaged *.dat file. Your best bet at this point is to use the recover procedure below, or if necessary restore from backup.

FREELIST damage

>
>

FREELIST damage (APPX 4.0.a & earlier)

  A type of file damage that VERIFY KEY #ALL does not tell you about is freelist damage. The freelist is the list of pointers in AppxIO files that point to deleted records. This list can get damaged. It could for example point to a live record, indicating erroneously that it is deleted.

Up through APPX version 4.0.a the menu driven Verify Integrity utilities, the 'appx -v={filename}, and the 'appx -an={filename}', VERIFY KEY #ALL option don't detect such damaged freelist conditions.

Changed:
<
<
To find a damaged freelist condition, you must use the APPX engine (the engine is all that's necessary) release 4.0.a or higher, then go into the BRF> command line from 'appx -an={filename}', then execute the command:
>
>
To find a damaged freelist condition, you must use the APPX engine (the engine is all that's necessary) release 4.1 or higher, then go into the BRF> command line from 'appx -an={filename}', then execute the command:
 

VERIFY FREELIST

Line: 57 to 54
  If the file passes this verification, you may safely export and re-import the file, in order to initialize its freelist.
Deleted:
<
<
If the file doesn't pass #ALL verification, but does pass COUNT REC verification, then it means that the *.dat portion of the file is probably OK, but the *.key indices are probably damaged. In this case, rename or delete the *.key file, then run "Create Files" on the Data File or Design File Management menu. This will recreate your indices from scratch. It will then be safe to export and re-import the file.

If the file doesn't pass COUNT REC analysis, you have a seriously damaged *.dat file. Your best bet at this point is to use the recover procedure below, or if necessary restore from backup.

 

Recovering a Damaged File:

Changed:
<
<
The following steps can be used to recover data from a damaged file. You can also use this technique to recover accidentally deleted records, if you can perform this procedure in time. Since APPX re-uses deleted records, if new data is added after the deleted records, the deleted record may already be overwritten.

Usage:

>
>
There are several techniques that can recover a damaged file. It's not possible to determine in advance which technique will give the best results, therefore we recommend you back up the damaged file, then try these techniques to see which one recovers the most data

Rebuilding the key file

This is the easiest & simplest type of recovery. Either delete or rename the existing .key file, then run 'Create Files' on the Data File Management menu. This will rebuild the key file, and when it is complete run the 'Verify' step again to check the record counts and confirm the file is good. Even if the file passes verification, you might have lost data. If possible, check the file to see if any valid data was lost.

Export/Import the file

This approach might recover more data than rebuilding the key. It will read the file by it's primary key and export the data. You can then import the file with the 'Replace' option to rebuild the .dat and .key file. Import and Export are on the Data File Management menu.

APPX -recover Option

If the above techniques aren't successful, then you can try the '-recover' option. You can also use this technique to recover accidentally deleted records, if you can perform this procedure in time. Since APPX re-uses deleted records, if new data is added after the deleted records, the deleted record may already be overwritten.

Usage:

 
In Windows: %APPXPATH%\..\appx.exe -r old.file new.file [deleted.record.file]
In Unix: $APPXPATH/../appx -r old.file new.file [deleted.record.file]
This utility will read an APPX indexed data file (.dat) and copy the good/active records to the output file. Any corrupt data is hex-dumped to the screen. If you redirect standard output (>bad.data ), you can collect any corrupted data into a file, for later examination.
Changed:
<
<
Deleted Records are discarded, unless a third filename is given on the command line. In this case, the deleted records are copied to the given file. This file is a fixed-length consecutive file. To access it from within APPX, you must design transfer your data dictionary, remove the indices, and change the file type to consecutive. This is needed since the deleted records could contain duplicate key values.
>
>
Deleted Records are discarded, unless a third filename is given on the command line. In this case, the deleted records are copied to the given file. This file is a consecutive file, either fixed length or variable length depending on the attribute of the original file. To access it from within APPX, you must design transfer your data dictionary, remove the indices, and change the file type to consecutive. This is needed since the deleted records could contain duplicate key values.
  Overhead blocks are also removed. These blocks are used to track deleted record space within the file for reuse. Since the new file has no deleted record space, it no longer needs these blocks.

This utility does not deal with duplicate primary or unique alternate indices.

After the command is complete, new.file contains the salvaged data. To access it, rename or delete the original file, then rename the new file to the original file name. Then you must create a new *.key file. This is done by renaming or deleting the existing *.key file, then running "Create Files" on the Data or Design File Management menu. The *.key file contains pointers to all of the data records in the *.dat file. By recovering the *.dat file, you invalidate the original *.key file.

Changed:
<
<

Example:

>
>

Example:

  The following command (in Windows) ...
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback