Api.JetDefragment2 メソッド

データベース内のデータorganizationを向上させるデータベース最適化タスクを開始および停止します。

Namespace:Microsoft.Isam.Esent.Interop
アセンブリ: Microsoft.Isam.Esent.Interop (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
)

パラメーター

  • tableName
    型: System.String

    未使用のパラメーター。 最適化は、指定されたデータベース ID によって記述されたデータベース全体に対して実行されます。

  • 渡します
    種類: System.Int32

    オンライン最適化タスクを開始するときに、このパラメーターは最適化パスの最大数を設定します。 オンライン最適化タスクを停止すると、このパラメーターは実行されたパスの数に設定されます。

  • seconds
    種類: System.Int32

    オンライン最適化タスクを開始するときに、このパラメーターは最適化の最大時間を設定します。 オンライン最適化タスクを停止すると、この出力バッファーは最適化に使用される時間の長さに設定されます。

戻り値

種類: Microsoft.Isam.Esent.Interop.JET_wrn
警告コード。

解説

JetDefragment2 に渡されるコールバックは非同期で実行できます。 GC は、アンマネージド コードにコールバックへの参照があることを知らないので、コールバックが収集されていないことを確認することが重要です。

関連項目

リファレンス

Api クラス

Api メンバー

Microsoft.Isam.Esent.Interop 名前空間