Difference: FileAnalysisAndRecovery (3 vs. 4)

Revision 42016-01-20 - JeanNeron

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

File Analysis and Recovery

Changed:
<
<

The appx utilities, found in the /tools directory below the appx engine, allow batch manipulation and recovery of AppxIO files. In the Windows environment, execute these commands from a DOS popup box. Or use the command line to perform the same functions in Unix.

Command Line Invocations: appx.exe or appx

'appx.exe' lets you perform switched invocations of APPX for Windows, without clearing the DOS box. From a Unix prompt, the command is simply 'appx'. Here's how you would use switches to verify and analyze APPX data files:

Issuing in the DOS box the command ...

appx -u

more

Or in Unix, the command ... appx -u more

... will result in the output ...

Usage:

        -k                          define a new keymap
        -m=<[user_id:]keymap_name>  override keymap ID
        -d=<database_id>            override startup database
        -a=<application_id>         override startup application
        -t=<process_type>           override startup process type
        -p=<process_name>           override startup process name
        -i=<flat_file_name>         convert a flat file into AppxIO
        -e=<data_file_name>         convert an AppxIO file into flatfile
        -v=<data_file_name>         verify the integrity of AppxIO file
        -an=<data_file_name>        analyze an AppxIO file
        -l=<log file name>          start a license server
        -r (or -recover)            recover damaged files (see below)

Restrictions:

An application_id and process_type must always be included when specifying a process_name. If an application_id is included without specifying a process_type/name, the startup menu for the application is used.

If no application_id is specified, the startup application and menu for the database is used. If no database_id is specified, the startup database defined for the user within System Administration is used. If the startup database is also unspecified, the APPX main menu is used.

The valid process_types are Menu, Job, Input, Output, Update, Action, Inquiry, Query, Status, and Subroutine. Use underscores (_) in place of embedded spaces within parameters.

Substituting the "-k" through "-l=" switches will let you specify particular actions upon invoking the appx.exe engine.

(Consider the possibility of building your desired command line invocation strings in MS Word, Notepad or WordPad, then cutting and pasting them into your DOS box.)

For more information on appxutil.exe, see the APPXUTIL Overview.

Verifying and Analyzing a File

In Windows:

%APPXPATH%\..\tools\appxutil.exe -v={filename}

In Unix: $APPXPATH/../tools/appx -v={filename}
>
>

 
Added:
>
>

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.

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.

To analyze a damaged file ...

Changed:
<
<
In Windows:

%APPXPATH%\..\tools\appxutil.exe -an={filename}

In Unix: $APPXPATH/../tools/appx -an={filename}

>
>
In Windows: %APPXPATH%\..\appx.exe -an={filename}
In Unix: $APPXPATH/../appx -an={filename}
 ... gives you a"BRF>" prompt for {filename}. The most useful command at this prompt is ...

VERIFY KEY #ALL

Line: 74 to 34
  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 3)CreateFiles. This will recreate your indices from scratch.
>
>
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.
  (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.)
Changed:
<
<
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.exe" procedure below, or if necessary restore from backup.
>
>
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

Changed:
<
<
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.
>
>
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.
 
Changed:
<
<
Up through APPX version 4.0.a (and perhaps higher), 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.
>
>
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.
  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:
Line: 99 to 59
  If the file passes this verification, you may safely export and re-import the file, in order to initialize its freelist.
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 3)CreateFiles. 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 #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.
  (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.)
Changed:
<
<
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.exe procedure below, or if necessary restore from backup.
>
>
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.
 

File Recovery: appx -r (or -recover)

Usage:

Changed:
<
<
In Windows:

%APPXPATH%\..\appx.exe -r old.file new.file [deleted.record.file]

>
>
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]
Changed:
<
<
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.
>
>
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.
  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.
Line: 123 to 82
  The following command (in Windows) ...
Deleted:
<
<
 appx.exe -r C:\APPX\DATA\DDD\PAT\Data\BB.dat C:\APPX\DATA\DDD\PAT\Data\BB.new

... will generate the following output and files ...

Line: 146 to 103
 * You MUST create a new '.key' file that matches your new '.dat' file!

What to do with a file that Fails Verification?

Changed:
<
<

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

>
>
If Verify Integrity results in a 'Failed' condition, perform the following procedure:
  1) If you are running under Unix, su to the appx UserID.
Changed:
<
<
2) Call up a MS-DOS Command box (or Unix Command prompt). Change directories:
>
>
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.

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

Example:

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

Changed:
<
<
3) Type:
>
>
3) Type:
  {appx.exe.folder}\tools\recover.exe FILE.dat FILE.new

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

Changed:
<
<
4) From the Command prompt, perform:
>
>
4) From the Command prompt, perform:
  ren FILE.dat FILE.dat.keep
ren FILE.key FILE.key.keep
 
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