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

JetInit2 Function

· 52CE 我爱测

Learn more about: JetInit2 Function

Applies to: Windows | Windows Server

JetInit2 Function

The JetInit2 function puts the database engine into a state where it can support application use of database files. The engine must already be properly configured for initialization using JetSetSystemParameter. Database crash recovery is performed automatically as a part of the initialization process.

Windows XP:  JetInit2 is introduced in Windows XP.

This function is obsolete. Use JetInit3 instead.

JET_ERR JET_API JetInit2(
  __in_out_opt  JET_INSTANCE* pinstance,
  __in          JET_GRBIT grbit
);

Parameters

pinstance

The instance to use for this call.

For Windows 2000, this parameter is ignored and should always be NULL.

For Windows XP and later releases, the use of this parameter depends on the operating mode of the engine. If the engine is operating in legacy mode (Windows 2000 compatibility mode) where only one instance is supported, this parameter may either be NULL or it may be set to a valid output buffer containing NULL or JET_instanceNil which returns the global instance handle created as a side effect of the initialization. This instance handle can then be passed to any other API that takes an instance. If the engine is operating in multi-instance mode, this parameter must be set to a valid input buffer that contains the instance handle returned by the JetCreateInstance that is being initialized.

grbit

A group of bits specifying zero or more of the following options.

Value Meaning
JET_bitReplayReplicatedLogFiles Reserved for future use.
JET_bitCreateSFSVolumeIfNotExist Reserved for future use.
JET_bitReplayIgnoreMissingDB This option allows the user to run recovery on a set of log files, without all of the databases being present, that were attached at one point of the log set.
JET_bitRecoveryWithoutUndo Perform recovery, but halt at the Undo phase. This allows additional transaction logs to copied in and applied.
JET_bitTruncateLogsAfterRecovery On successful soft recovery, truncate log files.
JET_bitReplayMissingMapEntryDB Missing database map entry default to same location.
JET_bitReplayIgnoreLostLogs Ignore logs lost from the end of the log stream.Windows 7:JET_bitReplayIgnoreLostLogs is introduced in Windows 7.

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.

Remarks

An instance must be initialized with a call to JetInit2 before it can be used by anything other than JetSetSystemParameter.

An instance is destroyed by a call to the JetTerm function, even if that instance was never initialized using JetInit. An instance is the unit of recoverability for the database engine. It controls the life cycle of all the files used to protect the integrity of the data in a set of database files. These files include the checkpoint file and the transaction log files.

If recovery is running on a set of logs, for which not all databases is present (which will return the error JET_errAttachedDatabaseMismatch under normal circumstances), and the client wishes recovery to continue despite missing databases, the JET_ bitReplayIgnoreMissingDB is used to continue recovery for the available databases.

See the Remarks section in JetInit for more information.

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

Extensible Storage Engine Files
JET_ERR
JET_GRBIT
JET_INSTANCE
JetCreateInstance
JetInit
JetInit3
JetSetSystemParameter
Resource Parameters

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)

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

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