MSSQL 2016: DB Allocated Space (MB)

Microsoft.SQLServer.2016.Database.DBSize.Collection (Rule)

Collect database allocated size

Knowledge Base article:

Summary

The amount of space allocated for all files in all Filegroups for this database in megabytes.

Please note that this rule collects metrics for ROWS data only. Metrics for FILESTREAM and for In-Memory OLTP data are ignored.

Overrideable Parameters

Name

Description

Default Value

Azure Maximum File Size (MB)

The maximum size of data file stored in Azure BLOB Storage. The workflow will consider this value as a maximum storage capacity for each file.

1048576

Enabled

Enables or disables the workflow.

Yes

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

900

Synchronization Time

The synchronization time specified by using a 24-hour format. May be omitted.

 

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Element properties:

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

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.2016.DBSizeRawPerfProvider Default
WriteToDB WriteAction Microsoft.SystemCenter.CollectPerformanceData Default
WriteToDW WriteAction Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData Default

Source Code:

<Rule ID="Microsoft.SQLServer.2016.Database.DBSize.Collection" Target="SQL2016Core!Microsoft.SQLServer.2016.Database" Enabled="true">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.2016.DBSizeRawPerfProvider">
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
<ConnectionString>$Target/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.DBEngine"]/ConnectionString$</ConnectionString>
<ServerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ServerName>
<SqlInstanceName>$Target/Host/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.ServerRole"]/InstanceName$</SqlInstanceName>
<ObjectName>SQL Database</ObjectName>
<CounterName>DB Allocated Space (MB)</CounterName>
<InstanceName/>
<DatabaseName>$Target/Property[Type="SQL2016Core!Microsoft.SQLServer.2016.Database"]/DatabaseName$</DatabaseName>
<Value>$Data/Property[@Name='DBSizeMB']$</Value>
<TimeoutSeconds>300</TimeoutSeconds>
<AzureMaxFileSizeMB>1048576</AzureMaxFileSizeMB>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>