Difference: FileAnalysisAndRecovery (4 vs. 5)

Revision 52016-01-20 - JeanNeron

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

File Analysis and Recovery

Changed:
<
<

Verifying and Analyzing a File

>
>

Verifying and Analyzing a File

 
In Windows: %APPXPATH%\..\appx.exe -v={filename}
In Unix: $APPXPATH/../appx -v={filename}
... 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.
Line: 13 to 13
 To analyze a damaged file ...
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 ...
>
>
... gives you a"BRF>" prompt for {filename}. The most useful command at this prompt is ...
 
Changed:
<
<
VERIFY KEY #ALL
>
>
VERIFY KEY #ALL
  which performs counts the number of records in the .dat portion of the file verifying the .dat as it goes, and verifies all Keys in the .key portion of the file. Other useful commands are:
HELP          - list all available commands.

Line: 36 to 36
  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.
Deleted:
<
<
(For quite large files, it may be faster to use the 'recover.exe' procedure below, the 3)CreateFiles to recreate your keyfile, albeit at the cost of more designer time required to do this safely.)
 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

Line: 61 to 59
  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.
Deleted:
<
<
(For quite large files, it may be faster to use the 'recover.exe' procedure below, then 3)CreateFiles to recreate your keyfile, albeit at the cost of more designer time required to do this safely.)
 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.
Changed:
<
<

File Recovery: appx -r (or -recover)

>
>

Recovering a Damaged File:

 
Added:
>
>
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:

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]
Line: 77 to 74
  This utility does not deal with duplicate primary or unique alternate indices.
Changed:
<
<
* IMPORTANT * Any file you recover must have a new *.key file built. This is done by renaming or deleting the *.key file, then running 3)Create Files. 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.
>
>
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.
 

Example:

The following command (in Windows) ...

Line: 101 to 98
  Space Allocation Reduction = 0 bytes

* You MUST create a new '.key' file that matches your new '.dat' file!

Deleted:
<
<

What to do with a file that Fails Verification?

If Verify Integrity results in a 'Failed' condition, perform the following procedure:

1) If you are running under Unix, su to the appx UserID.

2) Call up a MS-DOS Command box (or Unix Command prompt). Change directories:

cd {appx.exe.folder}\data\DDD\AAA\Data ... where ...

{appx.exe.folder} is the directory containing your 'appx.exe' engine,
DDD is your Database ID (or for your Appl Design files, the Appl's 2-digit version#), and
AAA is your Application ID.

(If you are using FMS Groups, adjust this 'cd' accordingly.)

Example:

D:
cd \APPX\data\DBS\APL\Data

3) Type:

{appx.exe.folder}\tools\recover.exe FILE.dat FILE.new

... where FILE is the name of the file you are recovering.

4) From the Command prompt, perform:

ren FILE.dat FILE.dat.keep
ren FILE.key FILE.key.keep

ren FILE.new FILE.dat

This moves the original FILE.* files out of the way (but keeps them around a while in case they're needed), then moves the recovered FILE.new into place as the new FILE.dat.

5) Go back to Database Management (or Design File Management) for your application. Run 3)Create Files on FILE. This creates a new FILE.key to go along with your recovered FILE.dat.

To double-check, run 13)Verify Menu, 1)Integrity to confirm that the file is OK, and that the Active Records Copied above equals the number reported in the Verify Integrity utility.

 

Comments:

 
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