company logo

Client :: checkDatabase - Check database

The function can be called in order to check database consistency. The service is executed on the local machine, when running in a local network (file server mode) or on a local database. In this case, the database must be available exclusively.

The function allows checking and repairing consistency errors. Most consistency errors are caused by redundancy stored in the system but not maintained properly.

The function can be called for an object or replication server. In this case, the client must have been connected to the server and database and dictionary path must refer to symbolic file names defined in the data catalog on the server side.

When calling the function for a replication server, the check runs on a locally stored replicate but corrections are made on the server and transferred to all clients.

When running on an ODABA server, the request is passed to the server. All clients are paused as long as checkDatabase() is running. The timeout for finishing all running transactions can be limited to a the number of seconds passed in iWait. When pausing is not possible during that time interval, the function throws an exception.

Implementation details

Client  :: checkDatabase ( odaba::String &sDictionaryPath, odaba::String &sDatabasePath, odaba::String &sCheckOptions, odaba::String &vExtentPath, int32 iWait )
  • sDictionaryPath - File path to dictionary location

    The dictionary path refers to the location of the main dictionary file (root base).

    In order to pass no dictionary path, an empty string ( String() ) has to be passed.

  • sDatabasePath - File path to database location

    The database path refers to the location of the main database file (root base).

    In order to pass no database path, an empty string ( String() ) has to be passed.

  • 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.

  • iWait - Number of seconds to wait

    The system waits the given number of seconds before executing the request.