Поделиться через


Класс Session

Represents a row in sys.server_event_sessions and includes data from sys.dm_xe_sessions if running.

Иерархия наследования

System.Object
  Microsoft.SqlServer.Management.Sdk.Sfc.SfcInstance
    Microsoft.SqlServer.Management.XEvent.Session

Пространство имен:  Microsoft.SqlServer.Management.XEvent
Сборка:  Microsoft.SqlServer.Management.XEvent (в Microsoft.SqlServer.Management.XEvent.dll)

Синтаксис

'Декларация
Public NotInheritable Class Session _
    Inherits SfcInstance _
    Implements ISfcCreatable, ICreatable, ISfcAlterable, IAlterable,  _
    ISfcDroppable, IDroppable, ISfcValidate, ISfcDiscoverObject
'Применение
Dim instance As Session
public sealed class Session : SfcInstance, 
    ISfcCreatable, ICreatable, ISfcAlterable, IAlterable, ISfcDroppable, 
    IDroppable, ISfcValidate, ISfcDiscoverObject
public ref class Session sealed : public SfcInstance, 
    ISfcCreatable, ICreatable, ISfcAlterable, IAlterable, ISfcDroppable, 
    IDroppable, ISfcValidate, ISfcDiscoverObject
[<SealedAttribute>]
type Session =  
    class 
        inherit SfcInstance 
        interface ISfcCreatable 
        interface ICreatable 
        interface ISfcAlterable 
        interface IAlterable 
        interface ISfcDroppable 
        interface IDroppable 
        interface ISfcValidate 
        interface ISfcDiscoverObject 
    end
public final class Session extends SfcInstance implements ISfcCreatable, ICreatable, ISfcAlterable, IAlterable, ISfcDroppable, IDroppable, ISfcValidate, ISfcDiscoverObject

Тип Session обеспечивает доступ к следующим элементам.

Конструкторы

  Имя Описание
Открытый метод Session() Initializes a new instance of Session class.
Открытый метод Session(XEStore, String) Initializes a new instance of Session class.

В начало

Свойства

  Имя Описание
Защищенное свойство AbstractIdentityKey Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Открытое свойство AutoStart Gets or sets a value indicating whether the AutoStart object is active or not.
Открытое свойство EventRetentionMode Gets or sets the EventRetentionMode object.
Открытое свойство Events Gets the EventCollection of the session.
Открытое свойство ID Gets the ID object.
Открытое свойство IdentityKey Gets the identity key of the session.
Открытое свойство IsRunning Gets a value indicating whether this session is running.
Открытое свойство MaxDispatchLatency Gets or sets the maximum dispatch latency in seconds.
Открытое свойство MaxEventSize Gets or sets the size in KB of the maximum event for the session.
Открытое свойство MaxMemory Gets or sets the maximum memory in KB of the session.
Открытое свойство MemoryPartitionMode Gets or sets the memory partition mode from an enumeration with options for perNode, perCpu, or none.
Открытое свойство Metadata Returns metadata about the instance and its domain. (Производный от SfcInstance.)
Открытое свойство Name Gets the name of the Session object.
Открытое свойство Parent Gets or sets the parent XEStore object.
Открытое свойство Properties Returns a collection instance properties. (Производный от SfcInstance.)
Открытое свойство StartTime Gets the start time.
Открытое свойство State Gets the state of the object used in Alter function in session.
Открытое свойство Targets Gets the TargetCollection.
Открытое свойство TrackCausality Gets or sets a Boolean value indicating whether the TrackCausality object is activated.
Открытое свойство Urn Returns the uniform resource name of the SfcInstance object. (Производный от SfcInstance.)

В начало

Методы

  Имя Описание
Открытый метод AddEvent(String) Adds a new Event object to the session from fully qualified event name.
Открытый метод AddEvent(EventInfo) Adds a new Event object to the session.
Открытый метод AddTarget(String) Adds a new Target object to the session.
Открытый метод AddTarget(TargetInfo) Adds a new Target object to the session.
Открытый метод Alter Alters the Session object on the server.
Открытый метод Create Creates the Session object on the server.
Защищенный метод CreateIdentityKey Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Открытый метод Discover Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Открытый метод Drop Drops the Session object on the server.
Открытый метод Equals (Производный от Object.)
Защищенный метод GetChildCollection Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Открытый метод GetDomain Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Открытый метод GetHashCode (Производный от Object.)
Открытый методСтатический элемент GetObjectFactory Gets the SQL Foundation Class object factory.
Открытый метод GetPropertySet Returns the set of properties for the SfcInstance object. (Производный от SfcInstance.)
Открытый метод GetType (Производный от Object.)
Защищенный метод GetTypeMetadataImpl Indicates the domains that override by returning the right TypeMetadata class directly. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Защищенный метод InitializeUIPropertyState Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Защищенный метод OnPropertyMetadataChanges Invoked whenever the effective value of any SfcInstance metadata is updated. (Производный от SfcInstance.)
Защищенный метод OnPropertyValueChanges Invoked whenever the effective value of any SfcInstance property is updated. (Производный от SfcInstance.)
Открытый метод Refresh Refreshes the object's properties by reading them from the server. (Производный от SfcInstance.)
Открытый метод RemoveEvent Removes the specified Event object from the session.
Открытый метод RemoveTarget Removes the Target object from the session.
Защищенный метод ResetKey Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SfcInstance.)
Открытый метод ScriptAlter Gets the alteration ISfcScript for the session.
Открытый метод ScriptCreate Gets the creation ISfcScript for the session.
Открытый метод ScriptDrop Gets the drop ISfcScript for the session.
Открытый метод Serialize Serializes the instance to XML. (Производный от SfcInstance.)
Открытый метод Start Starts the Session object.
Открытый метод Stop Stops the Session object.
Открытый метод ToString Returns a string representation of the instance Urn. (Производный от SfcInstance.)
Открытый метод Validate(String) Validates the specified method name.
Открытый метод Validate(String, array<Object[]) Validates the method specified by the name parameter.

В начало

События

  Имя Описание
Открытое событие PropertyChanged CLS-compliant event for property changes. (Производный от SfcInstance.)
Открытое событие PropertyMetadataChanged CLS-compliant event for property metadata changes. (Производный от SfcInstance.)

В начало

Поля

  Имя Описание
Открытое полеСтатический элемент DefaultDispatchLatency Default dispatch latency is 30 seconds.
Открытое полеСтатический элемент DefaultMaxMemory The maximum amount of memory by default is 4 MB.
Открытое полеСтатический элемент InfiniteDispatchLatency 0 indicates that dispatch latency is infinite.
Открытое полеСтатический элемент NotStarted Session is currently not running.

В начало

Явные реализации интерфейса

  Имя Описание
Явная реализация интерфейсаЗакрытый метод ISfcDiscoverObject.Discover Discovers or alters dependency actions and events in the Session object.

В начало

Замечания

The Session object is the main object that user code interacts with.

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.

См. также

Справочник

Пространство имен Microsoft.SqlServer.Management.XEvent