문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

Cpu.AffinityMask 속성

Gets or sets the AffinityMask member of the Cpu class.

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

public bool AffinityMask { get; set; }

속성 값

유형: System.Boolean
Returns a Boolean that shows the current affinity mask setting for the CPU that is represented by this Cpu instance.

Access to the Cpu class is though the Cpus collection.

To change the CPU settings on an instance of SQL Server, users must have ALTER permission on the database.

The following code example shows how to display the affinity setting for each CPU in the local instance of SQL Server.

C#

using System;
using Microsoft.SqlServer.Management.Smo;

namespace samples
{
    class Program
    {
        static void Main(string[] args)
        {
            Server dbServer = new Server("(local)");
            dbServer.Refresh();
            foreach(Cpu cpu in dbServer.AffinityInfo.Cpus)
                Console.WriteLine("Affinity is {0} for CPU ID {1}.",
                    (cpu.AffinityMask) ? "set" : "not set",
                    cpu.ID);
        }
    }
}

Powershell

$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$dbServer.Refresh()
Foreach ($cpu in $dbServer.AffinityInfo.Cpus)
{
   If ($cpu.AffinityMask = $TRUE)
   {   
      Write-Host "Affinity is set for" $cpu.ID
   }
   Else
   {
      Write-Host "Affinity is not set for" $cpu.ID
}

커뮤니티 추가 항목

추가
표시: