次の方法で共有


SetAffinityToRange メソッド (Int32, Int32, NumaNodeAffinity)

指定した範囲で NUMA ノードに対する affinity mask を設定します。

名前空間:  Microsoft.SqlServer.Management.Smo
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
Public Sub SetAffinityToRange ( _
    startNumaNodeId As Integer, _
    endNumaNodeId As Integer, _
    affinityMask As NumaNodeAffinity _
)
'使用
Dim instance As NumaNodeCollection
Dim startNumaNodeId As Integer
Dim endNumaNodeId As Integer
Dim affinityMask As NumaNodeAffinity

instance.SetAffinityToRange(startNumaNodeId, _
    endNumaNodeId, affinityMask)
public void SetAffinityToRange(
    int startNumaNodeId,
    int endNumaNodeId,
    NumaNodeAffinity affinityMask
)
public:
void SetAffinityToRange(
    int startNumaNodeId, 
    int endNumaNodeId, 
    NumaNodeAffinity affinityMask
)
member SetAffinityToRange : 
        startNumaNodeId:int * 
        endNumaNodeId:int * 
        affinityMask:NumaNodeAffinity -> unit 
public function SetAffinityToRange(
    startNumaNodeId : int, 
    endNumaNodeId : int, 
    affinityMask : NumaNodeAffinity
)

パラメーター

  • startNumaNodeId
    型: System. . :: . .Int32
    NUMA ノードの範囲の開始を指定する、0 ~ Count -1 の int です。startIndex が有効範囲内でない場合は、Specified argument was out of the range of valid values. Parameter name: startIndex. という例外が返されます。
  • endNumaNodeId
    型: System. . :: . .Int32
    範囲の endIndex を指定する int。endIndex は、startindex 以上および [P:Microsoft.SqlServer.Management.Smo.NumaNodeCollection.Count.] 未満である必要があります。
    endIndex が有効範囲内でない場合は、Specified argument was out of the range of valid values. Parameter name: endIndex という例外が返されます。
    endIndex が startIndex 未満である場合は、The specified range of CPUs is not valid. The value for startIndex must be less than the value for endIndex. という例外が返されます。
  • affinityMask
    型: Microsoft.SqlServer.Management.Smo. . :: . .NumaNodeAffinity
    設定する affinity mask の値。この値は、NumaNodeAffinity()()()() に指定された値のいずれかである必要があります。AffinityMask に [E:Microsoft.SqlServer.Management.Smo.NumaNodeAffinity.Partial.] は設定できません。

使用例

次の例では、SQL Server のインスタンスの各 NUMA ノードに対する関係を設定する方法を示します。

using System;
using System.Collections.Specialized;
using System.Data;
using Microsoft.SqlServer.Management.Smo;

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Server dbServer = new Server("(local)");
            dbServer.AffinityInfo.AffinityType = AffinityType.Manual;
            dbServer.AffinityInfo.NumaNodes.SetAffinityToRange(0,
                dbServer.AffinityInfo.NumaNodes.Count - 1,
                NumaNodeAffinity.Full);
            dbServer.AffinityInfo.Alter();
        }
    }
}