Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

Cpu-Klasse

The Cpu class contains information about one CPU on an instance of SQL Server.

System.Object
  Microsoft.SqlServer.Management.Smo.Cpu

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)
public sealed class Cpu

Der Cpu-Typ macht folgende Elemente verfügbar.

  NameBeschreibung
Öffentliche EigenschaftAffinityMaskGets or sets the AffinityMask member of the Cpu class.
Öffentliche EigenschaftGroupIDGets the current value of the GroupID member.
Öffentliche EigenschaftIDGets the ID of the CPU that is represented by this Cpu object.
Öffentliche EigenschaftNumaNodeIDGets the NumaNodeID of the NUMA node to which this Cpu object belongs.
Zum Anfang
  NameBeschreibung
Öffentliche MethodeEquals (Geerbt von Object.)
Öffentliche MethodeGetHashCode (Geerbt von Object.)
Öffentliche MethodeGetType (Geerbt von Object.)
Öffentliche MethodeToString (Geerbt von Object.)
Zum Anfang

Access to the CPU class is though the Cpus collection property.

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

The following code example displays the total number of CPUs on 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)");
            Console.WriteLine(
                "Total number of CPUs for server {0} is {1}.",
                dbServer.Name,
                dbServer.AffinityInfo.Cpus.Count);
        }
    }
}

Powershell

$dbServer = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "Total number of CPUs for server" $dbServer.Name "is" $dbServer.AffinityInfo.Cpus.Count
Alle öffentlichen static (Shared in Visual Basic)-Elemente dieses Typs sind Threadsicher. Für Instanzelemente wird die Threadsicherheit nicht gewährleistet.
Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)

Community-Beiträge

HINZUFÜGEN
© 2013 Microsoft. Alle Rechte vorbehalten.