Linux 上的 MSSQL: 資料庫使用中工作階段計數

Microsoft.SQLServer.Linux.CollectionRule.Database.DBActiveSessionsCount (Rule)

Linux 上 SQL DB 使用中的工作階段數效能收集規則

Knowledge Base article:

摘要

SQL 資料庫的使用中工作階段計數

使用中工作階段計量會顯示資料庫的外部用戶端連線與內部系統連線總和。若此計量很高,連線的用戶端可能會發生效能問題,而其他未連線的用戶端可能會在存取資料庫時遇到問題。

如需詳資訊,請參閱 sys.dm_exec_sessions (Transact-SQL) 文件:

http://go.microsoft.com/fwlink/?LinkId=799303

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

間隔 (秒)

每次重複執行工作流程之間的時間間隔 (秒)。

900

同步處理時間

同步處理時間使用 24 小時制。可予省略。

 

逾時 (秒)

指定流程被關閉及標示為失敗之前,允許執行的時間。

300

資料庫連線的逾時 (秒)

若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。

15

Element properties:

TargetMicrosoft.SQLServer.Linux.Database
CategoryPerformanceCollection
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.Linux.ConditionDetection.DBActiveSessionsCountMapper Default
WriteToDB WriteAction Microsoft.SystemCenter.CollectPerformanceData Default
WriteToDW WriteAction Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData Default

Source Code:

<Rule ID="Microsoft.SQLServer.Linux.CollectionRule.Database.DBActiveSessionsCount" Enabled="true" Target="SqlDiscL!Microsoft.SQLServer.Linux.Database" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.Linux.ConditionDetection.DBActiveSessionsCountMapper">
<MachineName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
<SqlExecTimeoutSeconds>60</SqlExecTimeoutSeconds>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<DatabaseName>$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.Database"]/DatabaseName$</DatabaseName>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>