# EssValidateDB

Description

EssValidateDB() checks the database for data integrity.

Syntax

    ESS_FUNC_M EssValidateDB (hCtx, DbName, FileName);

ESS_HCTX_T | hCtx
ESS_STR_T | DbName
ESS_STR_T | FileName

Parameters

hCtx | Essbase API context handle.
DbName | Database name. Required, cannot be NULL.
FileName | Error log file name, to be placed in the app\db directory on the server. Required.

Return Value

None.

Notes

- This function runs the validation checks to ensure the integrity of the database.
- Precede this call with a call to EssSetActive().
- This function is asynchronous, so you must continue to call EssGetProcessState() until the validation process is finished.
- This command validates the current database. You must select a database before issuing the EssValidateDB() command.
- EssValidateDB() checks for data integrity in each block. Reading from top to bottom, the validation process goes through the entire database and checks blocks, sections, block type, and block length, and checks for validity in floating point numbers.
- This command writes blocks and information about bad blocks to the log file.
- If this command finds integrity errors, it writes validation process error messages to a text-format log file. The default location for the file is in the application\database directory; for example:
  ESSBASE\APP\DB\VALIDATE.LST
- The Essbase index contains an index for every data block. For every Read operation, this command automatically compares the index key in the index page with the index key in the corresponding data block and checks other header information in the block. If it encounters a mismatch, EssValidateDB() displays an error message and continues processing until it has checked the entire database

Access

This function requires the caller to have Database Design privilege (ESS_PRIV_DBDESIGN) for the specified database.

Example

    ESS_VOID_T
    ESS_ValidateDB (ESS_HCTX_T hCtx)
    {
       ESS_FUNC_M        sts = ESS_STS_NOERR;
       ESS_STR_T        DbName;
       ESS_STR_T        FileName;
       ESS_PROCSTATE_T  pState;

       DbName   = "Basic";
       FileName =
        "D:\\Essbase\\app\\sample\\basic\\Validate.lst";

       sts = EssValidateDB (hCtx, DbName, FileName);

       if (!sts)
       {
          sts = EssGetProcessState (hCtx, &pState);
          while (!sts || (pState.State !=
                  ESS_STATE_DONE))
            sts = EssGetProcessState (hCtx, &pState);
       }
    }

See Also

EssSetActive()
EssGetProcessState()