AdagerHome Your Adager Guide (Section 10 of 13)
First | Prev Table of Contents | Index Next | Last



Adager Therapy Functions
With Adager's expert guidance, you can conveniently examine and repair all kinds of database bits and bytes without cumbersome octal or hexadecimal arithmetic.

You need database therapy only rarely, thanks to the inherent resiliency of IMAGE. When the need arises, you have a very powerful collection of Adager functions to help you diagnose and fix the majority of the structural elements of your databases.

Naturally, even though it is great to be able to fix the symptoms, you must still address the causes. If you need database therapy, something has happened that needs your attention. Here is a list of things that you may want to investigate:

The possibilities for database errors range from "very simple to fix" (such as one bad bit or a couple of broken chain links) to "practically impossible to fix" (such as the results of an incorrectly-handled partial database store/restore).

It is (mathematically) simple to detect inconsistencies between redundant IMAGE elements. It may be (practically) difficult and tedious to fix the inconsistencies.

In the best case, you will be able to repair your IMAGE/SQL database problems with Adager in a matter of minutes. In the worst case, you may have to restore an earlier version of your database and roll its transactions forward.

Not even Adager can help you if someone restores last year's database backup on top of today's production database, for which you do not have a backup!


Examine Chain
Adager examines a specific chain (detail or synonym) and reports any inconsistencies it finds. You may subsequently use Fix Chain to repair individual broken chains or Fix Path to rebuild all of the path's chains (whether damaged or not).

While you examine chains, other processes may access the database in compatible read-only modes. If you must (although we do not recommend this), Adager will also allow other processes to modify the database as you examine a dataset's chains.


Examine Path
To examine a path is to examine all of its chains.

If you specify a master (manual or automatic) dataset, Adager examines the master dataset's synonym chains.

If you specify a detail dataset, Adager examines the detail dataset's paths (which include the detail ChainLinks as well as the related master ChainHeads).

Adager reports to you (and logs internally) any inconsistencies it finds. You may subsequently use Fix Chain to repair individual broken chains or Fix Path to rebuild the path's damaged chains.

While you examine paths, other processes may access the database in compatible read-only modes. If you must (although we do not recommend this), Adager will also allow other processes to modify the database as you examine a dataset's paths.


Fix Chain
This is a precision tool. Think of yourself as a brain surgeon. Adager allows you to deal with the fundamental bits and bytes. You must have the database open exclusively for this operation.

If you request a master (manual or automatic) dataset, Adager deals with specific synonym chains.

If you request a detail dataset, Adager deals with specific path chains (which include the detail ChainLinks as well as the related master ChainHeads).

If a detail dataset has more than one path, Adager takes a very methodical approach. Instead of attempting to deal with all paths simultaneously (which would drive you to distraction), Adager deals with one path at a time.

If you specify a search-field value, Adager uses hashing to locate the last and first pointers in the master ChainHead.

As an alternative, you can specify an entry number. Adager still hashes to locate the master ChainHead but, in addition, Adager uses the given entry's previous and next pointers to look for its chain neighbors (if any).

As still another alternative, you can deal with the privileged portions of specific entries (in-use bits, counts, pointers and search field values), as well as the global dataset counts and pointers (kept in the file's user label).

If a path has too many defective chains, you might prefer to use Fix Path, which rebuilds the chains in the path from scratch, based on search field values.


Fix Dataset
Fix Dataset deals with individual dataset structures whereas Fix Path and Fix Chain deal with path relationships between datasets.

For a master dataset, Fix Dataset re-hashes its entries, rebuilding all synonym chains in the process. Adager deletes duplicate master entries in general and, in particular, automatic master entries whose detail ChainHeads are all zeroes. Adager updates the dataset's entry count. (To repair only specific synonym chains, please use Fix Chain.)

For a detail dataset, Fix Dataset rebuilds the delete chain (also known as the free-entry list), if one exists, and updates the dataset's entry count as well as its HighWater mark. (To repair broken detail chains, please use Fix Chain or Fix Path.)


Fix Path
Adager rebuilds the chains on a detail's path according to the values of the detail's search field (and according to the values of the detail's sort field, if the path is sorted).

Before attempting to fix a detail's path, you should apply the Examine Path function to the related master dataset's synonym chains. If you find any problems in the synonym chains, please fix them before continuing (you may use Fix Dataset or Fix Chain).

Fix Path is meant for detail paths. To rebuild all of the synonym chains on a master dataset, please use Fix Dataset.


Replace Dataset
If you have lost the file for a dataset, Adager creates a brand-new empty file, with the appropriate data structures.

If the dataset is a master with paths, you should subsequently do a Fix Path on each path (through the related detail datasets). This adds the master entries (with the appropriate search field values) required to "parent" the orphan detail chains, if any.

If the dataset is a detail with paths, you should subsequently do a Fix Path on each path to initialize the master ChainHeads.


AutoCheck
AutoCheck checks that automatic master entries have corresponding detail chain entries. AutoCheck purges stand-alone (childless) automatic master entries (which are illegal, under IMAGE's rules for automatic master datasets, even though they do not cause any damage besides occupying extra disc space).



AdagerHome Your Adager Guide (Section 10 of 13)
First | Prev Table of Contents | Index Next | Last