Api.JetDefragment2 方法
啟動和停止資料庫重組工作,以改善資料庫內的資料組織。
Namespace:Microsoft.Isam.Esent.Interop
裝配: Microsoft.Isam.Esent.Interop (in Microsoft.Isam.Esent.Interop.dll)
語法
'Declaration
Public Shared Function JetDefragment2 ( _
sesid As JET_SESID, _
dbid As JET_DBID, _
tableName As String, _
ByRef passes As Integer, _
ByRef seconds As Integer, _
callback As JET_CALLBACK, _
grbit As DefragGrbit _
) As JET_wrn
'Usage
Dim sesid As JET_SESID
Dim dbid As JET_DBID
Dim tableName As String
Dim passes As Integer
Dim seconds As Integer
Dim callback As JET_CALLBACK
Dim grbit As DefragGrbit
Dim returnValue As JET_wrn
returnValue = Api.JetDefragment2(sesid, _
dbid, tableName, passes, seconds, _
callback, grbit)
public static JET_wrn JetDefragment2(
JET_SESID sesid,
JET_DBID dbid,
string tableName,
ref int passes,
ref int seconds,
JET_CALLBACK callback,
DefragGrbit grbit
)
參數
sesid
類型: Microsoft.Isam.Esent.Interop.JET_SESID要用於呼叫的會話。
dbid
類型: Microsoft.Isam.Esent.Interop.JET_DBID要重組的資料庫。
tableName
類型: System.String未使用的參數。 系統會針對指定資料庫識別碼所描述的整個資料庫執行重組。
通過
類型: System.Int32啟動線上重組工作時,此參數會設定重組傳遞的最大數目。 停止線上重組工作時,此參數會設定為執行的傳遞數目。
seconds
類型: System.Int32啟動線上重組工作時,此參數會設定重組的最大時間。 停止線上重組工作時,此輸出緩衝區會設定為用於重組的時間長度。
回撥
類型: Microsoft.Isam.Esent.Interop.JET_CALLBACK重組用來報告進度的回呼函式。
grbit
類型: Microsoft.Isam.Esent.Interop.DefragGrbit重組選項。
傳回值
類型: Microsoft.Isam.Esent.Interop.JET_wrn
警告碼。
備註
傳遞至 JetDefragment2 的回呼可以非同步執行。 GC 不知道 Unmanaged 程式碼有回呼的參考,因此請務必確定未收集回呼。
另請參閱
參考
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應