大网数据广告活动
磁盘与文件系统

JetGrowDatabase Function

· 52CE 我爱测

Learn more about: JetGrowDatabase Function

Applies to: Windows | Windows Server

JetGrowDatabase Function

The JetGrowDatabase function extends the size of a database that is currently open.

    JET_ERR JET_API JetGrowDatabase(
      __in          JET_SESID sesid,
      __in          JET_DBID dbid,
      __in          unsigned long cpg,
      __in          unsigned long* pcpgReal
    );

Parameters

sesid

The database session context to use for the API call.

dbid

The database that will be extended.

cpg

The desired size of the database, in pages.

pcpgReal

Pointer to a number that receives the size of the database, in pages, after the API call. If the API call fails, the contents of pcpgReal are undefined.

Return Value

This function returns the JET_ERR datatype with one of the following return codes. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.

Return code Description
JET_errSuccess The operation completed successfully.
JET_errDiskFull There is insufficient free space on the volume to perform the grow operation.
JET_errDiskIO A file-related error was returned by <a href="gg269242(v=exchg.10).md">JetSetDatabaseSize</a>. For more information about other file-related errors that might be returned, see <a href="gg269242(v=exchg.10).md">JetSetDatabaseSize</a>.
Remarks

If JetGrowDatabase is called prior to inserting large amounts of data, the database file will be grown in one operation. This will reduce the likelihood of the database file becoming fragmented at the file system level, and also reduce the number of times the database file has to be grown. Growing the database file once can be faster than growing it several times.

Only growing the file is currently supported. To shrink a file, use the defragmentation feature of the esentutl.exe utility program.

To set the size of a database that is not opened, see JetSetDatabaseSize.

The file size might not match the number of pages that are returned in pcpgReal. There are two additional reserved pages that might not be counted in pcpgReal.

Requirements
Requirement Value
Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.
Header Declared in Esent.h.
Library Use ESENT.lib.
DLL Requires ESENT.dll.
See Also

JET_ERR
JET_GRBIT
JET_SESID
JET_TABLEID
JET_OBJECTINFO
JET_OBJECTLIST
JetSetDatabaseSize

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 04/11/2016
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。