CChkSGFiles 函数CChkSGFiles.ErrCheckDbHeaders function

适用于: Exchange Server 2003 |Exchange Server 2007 |Exchange Server 2010 |Exchange Server 2013Applies to: Exchange Server 2003 | Exchange Server 2007 | Exchange Server 2010 | Exchange Server 2013

验证由ErrInit函数指定的数据库文件的标头。Validates the headers of the database files that were specified by the ErrInit function. 此函数还返回每个指定数据库中的页面大小和页面数目。This function also returns the page size and number of pages in each of the specified databases.

Vitual ERRErrCheckDbHeaders  
        ULONG  * const pcbDbPageSize,
        ULONG  * const pcHeaderPagesPerDb,
        ULONG   const piDbErrorEncountered,
    Const ULONGulFlags = NO_FLAGS



输出参数。Output parameter. 每个指定数据库的页面大小(以字节为单位)。The page size of each of the specified databases, in bytes.


输出参数。Output parameter. 在每个指定数据库的开头,由数据库引擎保留以供内部使用的页面数。The number of pages at the beginning of each specified database that are reserved by the database engine for internal use. 请注意,应将标头页传递给ErrCheckDbPages函数以进行验证。Note that you should not pass header pages to the ErrCheckDbPages function for validation.


输出参数。Output parameter. 如果函数的返回值指示错误,则此参数将是传递给ErrInit函数的rgwszDb [] 数组的索引。If the return value of the function indicates an error, this parameter will be an index into the rgwszDb[] array passed to the ErrInit function. 已编制索引的数组元素表示遇到错误的数据库。The indexed array element represents the database in which the error was encountered. 如果函数不返回错误值,则此参数值无效。If the function does not return an error value, this parameter value is invalid.


可选的输入参数。Optional input parameter. 保留此值以供将来使用。This value is reserved for future use. 传递的值应为0(零)。The value passed should be 0 (zero).

返回值Return value

此函数返回CChkSGFiles 枚举中的错误代码。This function returns an error code from the CChkSGFiles.ERR enumeration.


ErrCheckDbHeaders验证使用ErrInit注册的所有数据库是否具有相同的日志签名和数据库页面大小。ErrCheckDbHeaders verifies that all databases registered with ErrInit have the same log signature and database page size. 您还可以使用最低的genMin参数值和最高的genMax参数值来确定将所有已注册的数据库置于干净关闭状态所需的一组日志文件。You can also use the lowest genMin parameter value and the highest genMax parameter value to determine the set of log files that are necessary to bring all of the registered databases to a clean-shutdown state.

仅当检测到错误(由非零ErrCheckDbHeaders返回值所指示)时,才会设置piDbErrorEncountered参数。The piDbErrorEncountered parameter is set only when an error is detected, as indicated by a non-zero ErrCheckDbHeaders return value.

当此函数中出现错误时,将向 Windows 错误事件日志中添加一个错误事件。When an error occurs in this function, an error event will be added to the Windows Error event log.

只能在调用ErrInit后调用ErrCheckDbHeaders ,并且必须先调用它,然后才能调用ErrCheckDbPagesErrCheckLogsYou can call ErrCheckDbHeaders only after calling ErrInit, and you must call it before calling ErrCheckDbPages and ErrCheckLogs.

如果要在多线程应用程序中使用 CHKSGFILES,则必须在单线程部分调用ErrCheckDbHeaders函数,并且只能为每个CCheckSGFiles对象调用一次该函数。If you're using CHKSGFILES in a multithreaded application, you must call the ErrCheckDbHeaders function in the single-threaded portion, and you can call it only once for each CCheckSGFiles object.


Exchange 2013 仅包含64位版本的 CHKSGFILES API。Exchange 2013 only includes a 64-bit version of the CHKSGFILES API.

运行应用程序所使用的帐户必须具有对要检查的数据库和日志文件的读取访问权限。The account that the application is running under must have read access permissions to the database and log files that are to be checked.