Database :: checkDatabase - Check database consistency
The function checks database consistency for instances and indexes for a database which is locally available (see CheckDB() utility). The function allows checking and repairing consistency errors. Most consistency errors are caused by redundancy stored in the system but not maintained properly.
In order to perform checkDatabase() in client/server mode, one may call Client::checkDatabase().
Implementation overview
- Calling database check with default options
Database :: checkDatabase (  ) - Check instances in a special extent (or collection)
Database :: checkDatabase ( sCheckOptions, vExtentPath ) - Checking database with specific check options
Database :: checkDatabase ( sCheckOptions )
Implementation details
-
Calling database check with default options
Database  :: checkDatabase (  )
A database check for all instances and collections (indexes), inverse references and GUIDs will be performed. Damages will be reported but not repaired.
to list
-
Check instances in a special extent (or collection)
Database  :: checkDatabase ( odaba::String &sCheckOptions, odaba::String &vExtentPath )
The function will check all instances in the extent or property passed in vExtentPath, which may also contain a property path to a local collection. Options different from defaults have to be set in the option string passed in sCheckOptions.
- sCheckOptions
- Check options
Check options can be passed as option string to CheckDB utility or Database ::checkDatabase() and Property ::checkCollection() check functions. An option string may contain following options:
[-C:checks ] [-T:type ] [-R] [-W]
All options are preceded by an option key, which allows defining options in any order. Default settings are assumed for options, which are not defined in an option string.
Type of resources to be checked (-T:ICA)
Test type allows reducing checks to indexes or instances:
I - check instances, only
C - check collections (indexes), only
A - check collections and indexes
Default: -T:A (running all checks)
Check modes (-C:IXGK)
The list of check options determines the type of checks to be performed:
X - Index check
I - Inverse reference check
K - check key values
G - GUID check
Default: -C:IXG (running all checks)
Repair option (-R)
Only, when passing the repair option, inconsistencies will be repaired. Otherwise, consistencies are reported, only. Index entries referring to deleted instances are removed.
u - In order to restore deleted instances, -R:u. is required.
Warning option (-W)
Show warnings. When this option is not set, warning are not shown.
The order of the options does not play any role. One may use capital or small letters except for the option key -C, -T and -R
Check modes (-C:IXG)The list of check options determines the type of checks to be performed:
I - Inverse reference check
X - Index check
G - GUID check
Default: -C:IXG (running all checks)
The order of the options does not play any role. One may use capital or smallletters except for the option key -C:
- vExtentPath
- Extent path
An extent path may simply refer to an extent, but also to a local collection in the database (property path). Thus, an extent path may contain just a name, but also a sequence of path elements separated by '.' in order to refer to far properties.
In order to pass no extent path, an empty string ( String() ) has to be passed.
to list
- sCheckOptions
- Check options
-
Checking database with specific check options
Database  :: checkDatabase ( odaba::String &sCheckOptions )
In order to perform specific database checks, a check option string may be passed in sCheckOptions. In order to repair damages, -R has to be set in the option string.
- sCheckOptions
- Check options
Check options can be passed as option string to CheckDB utility or Database ::checkDatabase() and Property ::checkCollection() check functions. An option string may contain following options:
[-C:checks ] [-T:type ] [-R] [-W]
All options are preceded by an option key, which allows defining options in any order. Default settings are assumed for options, which are not defined in an option string.
Type of resources to be checked (-T:ICA)
Test type allows reducing checks to indexes or instances:
I - check instances, only
C - check collections (indexes), only
A - check collections and indexes
Default: -T:A (running all checks)
Check modes (-C:IXGK)
The list of check options determines the type of checks to be performed:
X - Index check
I - Inverse reference check
K - check key values
G - GUID check
Default: -C:IXG (running all checks)
Repair option (-R)
Only, when passing the repair option, inconsistencies will be repaired. Otherwise, consistencies are reported, only. Index entries referring to deleted instances are removed.
u - In order to restore deleted instances, -R:u. is required.
Warning option (-W)
Show warnings. When this option is not set, warning are not shown.
The order of the options does not play any role. One may use capital or small letters except for the option key -C, -T and -R
Check modes (-C:IXG)The list of check options determines the type of checks to be performed:
I - Inverse reference check
X - Index check
G - GUID check
Default: -C:IXG (running all checks)
The order of the options does not play any role. One may use capital or smallletters except for the option key -C:
to list
- sCheckOptions
- Check options