CHECKOPTION (Data Integrity Checking)
- Last UpdatedMar 21, 2022
- 5 minute read
Function:
Sets the options for Database (DB) integrity checking.
Description:
The CHECKOPTION command is used to control the level of detail output by a CHECK command. The administrator can specify whether or not they want to check references to other (external) DBs. The administrator can also check consistency of claim lists, and, if there are errors, instruct the AVEVA base product to correct them where possible.
Use the CHECKOPTION command to set up the output required, and then use the CHECK command to perform the check.
Note:
This command is only available within a Project. The corresponding top-level commands
MODE, STATISTICS, MAXERRORS and MAXWARNINGS are available when running stand-alone DICE or REMOTE CHECK.
Controlling the Amount of Information Output
There are two types of DB faults detected by the Data Integrity Checker (DICE):
-
An error is identified if the DB is corrupted internally.
-
A warning is identified if DICE encounters, for example, a fault with a reference to an external DB.
In BRIEF mode, checking is stopped when the first error is encountered; that is, DICE simply determines whether or not the DB is corrupt. This is the default mode.
In FULL mode, DICE continues checking the whole DB or file, listing all errors and warnings, until a prescribed maximum error or warning count is exceeded, when checking if that DB is abandoned. Occasionally DICE will stop before processing the whole DB. This will happen when the error is so severe that it is not worth continuing; for example, if a DB has been truncated.
The default setting for the maximum error count and maximum warning count is 50, but the administrator can specify different numbers by using the MAXERRORS and MAXWARNINGS options.
STATISTICS ON causes DICE to produce a statistical summary of the DB, including its size, the number of elements contained within it, etc.
STATISTICS OFF specifies that no statistics are to be gathered during the checking. This is the default setting.
An example of the output from DICE when statistics are requested is as follows:
|
OVERALL STATISTICS |
Checking External References
The elements in some types of DB have reference or reference array attributes which can point to elements in other DBs. If the administrator uses the EXTERNAL option, DICE will check that all external references point to DBs of appropriate types. For example, a reference attribute in a Model DB which points to a Draft (PADD) DB must be illegal, but a reference attribute pointing to a Catalogue DB will be accepted.
This command cannot be used in stand-alone mode because only one DB file can be accessed at a time.
EXTERNAL NOCHECK is the default. In this mode, DICE does not cross-check any references to other DBs. It is recommended that this setting is always used for transaction DBs.
If EXTERNAL CHECK is specified, the following tests are applied to each external DB to which reference is made:
-
Does the referenced DB exist?
-
Is the referenced DB of a valid type?
-
Is the position pointed to within the limits of the referenced DB?
Note:
In the case of a DB which has copies, DICE only checks that the position pointed to is within the limits of the largest copy.
A non-fatal error message is produced for each invalid external reference found.
Note:
Not recommended for transaction DBs due to the large number of errors that will be
reported.
If the administrator specifies the EXTERNAL CHECK option, the administrator can specify a preference MDB. In this case, DICE will check external references to DBs which are current within the given MDB, before checking other DBs in the Project. This option is mainly relevant when extracts are used, which means that there may be many DBs with the same DB Number in the Project, and so it is less relevant to Global Projects.
Once set, the preference MDB remains current until another EXTERNAL CHECK PREFERENCE command is entered to set a new MDB, or to specify that none is to be used, (though the setting will become irrelevant if EXTERNAL NOCHECK or EXTERNAL REJECT is entered). Using just EXTERNAL CHECK to switch external setting back on will not affect the current preference MDB.
The EXTERNAL REJECT option should normally be chosen only when the administrator is certain that the DB which is being checked should not contain any external references. If this setting is used, any external reference found in the DB will be reported as a fatal error and further checking will be abandoned.
Note:
Not recommended for transaction DBs due to the large number of errors that will be
reported.
Note:
When the CHECK FILES option is used, no external reference checking can be done for that file and EXTERNAL NOCHECK will be assumed.
The CLAIM options are only relevant to extracts.
Extract Claim Lists
The CLAIM ON option (the default) will check that the claim list in an extract corresponds with the claim list in its MDB. The following error messages may be produced:
|
700: |
Element ref/ref is not in parent extract claim list. |
|
702: |
Element ref/ref is claimed to another User/extract. |
|
703: |
Element ref/ref needs claiming to child extract in parent extract. |
|
704: |
Element ref/ref needs clearing in parent extract claim list. |
If PATCH ON has been selected, then an attempt is made to patch errors of type 701, 703 and 704, and these cases will be treated as warnings rather than errors (and will therefore not terminate the check even if FULL mode has not been selected).
For cases 701 and 703, the patch attempts to claim the element from the parent extract (and continues up the extract hierarchy if necessary). If successful, the following message will be written:
|
701: |
PATCH: Element ref/ref claimed in parent extract. |
For case 704, the patch attempts to release the element from the parent extract. If successful, the following message will be written:
|
704: |
PATCH: Element ref/ref cleared from parent extract claim list. |
If the attempted patch is unsuccessful, the following error will be raised:
|
537: |
Attempt to patch failed. |
There is no patch for errors of type 702.
(Patches may also be attempted for some other extract problems.)
Data Consistency in DICE
This setting (CHECKOPT) only applies when checking the transaction DB for the current Location:
CHECKOPT/ION LOCKTRANS/ACTION <on|off>
The default setting is ON, which locks out other writers for the duration of the DICE check (which may take several minutes). This includes the Global daemon, which will stall for the duration of the DICE check.
If CHECKOPT LOCKTRANS OFF is selected, then DICE checks the transaction DB without locking out the Global daemon or other Users and the following warning message is displayed:
"Warning - Transaction Database has not been locked and may change during the check".
This can result in transitory errors being reported which are not true errors. These will disappear if the check is repeated.
Command Syntax:
|
>-- CHECKOption ----+- EXTernal --+- CHECK -+-----------------------. |
Related Commands: