共用方式為


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.

執行緒安全性

這個型別的任何公用 static (在 Visual Basic 中為 Shared) 成員都是執行緒安全的。並不是所有的執行個體成員都保證可以用於所有的執行緒。

請參閱

參考

Microsoft.SqlServer.Management.XEvent 命名空間