다음을 통해 공유


CpuCollection.SetAffinityToAll 메서드

Sets the affinity mask for all CPUs on an instance of SQL Server.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public Sub SetAffinityToAll ( _
    affinityMask As Boolean _
)
‘사용 방법
Dim instance As CpuCollection 
Dim affinityMask As Boolean

instance.SetAffinityToAll(affinityMask)
public void SetAffinityToAll(
    bool affinityMask
)
public:
void SetAffinityToAll(
    bool affinityMask
)
member SetAffinityToAll : 
        affinityMask:bool -> unit
public function SetAffinityToAll(
    affinityMask : boolean
)

매개 변수

  • affinityMask
    유형: System.Boolean
    If true, affinity is set for each CPU in the specified range. If false, the affinity state is removed from each CPU in the specified range.

The following example shows how to set affinity to each CPU on an instance of SQL Server.

C#

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.Alter();
            dbServer.AffinityInfo.Cpus.SetAffinityToAll(true);
        }
    }
}

Powershell

$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$dbServer.AffinityInfo.AffinityType = [Microsoft.SqlServer.Management.Smo.AffinityType]'Manual'
$dbServer.AffinityInfo.Alter()
$dbServer.AffinityInfo.Cpus.SetAffinityToAll($TRUE)

참고 항목

참조

CpuCollection 클래스

Microsoft.SqlServer.Management.Smo 네임스페이스