mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
1535 lines
84 KiB
JSON
1535 lines
84 KiB
JSON
{
|
|
"version": "0.3",
|
|
"checks": [
|
|
{
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Database.AutoCreateStats",
|
|
"tags": [ "Performance" ],
|
|
"displayName": "Auto-Create Statistics should be on",
|
|
"description": "The Query Optimizer determines whether an index is useful for a specific query by evaluating the stored statistics. If the statistics become out of date and significant changes have occurred against the underlying data, this can result in less than optimal query performance. In most cases, it's best to let SQL Server maintain the statistics. If you turn 'Auto Create Stats' and 'Auto Update Stats' off, then it is up to you to keep the statistics up-to-date somehow. Failure to do so will lead to poor query performance. Most applications should have these options ON.\n \n When the Auto Create statistics setting is ON, the Query Optimizer creates statistics on one or more columns of a table or an indexed view, as necessary, to improve query plans and query performance.",
|
|
"message": "Turn Auto-Create Statistics option on to improve query performance.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/statistics/statistics#CreateStatistics",
|
|
"probes": [ "DatabaseConfiguration" ],
|
|
"condition": "@is_auto_create_stats_on"
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Database.AutoUpdateStats",
|
|
"tags": [ "Performance" ],
|
|
"displayName": "Auto-Update Statistics should be on",
|
|
"description": "The Query Optimizer determines whether an index is useful for a specific query by evaluating the stored statistics. If the statistics become out of date and significant changes have occurred against the underlying data, this can result in less than optimal query performance. In most cases, it's best to let SQL Server maintain the statistics. If you turn 'Auto Create Stats' and 'Auto Update Stats' off, then it is up to you to keep the statistics up-to-date somehow. Failure to do so will lead to poor query performance. Most applications should have these options ON.\n \n When the Auto Update Statistics setting is ON, the Query Optimizer updates statistics when they are used by a query and when they might be out-of-date. Statistics become out-of-date after insert, update, delete, or merge operations change the data distribution in the table or indexed view. The Query Optimizer determines when statistics might be out-of-date by counting the number of data modifications since the last statistics update and comparing the number of modifications to a threshold. The threshold is based on the number of rows in the table or indexed view. The Query Optimizer checks for out-of-date statistics before compiling a query and before executing a cached query plan. Before compiling a query, the Query Optimizer uses the columns, tables, and indexed views in the query predicate to determine which statistics might be out-of-date. Before executing a cached query plan, the Database Engine verifies that the query plan references up-to-date statistics. The AUTO_UPDATE_STATISTICS option applies to statistics created for indexes, single-columns in query predicates, and statistics that are created by using the CREATE STATISTICS statement. This option also applies to filtered statistics.",
|
|
"message": "Turn Auto-Update Statistics option on to improve query performance.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/statistics/statistics#UpdateStatistics",
|
|
"probes": [ "DatabaseConfiguration" ],
|
|
"condition": "@is_auto_update_stats_on"
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Database",
|
|
"version": "[12.0,)",
|
|
"platform": "Windows",
|
|
"name": { "not": "/^(master|tempdb)$/" }
|
|
},
|
|
"id": "SqlServer.Database.QueryStoreOn",
|
|
"tags": [ "Performance" ],
|
|
"displayName": "Query Store should be on",
|
|
"description": "The Query Store feature provides you with insight on query plan choice and performance. It simplifies performance troubleshooting by helping you quickly find performance differences caused by query plan changes. Query Store automatically captures a history of queries, plans, and runtime statistics, and retains these for your review. It separates data by time windows so you can see database usage patterns and understand when query plan changes happened on the server.",
|
|
"message": "Enable the Query Store to improve performance troubleshooting.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store",
|
|
"probes": [ "DatabaseConfiguration" ],
|
|
"condition": "@is_query_store_on"
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[11.0.3368,12.0)",
|
|
"[12.0.2480,13.0)",
|
|
"[13.0,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.174",
|
|
"tags": [ "TraceFlag", "Compression", "TF174", "Memory" ],
|
|
"displayName": "TF 174 increases the plan cache bucket count",
|
|
"description": "Trace Flag 174 increases the SQL Server plan cache bucket count from 40,009 to 160,001 on 64-bit systems.\n When the SQL Server plan cache reaches its entry limit, plans that have low cost must be evicted in order to insert new plans. This can cause severe contention on the SOS_CACHESTORE spinlock and a high CPU usage occurs in SQL Server.\n On 64-bit systems, the number of buckets for the SQL Server plan cache is 40,009. Therefore, the maximum number of entries that can fit inside the SQL Server plan cache is 160,036. Enabling trace flag 174 on high performance systems increases the size of the cache and can avoid SOS_CACHESTORE spinlock contention.",
|
|
"message": "Consider enabling trace flag 174 to increase the plan cache bucket count.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"in": [ 174, "@TraceFlag" ]
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.634",
|
|
"tags": [ "TraceFlag", "Compression", "TF634", "Memory" ],
|
|
"displayName": "TF 634 disables background columnstore compression",
|
|
"description": "Trace Flag 634 disables the background columnstore compression task.\n SQL Server periodically runs the Tuple Mover background task that compresses columnstore index rowgroups with uncompressed data, one such rowgroup at a time.\n Columnstore compression improves query performance but also consumes system resources.\n You can control the timing of columnstore compression manually, by disabling the background compression task with trace flag 634, and then explicitly invoking ALTER INDEX...REORGANIZE or ALTER INDEX...REBUILD at the time of your choice.",
|
|
"message": "Trace Flag 634 disables the background columnstore compression task. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 634, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.652",
|
|
"tags": [ "TraceFlag", "TF652", "Performance", "Memory" ],
|
|
"displayName": "TF 652 disables page pre-fetching scans",
|
|
"description": "Trace Flag 652 disables page pre-fetching for scans.\n The read-ahead process reads the full extent of a referenced database page into the buffer pool, before those contiguous database pages are consumed by scans.\n Enabling the trace flag can lead to performance issues on queries that leverage pre-fetching.",
|
|
"message": "Trace Flag 652 disables Page Pre-fetching Scans. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "http://support.microsoft.com/kb/920093",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 652, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.661",
|
|
"tags": [ "TraceFlag", "TF661", "Performance" ],
|
|
"displayName": "TF 661 disables Ghost Cleanup Task",
|
|
"description": "Trace Flag 661 disables the ghost record removal process. A ghost record is the result of a delete operation.\n When you delete a record, the deleted record is kept as a ghost record. Later, the deleted record is purged by the ghost record removal process. When you disable this process, the deleted record is not purged.\n Therefore, the space that the deleted record consumes is not freed. This behavior affects space consumption and the performance of scan operations.\n If you turn off this trace Flag, the ghost record removal process works correctly.",
|
|
"message": "Trace flag 661 disables the background ghost cleanup task. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/920093",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 661, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[11.0,)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.834",
|
|
"tags": [ "TraceFlag", "TF834", "Performance" ],
|
|
"displayName": "TF 834 enables large-page allocations",
|
|
"description": "Trace Flag 834 causes the server to use large-page memory (LPM) model for the buffer pool allocations. Consider enabling TF 834 if you have a server that has a lot of memory, particularly for an analytical or data warehousing workload.\n trace flag 834 is NOT recommended on SQL Server instances that use columnstore indexes.",
|
|
"message": "Enable trace flag 834 to use large-page allocations to improve analytical and data warehousing workloads.",
|
|
"helpLink": "https://support.microsoft.com/help/4465518",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"in": [ 834, "@TraceFlag" ]
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "(,11.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.834.1",
|
|
"tags": [ "TraceFlag", "TF834", "Performance", "Memory" ],
|
|
"displayName": "TF 834 enables large-page allocations",
|
|
"description": "Trace Flag 834 causes the server to use large-page memory (LPM) model for the buffer pool allocations. Consider enabling TF 834 if you have a server that has a lot of memory, particularly for an analytical or data warehousing workload.",
|
|
"message": "Consider enabling trace flag 834 to use large-page allocations to improve analytical and data warehousing workloads.",
|
|
"helpLink": "https://support.microsoft.com/help/2964518",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"in": [ 834, "@TraceFlag" ]
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[11.0,)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.845",
|
|
"tags": [ "TraceFlag", "TF845", "Memory" ],
|
|
"displayName": "TF 845 is not needed in SQL Server 2012 and higher versions",
|
|
"description": "Trace Flag 845 supports locking pages in memory in SQL Server Standard edition, which is needed together with trace flag 834 to use the large-page memory (LPM) model for the buffer pool allocations.\n Consider enabling TF 834 if you have a server that has a lot of memory, particularly for an analytical or data warehousing workload.\n Starting with SQL Server 2012 this behavior is enabled by default for Standard edition, and trace flag 845 must not be used.",
|
|
"message": "Disable trace flag 845 in SQL Server 2012 and higher versions.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 845, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.902",
|
|
"tags": [ "TraceFlag", "TF902", "Update" ],
|
|
"displayName": "TF 902: Database Upgrade Bypass should be disabled",
|
|
"description": "Trace Flag 902 bypasses execution of database upgrade script when installing a Cumulative Update or Service Pack.\n This trace flag is not supported to run it continuously in a production environment.\n If you encounter an error during script upgrade mode, it is recommended to contact Microsoft SQL Customer Service and Support (CSS) for further guidance.",
|
|
"message": "Disable trace flag 902 which bypasses database upgrade.",
|
|
"helpLink": "https://support.microsoft.com/help/2163980",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 902, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[13.0,]",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1117",
|
|
"tags": [ "TraceFlag", "TF1117", "FileGroup" ],
|
|
"displayName": "TF 1117 has no effect in SQL Server 2016 and higher versions",
|
|
"description": "Trace Flag 1117 initiates the growth of every file in the filegroup, when a file in the filegroup meets the autogrow threshold, and together with trace flag 1118, can help reduce allocation contention in the SQL Server TempDB database.\n Starting with SQL Server 2016, this behavior is controlled by the AUTOGROW_SINGLE_FILE and AUTOGROW_ALL_FILES options of ALTER DATABASE syntax.",
|
|
"message": "Disable trace flag 1117 in SQL Server 2016 and higher versions.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/statements/alter-database-transact-sql-file-and-filegroup-options",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1117, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[,13.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1117.1",
|
|
"tags": [ "TraceFlag", "TF1117", "FileGroup" ],
|
|
"displayName": "TF 1117 Enables Filegroup-level Autogrow",
|
|
"description": "Trace Flag 1117 initiates the growth of every file in the filegroup, when a file in the filegroup meets the autogrow threshold, and together with trace flag 1118, can help reduce allocation contention in the SQL Server TempDB database.\n This trace flag affects all databases and is recommended only if every database is safe to be grow all files in a filegroup by the same amount.",
|
|
"message": "Consider enabling trace flag 1117 to enable filegroup autogrow.",
|
|
"helpLink": "https://support.microsoft.com/help/2154845",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"in": [ 1117, "@TraceFlag" ]
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[13.0,]",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1118",
|
|
"tags": [ "TraceFlag", "TF1118", "Memory", "Performance" ],
|
|
"displayName": "TF 1118 has no effect in SQL Server 2016 and higher versions",
|
|
"description": "Trace Flag 1118 forces page allocations on uniform extents instead of mixed extents, and together with trace flag 1117, can help reduce allocation contention in the SQL Server TempDB database.\n When a new object is created, by default, the first eight pages are allocated from different extents (mixed extents).\n Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent).\n The SGAM page is used to track these mixed extents, so can quickly become a bottleneck when numerous mixed page allocations are occurring.\n This trace flag allocates all eight pages from the same extent when creating new objects, minimizing the need to scan the SGAM page and forces uniform extent allocations instead of mixed page allocations.\n Starting with SQL Server 2016, this behavior is controlled by the SET MIXED_PAGE_ALLOCATION option of ALTER DATABASE syntax.",
|
|
"message": "Disable trace flag 1118 in SQL Server 2016 and higher versions.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/statements/alter-database-transact-sql-file-and-filegroup-options",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1118, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[,13.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1118.1",
|
|
"tags": [ "TraceFlag", "TF1118", "Memory", "Performance" ],
|
|
"displayName": "TF 1118 Disables Single Page Allocations",
|
|
"description": "Trace Flag 1118 forces page allocations on uniform extents instead of mixed extents, and together with trace flag 1117, can help reduce allocation contention in the SQL Server TempDB database.\n When a new object is created, by default, the first eight pages are allocated from different extents (mixed extents).\n Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent).\n The SGAM page is used to track these mixed extents, so can quickly become a bottleneck when numerous mixed page allocations are occurring.\n This trace flag allocates all eight pages from the same extent when creating new objects, minimizing the need to scan the SGAM page and forces uniform extent allocations instead of mixed page allocations.",
|
|
"message": "Consider enabling trace flag 1118 to force page allocations on uniform extents.",
|
|
"helpLink": "https://support.microsoft.com/help/328551",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"in": [ 1118, "@TraceFlag" ]
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1204",
|
|
"tags": [ "TraceFlag", "TF1204", "Lock" ],
|
|
"displayName": "TF 1204 returns deadlock information",
|
|
"description": "Trace Flag 1204 returns the resources and types of locks that are participating in a deadlock, including the affected command.\n The resulting information is recorded in the SQL Server Errorlog.",
|
|
"message": "Trace Flag 1204 returns deadlock information.",
|
|
"helpLink": "https://support.microsoft.com/help/832524",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1204, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1211",
|
|
"tags": [ "TraceFlag", "TF1211", "Lock" ],
|
|
"displayName": "TF 1211: Lock Escalation should be enabled",
|
|
"description": "Trace Flag 1211 disables lock escalation based on memory pressure, or based on number of locks. Because SQL Server will not escalate row or page locks to table locks, this can generate an excessive number of locks. If the lock memory grows large enough, attempts to allocate additional locks for any query may fail and cause performance issues.\n This trace flag should not be used in order to avoid inability to allocate lock resources because of insufficient memory. If lock escalation needs to be disabled, use trace flag 1224 instead.",
|
|
"message": "Disable trace flag 1211 to allow lock escalation.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1211, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1222",
|
|
"tags": [ "TraceFlag", "TF1222", "Lock" ],
|
|
"displayName": "TF 1222 returns deadlock information",
|
|
"description": "Trace Flag 1222 returns the resources and types of locks that are participating in a deadlock, including the affected command.\n The resulting information is recorded in the SQL Server Errorlog, in XML format that does not comply with any XSD schema.",
|
|
"message": "Trace Flag 1222 returns deadlock information.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1222, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1224",
|
|
"tags": [ "TraceFlag", "TF1224", "Lock" ],
|
|
"displayName": "TF 1224 should be disabled",
|
|
"description": "Trace Flag 1224 disables lock escalation based on the number of locks, unless SQL Server is under memory pressure. Because SQL Server will not escalate row or page locks to table locks, this can generate an excessive number of locks.",
|
|
"message": "Disable trace flag 1224 to allow lock escalation.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1224, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1229",
|
|
"tags": [ "TraceFlag", "TF1229", "Lock" ],
|
|
"displayName": "TF 1229: Lock Partitioning should be enabled",
|
|
"description": "Trace Flag 1229 disables lock partitioning regardless of the number of CPUs. By default, SQL Server enables lock partitioning when a server has 16 or more CPUs, to improve the scalability characteristics of larger systems.\n Disabling lock partitioning may cause can cause spinlock contention and poor performance, or unexpected behaviors when switching partitions.",
|
|
"message": "Disable trace flag 1229 to allow lock partitioning.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1229, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [ "[9.0,11.0.6020)", "[12.0,12.0.4100)" ],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1236",
|
|
"tags": [ "TraceFlag", "TF1236", "Lock" ],
|
|
"displayName": "TF 1236: Database Lock Partitioning should be enabled",
|
|
"description": "Trace Flag 1236 enables database-level lock partitioning.\n Lock Partitioning is utilized to improve the scalability characteristics on larger systems.",
|
|
"message": "Enable trace Flag 1236 to allow database lock partitioning.",
|
|
"helpLink": "https://support.microsoft.com/help/2926217",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"in": [ 1236, "@TraceFlag" ]
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [ "[11.0.6020,12.0)", "[12.0.4100,)" ],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1236.1",
|
|
"tags": [ "TraceFlag", "TF1236", "Lock" ],
|
|
"displayName": "TF 1236 is not needed in SQL Server 2012 SP3, SQL Server 2014 SP1 and higher versions.",
|
|
"description": "Trace Flag 1236 enables database-level lock partitioning.\n Starting with SQL Server 2012 SP3 and SQL Server 2014 SP1, this behavior is controlled by the engine and trace flag 1236 has no effect.",
|
|
"message": "Disable trace flag 1236 in SQL Server 2012 SP3, SQL Server 2014 SP1 and higher versions.",
|
|
"helpLink": "https://support.microsoft.com/help/2926217",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1236, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.1462",
|
|
"tags": [ "TraceFlag", "TF1462", "Compression" ],
|
|
"displayName": "TF 1462 should be disabled to allow Log Stream Compression",
|
|
"description": "Trace Flag 1462 disables log stream compression for asynchronous availability groups.\n This feature is enabled by default on asynchronous replicas to optimize network bandwidth.",
|
|
"message": "Disable trace flag 1462 to allow log stream compression.",
|
|
"helpLink": "https://docs.microsoft.com/sql/database-engine/availability-groups/windows/tune-compression-for-availability-group",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 1462, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[12.0,13.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2312",
|
|
"tags": [ "TraceFlag", "TF2312", "Optimizer" ],
|
|
"displayName": "TF 2312 sets the default Cardinality Estimation model",
|
|
"description": "Trace Flag 2312 sets the Query Optimizer cardinality estimation model to the default version of the database compability level of SQL Server 2014 and higher versions.\n If the database compatibility level is lower than 120, enabling trace flag 2312 uses the cardinality estimation model of SQL Server 2014 (120).",
|
|
"message": "Trace Flag 2312 enables the default cardinality estimation model to SQL Server 2014 or above versions, dependent of the compatibility level of the database.",
|
|
"helpLink": "https://support.microsoft.com/help/2801413",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2312, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[13.0,]",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2312.1",
|
|
"tags": [ "TraceFlag", "TF2312", "Optimizer" ],
|
|
"displayName": "TF 2312 sets the default Cardinality Estimation model",
|
|
"description": "Trace Flag 2312 sets the Query Optimizer cardinality estimation model to the default version of the database compability level of SQL Server 2014 and higher versions.\n If the database compatibility level is lower than 120, enabling trace flag 2312 uses the cardinality estimation model of SQL Server 2014 (120).",
|
|
"message": "Trace Flag 2312 enables the default cardinality estimation model to SQL Server 2014 or above versions, dependent of the compatibility level of the database.",
|
|
"helpLink": "https://support.microsoft.com/help/2801413",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2312, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[,12.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2312.2",
|
|
"tags": [ "TraceFlag", "TF2312", "Optimizer" ],
|
|
"displayName": "TF 2312 sets the default Cardinality Estimation model",
|
|
"description": "Trace Flag 2312 sets the Query Optimizer cardinality estimation model to the default version of the database compability level of SQL Server 2014 and higher versions.\n If the database compatibility level is lower than 120, enabling trace flag 2312 uses the cardinality estimation model of SQL Server 2014 (120).",
|
|
"message": "Trace Flag 2312 does not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2801413",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2312, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[9.0,10.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2330",
|
|
"tags": [ "TraceFlag", "TF2330" ],
|
|
"displayName": "TF 2330 disables recording of index usage stats",
|
|
"description": "Trace Flag 2330 disables recording of index usage stats, which could lead to a non-yielding condition in SQL 2005.",
|
|
"message": "Disable trace flag 2330 in SQL Server 2008 and higher versions.",
|
|
"helpLink": "",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2330, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[10.0,]",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2330.1",
|
|
"tags": [ "TraceFlag", "TF2330" ],
|
|
"displayName": "TF 2330 disables recording of index usage stats",
|
|
"description": "Trace Flag 2330 disables recording of index usage stats, which could lead to a non-yielding condition in SQL 2005.\n This trace flag should be disabled in SQL Server 2008 and higher versions.",
|
|
"message": "Disable trace flag 2330 in SQL Server 2008 and higher versions.",
|
|
"helpLink": "",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 2330, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2340",
|
|
"tags": [ "TraceFlag", "TF2340", "Optimizer" ],
|
|
"displayName": "TF 2340 disables Batch Sorts for optimized nested loops joins",
|
|
"description": "Trace Flag 2340 causes SQL Server not to use a sort operation (batch sort) for optimized nested loops joins when generating a plan.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace Flag 2340 disables Batch Sorts for optimized nested loops joins.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2340, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[10.5.2500,13.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2371",
|
|
"tags": [ "TraceFlag", "TF2371", "Performance" ],
|
|
"displayName": "TF 2371 enables a linear recompilation threshold for statistics",
|
|
"description": "Trace Flag 2371 causes SQL Server to change the fixed update statistics threshold to a linear update statistics threshold.\n This is especially useful to keep statistics updated on large tables.",
|
|
"message": "Enable trace Flag 2371 to allow a linear recompilation threshold for statistics.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"in": [ 2371, "@TraceFlag" ]
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[13.0,]",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2371.1",
|
|
"tags": [ "TraceFlag", "TF2371", "Performance" ],
|
|
"displayName": "TF 2371 has no effect in SQL Server 2016 and higher versions",
|
|
"description": "Trace Flag 2371 causes SQL Server to change the fixed update statistics threshold to a linear update statistics threshold.\n This is especially useful to keep statistics updated on large tables. \n Starting with SQL Server 2016, for databases using compatibility level 130 and above, this behavior is controlled by the engine and trace flag 2371 has no effect.",
|
|
"message": "Disable trace flag 2371 in SQL Server 2016 and higher versions when all databases are at compatibility level 130 and above.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2371, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2389",
|
|
"tags": [ "TraceFlag", "TF2389" ],
|
|
"displayName": "TF 2389 enables automatic statistics for Ascending Keys",
|
|
"description": "Trace Flag 2389 enables automatically generated quick statistics for ascending keys (histogram amendment).\n This trace flag is recommended to be set in cases where queries access newly inserted ascending key values (such as an IDENTITY column), but the new values are not yet updated in the statistics histogram for the affected columns. In this case the histogram used to estimate cardinality will be adjusted at query compile time.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace Flag 2389 enables automatic statistics for ascending keys. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2801413",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2389, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2390",
|
|
"tags": [ "TraceFlag", "TF2390" ],
|
|
"displayName": "TF 2390 enables automatic statistics for Ascending or Unknown Keys",
|
|
"description": "Trace Flag 2390 enables automatically generated quick statistics for ascending or unknown keys (histogram amendment).\n This trace flag is recommended to be set in cases where queries access newly inserted ascending key values (such as an IDENTITY column), but the new values are not yet updated in the statistics histogram for the affected columns. In this case the histogram used to estimate cardinality will be adjusted at query compile time.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace Flag 2390 enables automatic statistics for ascending or unknown keys. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2801413",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": {
|
|
"in": [ 2390, "@TraceFlag" ]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2528",
|
|
"tags": [ "TraceFlag", "TF2528" ],
|
|
"displayName": "TF 2528 disables parallel operations for integrity checking",
|
|
"description": "Trace Flag 2528 disables parallel checking of objects by DBCC CHECKDB, DBCC CHECKFILEGROUP, and DBCC CHECKTABLE.\n By default, the degree of parallelism is automatically determined by the query processor. The maximum degree of parallelism is configured just like that of parallel queries.\n When parallel checks are disabled, the DBCC commands will take longer to complete.\n Starting with SQL Server 2014 SP2, a MAXDOP option is available to override the max degree of parallelism configuration option of sp_configure for the DBCC statements.",
|
|
"message": "Trace Flag 2528 disables parallel operations for integrity checking.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Warning",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 2528, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2549",
|
|
"tags": [ "TraceFlag", "TF2549" ],
|
|
"displayName": "TF 2549 optimizes PHYSICAL_ONLY option of DBCC CHECKDB",
|
|
"description": "Trace Flag 2549 forces the DBCC CHECKDB command to assume each database file is on a unique disk drive but treating different physical files as one logical file.\n This trace flag can improve the performance when using the PHYSICAL_ONLY option, but it's not recommended unless it is known that each file is based on a unique physical disk.",
|
|
"message": "Trace Flag 2549 forces DBCC CHECKDB to treat different physical files as one logical file.",
|
|
"helpLink": "https://support.microsoft.com/help/2634571",
|
|
"level": "Warning",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 2549, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2562",
|
|
"tags": [ "TraceFlag", "TF2562" ],
|
|
"displayName": "TF 2562 forces the DBCC CHECKDB command to execute in a single batch",
|
|
"description": "Trace Flag 2562 forces the DBCC CHECKDB command to execute in a single batch regardless of the number of indexes in the database.\n This trace flag can improve the performance when using the PHYSICAL_ONLY option, but space requirements for TempDB may increase.",
|
|
"message": "Trace Flag 2562 forces the DBCC CHECKDB command to execute in a single batch.",
|
|
"helpLink": "https://support.microsoft.com/help/2634571",
|
|
"level": "Warning",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 2562, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.2566",
|
|
"tags": [ "TraceFlag", "TF2566" ],
|
|
"displayName": "TF 2566 disables default data purity check",
|
|
"description": "Trace Flag 2566 forces the DBCC CHECKDB command to execute without data purity check unless the DATA_PURITY option is specified.\n For databases upgraded from earlier versions of SQL Server, it is recommended to run the DBCC CHECKDB WITH DATA_PURITY command at least once, to enable column-value integrity checks to happen by default.",
|
|
"message": "Trace Flag 2566 disables default data purity check.",
|
|
"helpLink": "https://support.microsoft.com/help/945770",
|
|
"level": "Warning",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 2566, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.3023",
|
|
"tags": [ "TraceFlag", "TF3023", "Backup" ],
|
|
"displayName": "TF 3023 enables Backup Checksum option by default",
|
|
"description": "Trace Flag 3023 enables the CHECKSUM option of the BACKUP command by default.\n This trace flag forces the CHECKSUM option for BACKUP command even when not explicitely set.\n Starting with SQL Server 2014, this behavior is controlled by setting the Backup Checksum Default configuration option.",
|
|
"message": "Trace Flag 3023 enables CHECKSUM option as default for BACKUP command.",
|
|
"helpLink": "https://support.microsoft.com/help/2656988",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 3023, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.3042",
|
|
"tags": [ "TraceFlag", "TF3042", "Backup" ],
|
|
"displayName": "TF 3042 bypasses the default backup compression pre-allocation algorithm",
|
|
"description": "Trace Flag 3042 bypasses the default backup compression pre-allocation algorithm to allow the backup file to grow only as needed to reach its final size.\n This trace flag can achieve space savings by allocating only the actual size required for the compressed backup, but might increase the overall backup operation time.",
|
|
"message": "Trace Flag 3042 enables the bypass of the default backup compression.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/backup-restore/backup-compression-sql-server",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 3042, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.3226",
|
|
"tags": [ "TraceFlag", "TF3226", "Backup" ],
|
|
"displayName": "TF 3226 disables ErrorLog entries for every successful backup operation",
|
|
"description": "Trace Flag 3226 prevents SQL Server from recording an entry to the Errorlog on every successful backup operation.\n Backup operations are registered in the Errorlog by default. Frequent backup operations can contribute to massive Errorlog files that become unwieldy.",
|
|
"message": "Trace Flag 3226 disables ErrorLog entries for every successful backup operation.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 3226, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[9.0.4294,10.0)",
|
|
"[10.0.2766,10.50)",
|
|
"[10.50.1720,11.0)",
|
|
"[11.0.2316,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4136",
|
|
"tags": [ "TraceFlag", "TF4136", "Optimizer" ],
|
|
"displayName": "TF 4136 disables Parameter Sniffing",
|
|
"description": "Trace Flag 4136 disables parameter sniffing unless OPTION(RECOMPILE), WITH RECOMPILE or OPTIMIZE FOR value is used.\n Starting with SQL Server 2016, to accomplish this at the database level use the PARAMETER_SNIFFING option in ALTER DATABASE SCOPED CONFIGURATION.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace Flag 4136 disables parameter sniffing. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/980653",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4136, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"(,9.0.4294)",
|
|
"[10.0,10.0.2766)",
|
|
"[10.50,10.50.1720)",
|
|
"[11.0,11.0.2316)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4136.1",
|
|
"tags": [ "TraceFlag", "TF4136", "Optimizer" ],
|
|
"displayName": "TF 4136 disables Parameter Sniffing",
|
|
"description": "Trace Flag 4136 disables parameter sniffing unless OPTION(RECOMPILE), WITH RECOMPILE or OPTIMIZE FOR value is used, but does not apply to this SQL Server version.\n Starting with SQL Server 2016, to accomplish this at the database level use the PARAMETER_SNIFFING option in ALTER DATABASE SCOPED CONFIGURATION.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace Flag 4136 does not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/980653",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4136, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[10.0.4326,10.0.4371]",
|
|
"[10.0.5794,10.50)",
|
|
"[10.50.2806,11.0)",
|
|
"[11.0.2316,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4137",
|
|
"tags": [ "TraceFlag", "TF4137", "Optimizer" ],
|
|
"displayName": "TF 4137 causes plans to use partial correlation for filters",
|
|
"description": "Trace Flag 4137 causes SQL Server to generate a plan using minimum selectivity when estimating AND predicates for filters to account for partial correlation instead of independance, under the query optimizer cardinality estimation model of SQL Server 2012 and earlier versions (CE 70).\n Does not apply to CE version 120 or above. Use trace flag 9471 instead.\n Starting with SQL Server 2016 SP1, to accomplish this at the query level use the USE HINT 'ASSUME_MIN_SELECTIVITY_FOR_FILTER_ESTIMATES' query hint.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace Flag 4137 causes SQL Server to generate a plan using partial correlation of filters. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2658214",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4137, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"(,10.0.4326)",
|
|
"(10.0.4371,10.0.5794)",
|
|
"[10.50,10.50.2806)",
|
|
"[11.0,11.0.2316)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4137.1",
|
|
"tags": [ "TraceFlag", "TF4137", "Optimizer" ],
|
|
"displayName": "TF 4137 causes plans to use partial correlation for filters",
|
|
"description": "Trace Flag 4137 causes SQL Server to generate a plan using minimum selectivity when estimating AND predicates for filters to account for partial correlation instead of independance, under the query optimizer cardinality estimation model of SQL Server 2012 and earlier versions (CE 70). However it does not apply to this SQL Server version.\n Does not apply to CE version 120 or above. Use trace flag 9471 instead.\n Starting with SQL Server 2016 SP1, to accomplish this at the query level use the USE HINT 'ASSUME_MIN_SELECTIVITY_FOR_FILTER_ESTIMATES' query hint.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace flag 4137 does not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2658214",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4137, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[10.50.2817,10.50.2881]",
|
|
"[10.50.4260,11.0)",
|
|
"[11.0.2325,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4138",
|
|
"tags": [ "TraceFlag", "TF4138", "Optimizer" ],
|
|
"displayName": "TF 4138 causes plans to not use Row Goal adjustments",
|
|
"description": "Trace Flag 4138 causes SQL Server to generate a plan that does not use row goal adjustments with queries that contain TOP, OPTION (FAST N), IN, or EXISTS keywords.\n Starting with SQL Server 2016 SP1, to accomplish this at the query level use the USE HINT 'DISABLE_OPTIMIZER_ROWGOAL' query hint.\n Verify need to set a Non-default trace flag with current system build and configuration.",
|
|
"message": "Trace Flag 4138 enables plan that without row goal adjustments. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2667211",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4138, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"(,10.50.2817)",
|
|
"(10.50.2881,10.50.4260)",
|
|
"[11.0,11.0.2325)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4138.1",
|
|
"tags": [ "TraceFlag", "TF4138", "Optimizer" ],
|
|
"displayName": "TF 4138 causes plans to not use Row Goal adjustments",
|
|
"description": "Trace Flag 4138 causes SQL Server to generate a plan that does not use row goal adjustments with queries that contain TOP, OPTION (FAST N), IN, or EXISTS keywords.\n Starting with SQL Server 2016 SP1, to accomplish this at the query level use the USE HINT 'DISABLE_OPTIMIZER_ROWGOAL' query hint. However it does not apply to this SQL Server version.\n Verify need to set a Non-default trace flag with current system build and configuration.",
|
|
"message": "Trace flag 4138 does not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2667211",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4138, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[11.0.3431,11.0.5058)",
|
|
"[11.0.5532,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4139",
|
|
"tags": [ "TraceFlag", "TF4139" ],
|
|
"displayName": "TF 4139 enables automatic statistics for any key ordering",
|
|
"description": "Trace Flag 4139 enables automatically generated quick statistics (histogram amendment) regardless of key column status.\n This trace flag is recommended to be set in cases where queries access newly inserted key values that may change plan shape, but the new values are not yet updated in the statistics histogram for the affected columns. In this case, regardless of the leading statistics column status (ascending, descending, or stationary), the histogram used to estimate cardinality will be adjusted at query compile time.\n This trace flag does not apply to the cardinality estimation model of SQL Server 2012 and earlier versions (CE 70).\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace Flag 4139 enables automatic statistics for any key ordering. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2952101",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4139, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"(,11.0.3431)",
|
|
"[11.0.5058,11.0.5532)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4139.1",
|
|
"tags": [ "TraceFlag", "TF4139" ],
|
|
"displayName": "TF 4139 enables automatic statistics for any key ordering",
|
|
"description": "Trace Flag 4139 enables automatically generated quick statistics (histogram amendment) regardless of key column status.\n However, this trace flag does not apply to this SQL Server version.\n Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"message": "Trace flag 4139 does not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/2952101",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4139, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[9.0.4035,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.4199",
|
|
"tags": [ "TraceFlag", "TF4199", "Optimizer" ],
|
|
"displayName": "TF 4199 enables Query Optimizer fixes",
|
|
"description": "Trace Flag 4199 enables Query Optimizer fixes released in SQL Server Cumulative Updates and Service Packs.",
|
|
"message": "Trace Flag 4199 enables Query Optimizer fixes. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "http://support.microsoft.com/help/974006",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 4199, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[12.0.2474,12.0.2480]",
|
|
"[12.0.4416,12.0.5000)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6498",
|
|
"tags": [ "TraceFlag", "TF6498", "Memory" ],
|
|
"displayName": "TF 6498 enables additional concurrent large queries",
|
|
"description": "Trace Flag 6498 enables more than one large query compilation to gain access to the big gateway when there is sufficient memory available.\n This trace flag can be used to keep memory usage for the compilation of incoming queries under control, avoiding compilation waits for concurrent large queries.\n Starting with SQL Server 2014 SP2 and SQL Server 2016, this behavior is controlled by the engine and trace flag 1236 has no effect.",
|
|
"message": "Trace Flag 6498 enables concurrent large queries.",
|
|
"helpLink": "https://support.microsoft.com/help/3024815",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 6498, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[12.0.5000,)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6498.1",
|
|
"tags": [ "TraceFlag", "TF6498", "Memory" ],
|
|
"displayName": "TF 6498 enables additional concurrent large queries",
|
|
"description": "Trace Flag 6498 enables more than one large query compilation to gain access to the big gateway when there is sufficient memory available.\n This trace flag can be used to keep memory usage for the compilation of incoming queries under control, avoiding compilation waits for concurrent large queries.\n Starting with SQL Server 2014 SP2 and SQL Server 2016, this behavior is controlled by the engine and trace flag 1236 has no effect.",
|
|
"message": "Disable trace flag 6498 in SQL Server 2014 SP2, SQL Server 2016 and higher versions.",
|
|
"helpLink": "https://support.microsoft.com/help/3024815",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 6498, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"(,12.0.2474)",
|
|
"(12.0.2480,12.0.4416)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6498.2",
|
|
"tags": [ "TraceFlag", "TF6498", "Memory" ],
|
|
"displayName": "TF 6498 enables additional concurrent large queries",
|
|
"description": "Trace Flag 6498 enables more than one large query compilation to gain access to the big gateway when there is sufficient memory available.\n However, this trace flag does not apply to this SQL Server version.\n This trace flag can be used to keep memory usage for the compilation of incoming queries under control, avoiding compilation waits for concurrent large queries.\n Starting with SQL Server 2014 SP2 and SQL Server 2016, this behavior is controlled by the engine and trace flag 1236 has no effect.",
|
|
"message": "Trace Flag 6498 does not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/3024815",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 6498, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[11.0.6020,11.0.6518)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6532",
|
|
"tags": [ "TraceFlag", "TF6532", "Performance" ],
|
|
"displayName": "TF 6532 enables performance improvements for Spatial data",
|
|
"description": "Trace Flag 6532 enables performance improvements of query operations with spatial data types.\n The performance gain will vary, depending on the configuration, the types of queries, and the objects.",
|
|
"message": "Enable trace flag 6532 to enable performance improvements for Spatial data.",
|
|
"helpLink": "https://support.microsoft.com/help/3107399",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": { "in": [ 6532, "@TraceFlag" ] }
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[11.0.6518,12.0)",
|
|
"[12.0.5000,13.0)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6532.6533",
|
|
"tags": [ "TraceFlag", "TF6532", "TF6533", "Performance" ],
|
|
"displayName": "TF 6532 and TF 6533 enable performance improvements for Spatial data",
|
|
"description": "Trace Flag 6532 and trace flag 6533 enable performance improvements of query operations with spatial data types.\n The performance gain will vary, depending on the configuration, the types of queries, and the objects.",
|
|
"message": "Enable trace flag 6532 and trace flag 6533 to enable performance improvements for Spatial data.",
|
|
"helpLink": "https://support.microsoft.com/help/3107399",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"and": [
|
|
{ "in": [ 6532, "@TraceFlag" ] },
|
|
{ "in": [ 6533, "@TraceFlag" ] }
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[13.0,)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6532.6533.1",
|
|
"tags": [ "TraceFlag", "TF6532", "TF6533", "Performance" ],
|
|
"displayName": "TF 6532 and TF 6533 enable performance improvements for Spatial data",
|
|
"description": "Trace flags 6532 and 6533 enable performance improvements of query operations with spatial data types.\n However, this trace flag does not apply to this SQL Server version.\n Starting with SQL Server 2016, this behavior is controlled by the engine and trace flags 6532 and 6533 have no effect.",
|
|
"message": "Disable trace flag 6532 in SQL Server 2016 and higher versions.",
|
|
"helpLink": "https://support.microsoft.com/help/3107399",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"and": [
|
|
{ "not": { "in": [ 6532, "@TraceFlag" ] } },
|
|
{ "not": { "in": [ 6533, "@TraceFlag" ] } }
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"(,11.0.6020)",
|
|
"[12.0,12.0.5000)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6532.6533.2",
|
|
"tags": [ "TraceFlag", "TF6532", "TF6533", "Performance" ],
|
|
"displayName": "TF 6532 and TF 6533 enable performance improvements for Spatial data",
|
|
"description": "Trace flags 6532 and 6533 enable performance improvements of query operations with spatial data types.\n However, this trace flag does not apply to this SQL Server version.\n Starting with SQL Server 2016, this behavior is controlled by the engine and trace flags 6532 and 6533 have no effect.",
|
|
"message": "Trace flags 6532 and 6533 do not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/3107399",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"and": [
|
|
{ "not": { "in": [ 6532, "@TraceFlag" ] } },
|
|
{ "not": { "in": [ 6533, "@TraceFlag" ] } }
|
|
]
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[11.0.6020,12.0)",
|
|
"[12.0.5000,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6534",
|
|
"tags": [ "TraceFlag", "TF6534", "Performance" ],
|
|
"displayName": "TF 6534 enables performance improvements for Spatial data",
|
|
"description": "Trace Flag 6534 enable performance improvements of query operations with spatial data types.\n The performance gain will vary, depending on the configuration, the types of queries, and the objects.",
|
|
"message": "Enable trace Flag 6534 to enable performance improvement of query operations with spatial data types.",
|
|
"helpLink": "https://support.microsoft.com/help/3107399",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": { "in": [ 6534, "@TraceFlag" ] }
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"(,11.0.6020)",
|
|
"[12.0,12.0.5000)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.6534.1",
|
|
"tags": [ "TraceFlag", "TF6534", "Performance" ],
|
|
"displayName": "TF 6534 enables performance improvements for Spatial data",
|
|
"description": "Trace Flag 6534 enables performance improvement of query operations with spatial data types.\n However, this trace flag does not apply to this SQL Server version.\n Verify need to set a Non-default trace flag with current system build and configuration.",
|
|
"message": "Trace flag 6534 does not apply to this SQL Server version. Verify need to set a non-default trace flag with the current system build and configuration.",
|
|
"helpLink": "https://support.microsoft.com/help/3107399",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": {
|
|
"not": { "in": [ 6534, "@TraceFlag" ] }
|
|
}
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": "[13.0.4001,15.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.TraceFlag.7412",
|
|
"tags": [ "TraceFlag", "TF7412", "Performance" ],
|
|
"displayName": "TF 7412 enables the lightweight profiling infrastructure for live query performance troubleshooting",
|
|
"description": "Trace Flag 7412 enables the lightweight profiling infrastructure for live query performance troubleshooting. Consider enabling TF 7412 to have the ability to access runtime information on query execution plans for any session.",
|
|
"message": "Enable trace flag 7412 to enables the lightweight profiling infrastructure for live query performance troubleshooting.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/performance/query-profiling-infrastructure",
|
|
"level": "Information",
|
|
"probes": [ "EnabledGlobalTraceFlags" ],
|
|
"condition": { "in": [ 7412, "@TraceFlag" ]
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.DeprecatedOrDiscontinuedFeatures",
|
|
"tags": [ "deprecated_feature", "discontinued_feature" ],
|
|
"displayName": "Deprecated or discontinued features should not be used",
|
|
"description": "This check detects deprecated or discontinued features used on target SQL Server instance. Deprecated features may be removed in a future release of SQL Server. Discontinued features have been removed from specific versions of SQL Server.",
|
|
"message": "Detected deprecated or discontinued feature uses: @{DeprecatedFeature}. We recommend to replace them with features actual for SQL Server version @{ProductVersion}.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/performance-monitor/sql-server-deprecated-features-object",
|
|
"probes": [ "Microsoft.DeprecatedFeaturesStats", "SQLServerVersion" ],
|
|
"condition": {
|
|
"equal": [ "@DeprecatedFeature", "" ]
|
|
}
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.SystemHealthSessionNotActive",
|
|
"tags": [ "XEvent", "SystemHealth" ],
|
|
"displayName": "system_health XEvent session is not active",
|
|
"description": "This session starts automatically when the SQL Server Database Engine starts, and runs without any noticeable performance effects. The session collects system data that you can use to help troubleshoot performance issues in the Database Engine.\n We recommend that you do not stop, alter, or delete the system health session.",
|
|
"message": "Start the session by using the ALTER EVENT SESSION statement or by using the Extended Events node in Object Explorer.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/extended-events/use-the-system-health-session",
|
|
"level": "Warning",
|
|
"probes": [ "Microsoft.XEvent.SystemHealth" ],
|
|
"condition": "@XEvent.SystemHealthCount"
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.SPServerDiagnosticsSessionNotActive",
|
|
"tags": [ "XEvent", "SPServerDiagnostics", "sp_server_diagnostics" ],
|
|
"displayName": "sp_server_diagnostics xEvent session is not active",
|
|
"description": "This session starts automatically when the SQL Server Database Engine starts, and runs without any noticeable performance effects. The session collects system data that you can use to help troubleshoot performance issues in the Database Engine.\n We recommend that you do not stop, alter, or delete the system health session.",
|
|
"message": "Start the session by using the ALTER EVENT SESSION statement or by using the Extended Events node in Object Explorer.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/system-stored-procedures/sp-server-diagnostics-transact-sql",
|
|
"level": "Warning",
|
|
"probes": [ "Microsoft.XEvent.SPServerDiagnostics" ],
|
|
"condition": "@XEvent.SPServerDiagnostics"
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.BlackboxTraceConfiguredRunning",
|
|
"tags": [ "DefaultCollections", "BlackBox", "Trace" ],
|
|
"displayName": "Blackbox trace is configured and running",
|
|
"description": "This trace is designed to behave similarly to an airplane black box, to help you diagnose intermittent server crashes. It consumes more resources than the default trace and should not be running for extended periods of time.",
|
|
"message": "Make sure you still need the blackbox trace and stop it otherwise.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/system-stored-procedures/sp-trace-create-transact-sql",
|
|
"level": "Warning",
|
|
"probes": [ "Microsoft.CountBlackBoxTraces" ],
|
|
"condition": { "not": "@BlackBoxTraceCount" }
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.NoDefaultTraceFoundIsNotActive",
|
|
"tags": [ "DefaultCollections", "DefaultTrace", "Trace" ],
|
|
"displayName": "No default trace was found or is not active",
|
|
"description": "Default trace provides troubleshooting assistance to database administrators by ensuring that they have the log data necessary to diagnose problems the first time they occur.",
|
|
"message": "Make sure that there is enough space for SQL Server to write the default trace file. Then have the default trace run by disabling and re-enabling it.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/policy-based-management/default-trace-log-files-disabled",
|
|
"level": "Warning",
|
|
"probes": [ "Microsoft.CountDefaultTraces" ],
|
|
"condition": "@DefaultTraceCount"
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.HintsStatistics",
|
|
"tags": [ "Hints", "Instance" ],
|
|
"displayName": "Hints are being used",
|
|
"description": "Hints are options or strategies specified for enforcement by the SQL Server query processor on SELECT, INSERT, UPDATE, or DELETE statements. The hints override any execution plan the Query Optimizer might select for a query. Because the SQL Server Query Optimizer typically selects the best execution plan for a query, we recommend that <join_hint>, <query_hint>, and <table_hint> be used only as a last resort by experienced developers and database administrators.",
|
|
"message": "We recommend that <join_hint>, <query_hint>, and <table_hint> be used only as a last resort by experienced developers and database administrators, because the SQL Server Query Optimizer typically selects the best execution plan for a query.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/queries/hints-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "Microsoft.Hints.InstanceStatistics" ],
|
|
"condition": "@HintUsageCount"
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Database.HintsUsageInModules",
|
|
"tags": [ "Hints", "Database", "Module" ],
|
|
"displayName": "Hints usage in modules",
|
|
"enabled": false,
|
|
"description": "Hints are options or strategies specified for enforcement by the SQL Server query processor on SELECT, INSERT, UPDATE, or DELETE statements. The hints override any execution plan the Query Optimizer might select for a query. Because the SQL Server Query Optimizer typically selects the best execution plan for a query, we recommend that <join_hint>, <query_hint>, and <table_hint> be used only as a last resort by experienced developers and database administrators.",
|
|
"message": "@{Hint} was used in @{type_desc} @{Schema_Name}.@{Object_Name}.",
|
|
"helpLink": "https://docs.microsoft.com/sql/t-sql/queries/hints-transact-sql",
|
|
"level": "Information",
|
|
"probes": [ "Microsoft.Hints.ModuleUsage" ]
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.PlansUseRatio",
|
|
"tags": [ "Plan", "Usage" ],
|
|
"displayName": "Amount of single use plans in cache is high",
|
|
"description": "Single use plans waste system resources.",
|
|
"message": "Amount of single use plans in cache is high (@{SingleUsePlansUseRatio:P0}). Consider enabling the Optimize for ad hoc workloads setting on heavy OLTP ad-hoc workloads to conserve resources.",
|
|
"helpLink": "https://docs.microsoft.com/sql/database-engine/configure-windows/optimize-for-ad-hoc-workloads-server-configuration-option",
|
|
"level": "Warning",
|
|
"probes": [ "Microsoft.CachedPlans.SingleUseRatio" ],
|
|
"condition": { "less": [ "@SingleUsePlansUseRatio", 0.5 ] }
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Database.HypotheticalIndices",
|
|
"tags": [ "Hypothetical", "Index" ],
|
|
"displayName": "Hypothetical indexes found",
|
|
"description": "Database has indexes that are marked as hypothetical. Hypothetical indexes are created by the Database Tuning Assistant (DTA) during its tests. If a DTA session was interrupted, these indexes may not be deleted. It is recommended to drop these objects as soon as possible.",
|
|
"message": "Index @{IndexName} for @{Schema}.@{Object} is marked as hypothetical. It is recommended to drop hypothetical index @{IndexName} as soon as possible.",
|
|
"helpLink": "",
|
|
"level": "Warning",
|
|
"probes": [ "Microsoft.Hypothetical.Indices" ]
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Database.HypotheticalStatistics",
|
|
"tags": [ "Hypothetical", "Statistics" ],
|
|
"displayName": "Hypothetical statistics found",
|
|
"description": "Database has statistics that are marked as hypothetical. Hypothetical statistics are created by the Database Tuning Assistant (DTA) during its tests. If a DTA session was interrupted, these statistics may not be deleted. It is recommended to drop these objects as soon as possible.",
|
|
"message": "Statistics @{StatName} for @{Schema}.@{Object} is hypothetical. It is recommended to drop hypothetical statistics @{StatName} as soon as possible.",
|
|
"helpLink": "",
|
|
"level": "Warning",
|
|
"probes": [ "Microsoft.Hypothetical.Statistics" ]
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[11.0,11.0.7001.0)",
|
|
"[12.0,12.0.6259.0)",
|
|
"[13.0,13.0.5337.0)",
|
|
"[14.0,14.0.3162.1)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.LatestCUInstalled",
|
|
"tags": [ "Update" ],
|
|
"displayName": "SQL Server instance is not up to date",
|
|
"description": "On an installed instance of SQL Server, we recommend that you apply the latest security updates and critical updates including general distribution releases (GDRs), service packs (SPs), and cumulative updates (CUs).",
|
|
"message": "Product version @{ProductVersion} is not the latest available. We recommend keeping your SQL Server up to date and install Service Packs and Cumulative Updates as they are released.",
|
|
"helpLink": "https://support.microsoft.com/help/321185/how-to-determine-the-version-edition-and-update-level-of-sql-server-an https://docs.microsoft.com/sql/database-engine/install-windows/install-sql-server-servicing-updates",
|
|
"probes": [ "SQLServerVersion" ]
|
|
},
|
|
{
|
|
"target": {
|
|
"type": "Server",
|
|
"version": [
|
|
"[11.0.7001.0, 12.0)",
|
|
"[12.0.6259.0, 13.0)",
|
|
"[13.0.5337.0, 14.0)",
|
|
"[14.0.3162.1,)"
|
|
],
|
|
"platform": "Windows"
|
|
},
|
|
"id": "SqlServer.Server.LatestCUInstalled.1",
|
|
"tags": [ "Update" ],
|
|
"displayName": "SQL Server instance is not up to date",
|
|
"description": "On an installed instance of SQL Server, we recommend that you apply the latest security updates and critical updates including general distribution releases (GDRs), service packs (SPs), and cumulative updates (CUs).",
|
|
"message": "Product version @{ProductVersion} is not the latest available. We recommend keeping your SQL Server up to date and install Service Packs and Cumulative Updates as they are released.",
|
|
"helpLink": "https://support.microsoft.com/help/321185/how-to-determine-the-version-edition-and-update-level-of-sql-server-an https://docs.microsoft.com/sql/database-engine/install-windows/install-sql-server-servicing-updates",
|
|
"condition": false
|
|
},
|
|
|
|
{
|
|
"target": {
|
|
"type": "Database",
|
|
"name": { "not": "msdb" }
|
|
},
|
|
"id": "SqlServer.Database.ForeignKeysNoIndices",
|
|
"tags": [ "Performance", "Index" ],
|
|
"displayName": "Foreign key constraints should have corresponding indexes",
|
|
"description": "Unlike primary key constraints, creating a foreign key constraint does not automatically create a corresponding index. However, manually creating an index on a foreign key is often useful.",
|
|
"message": "There is no index on the following foreign key(s): @{ConstraintName}. We recommend you have a corresponding index on every foreign key.",
|
|
"helpLink": "https://docs.microsoft.com/sql/relational-databases/tables/primary-and-foreign-key-constraints",
|
|
"level": "Warning",
|
|
"probes": [ "FKNoIndices" ]
|
|
}
|
|
],
|
|
"probes": {
|
|
"EnabledGlobalTraceFlags": [
|
|
{
|
|
"type": "CLR",
|
|
"target": {
|
|
"type": "Server"
|
|
},
|
|
"implementation": {
|
|
"class": "Microsoft.SqlServer.Management.Assessment.Probes.TransposeColumnProbe",
|
|
"query": "DECLARE @tracestatus TABLE (TraceFlag NVARCHAR(40), [Status] tinyint, [Global] tinyint, [Session] tinyint); INSERT INTO @tracestatus EXEC ('DBCC TRACESTATUS WITH NO_INFOMSGS'); SELECT [TraceFlag], [Status] FROM @tracestatus WHERE Global=1;",
|
|
"columnName": "TraceFlag"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.CountBlackBoxTraces": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Server"
|
|
},
|
|
"implementation": {
|
|
"query": "SELECT COUNT(id) AS [BlackBoxTraceCount] FROM [sys].[traces] WHERE [path] LIKE '%blackbox%.trc' AND status = 1;"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.CountDefaultTraces": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Server"
|
|
},
|
|
"implementation": {
|
|
"query": "SELECT COUNT(id) AS [DefaultTraceCount] FROM [sys].[traces] WHERE is_default = 1 AND status = 1;"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.XEvent.SystemHealth": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Server"
|
|
},
|
|
"implementation": {
|
|
"query": "SELECT COUNT(name) AS [XEvent.SystemHealthCount] FROM [sys].[dm_xe_sessions] WHERE [name] = 'system_health';"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.XEvent.SPServerDiagnostics": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Server"
|
|
},
|
|
"implementation": {
|
|
"query": "SELECT COUNT(name) AS [XEvent.SPServerDiagnostics] FROM sys.dm_xe_sessions WHERE [name] = 'sp_server_diagnostics session';"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.DeprecatedFeaturesStats": [
|
|
{
|
|
"type": "CLR",
|
|
"target": {
|
|
"type": "Server"
|
|
},
|
|
"implementation": {
|
|
"class": "Microsoft.SqlServer.Management.Assessment.Probes.TransposeColumnProbe",
|
|
"query": "SELECT [instance_name] AS [DeprecatedFeature] FROM [sys].[dm_os_performance_counters] WHERE ([object_name] LIKE '%Deprecated Features%') AND ([cntr_value] > 0);",
|
|
"columnName": "DeprecatedFeature",
|
|
"convertToString": true
|
|
}
|
|
}
|
|
],
|
|
"DatabaseConfiguration": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Database",
|
|
"version": "(,12.0)",
|
|
"platform": "Windows"
|
|
},
|
|
"implementation": {
|
|
"query": "SELECT db.[is_auto_create_stats_on] AS is_auto_create_stats_on, db.[is_auto_update_stats_on] AS is_auto_update_stats_on, 0 AS is_query_store_on FROM [sys].[databases] AS db WHERE db.[name]='@DatabaseName'"
|
|
}
|
|
},
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Database",
|
|
"version": "[12.0,)",
|
|
"platform": "Windows"
|
|
},
|
|
"implementation": {
|
|
"query": "SELECT db.[is_auto_create_stats_on] AS is_auto_create_stats_on, db.[is_auto_update_stats_on] AS is_auto_update_stats_on, db.[is_query_store_on] AS is_query_store_on FROM [sys].[databases] AS db WHERE db.[name]='@DatabaseName'"
|
|
}
|
|
}
|
|
],
|
|
"FKNoIndices": [
|
|
{
|
|
"type": "CLR",
|
|
"target": {
|
|
"type": "Database"
|
|
},
|
|
"implementation": {
|
|
"class": "Microsoft.SqlServer.Management.Assessment.Probes.TransposeColumnProbe",
|
|
"query": "USE [@DatabaseName];SELECT QUOTENAME(fk.parent_schema_name)+ '.' + QUOTENAME(fk.parent_table_name) + '.' + QUOTENAME(fk.constraint_name) AS ConstraintName FROM ( SELECT t.name AS [parent_schema_name], OBJECT_NAME(FKC.parent_object_id) [parent_table_name], OBJECT_NAME(constraint_object_id) AS [constraint_name], SUBSTRING((SELECT ',' + RTRIM(COL_NAME(k.parent_object_id,parent_column_id)) AS [data()] FROM sys.foreign_key_columns k (NOLOCK) INNER JOIN sys.foreign_keys (NOLOCK) ON k.constraint_object_id = [object_id] AND k.constraint_object_id = FKC.constraint_object_id ORDER BY constraint_column_id FOR XML PATH('')), 2, 8000) AS [parent_columns] FROM sys.foreign_key_columns FKC (NOLOCK) INNER JOIN sys.objects o (NOLOCK) ON FKC.parent_object_id = o.[object_id] INNER JOIN sys.tables mst (NOLOCK) ON mst.[object_id] = o.[object_id] INNER JOIN sys.schemas t (NOLOCK) ON t.[schema_id] = mst.[schema_id] INNER JOIN sys.objects so (NOLOCK) ON FKC.referenced_object_id = so.[object_id] WHERE o.type = 'U' AND so.type = 'U' GROUP BY o.[schema_id],so.[schema_id],FKC.parent_object_id,constraint_object_id,referenced_object_id,t.name ) fk WHERE NOT EXISTS (SELECT 1 FROM ( SELECT t.name AS schemaName, OBJECT_NAME(mst.[object_id]) AS objectName, SUBSTRING(( SELECT ',' + RTRIM(ac.name) FROM sys.tables AS st INNER JOIN sys.indexes AS mi ON st.[object_id] = mi.[object_id] INNER JOIN sys.index_columns AS ic ON mi.[object_id] = ic.[object_id] AND mi.[index_id] = ic.[index_id] INNER JOIN sys.all_columns AS ac ON st.[object_id] = ac.[object_id] AND ic.[column_id] = ac.[column_id] WHERE i.[object_id] = mi.[object_id] AND i.index_id = mi.index_id AND ic.is_included_column = 0 ORDER BY ac.column_id FOR XML PATH('')), 2, 8000) AS KeyCols FROM sys.indexes AS i INNER JOIN sys.tables AS mst ON mst.[object_id] = i.[object_id] INNER JOIN sys.schemas AS t ON t.[schema_id] = mst.[schema_id] WHERE i.[type] IN (1,2,5,6) AND i.is_unique_constraint = 0 AND mst.is_ms_shipped = 0 ) ict WHERE fk.parent_schema_name = ict.schemaName AND fk.parent_table_name = ict.objectName AND REPLACE(fk.parent_columns,' ,',',') = ict.KeyCols);",
|
|
"columnName": "ConstraintName",
|
|
"convertToString": true
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.Hints.InstanceStatistics": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"implementation": {
|
|
"query": "SELECT COUNT([counter]) AS [HintUsageCount] FROM [sys].[dm_exec_query_optimizer_info] WHERE ([counter] = 'order hint' OR [counter] = 'join hint') AND occurrence > 1;"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.Hints.ModuleUsage": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"implementation": {
|
|
"query": "USE [@DatabaseName]; SELECT ss.name AS [Schema_Name], so.name AS [Object_Name], so.type_desc, CASE WHEN sm.[definition] LIKE '%FORCE ORDER%' THEN '[FORCE ORDER Hint]' WHEN sm.[definition] LIKE '%MERGE JOIN%' OR sm.[definition] LIKE '%LOOP JOIN%' OR sm.[definition] LIKE '%HASH JOIN%' THEN '[JOIN Hint]' END AS Hint FROM [sys].[sql_modules] AS sm INNER JOIN [sys].[objects] AS so ON sm.[object_id] = so.[object_id] INNER JOIN [sys].[schemas] AS ss ON so.[schema_id] = ss.[schema_id] WHERE (sm.[definition] LIKE '%FORCE ORDER%' OR sm.[definition] LIKE '%MERGE JOIN%' OR sm.[definition] LIKE '%LOOP JOIN%' OR sm.[definition] LIKE '%HASH JOIN%') AND OBJECTPROPERTY(sm.[object_id],'IsMSShipped') = 0;"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.CachedPlans.SingleUseRatio": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Server",
|
|
"platform": "Windows"
|
|
},
|
|
"implementation": {
|
|
"query": "DECLARE @Size1 AS REAL, @Size2 AS REAL; SET @Size1=COALESCE((SELECT SUM(CAST(size_in_bytes AS bigint)) AS Size1 FROM [sys].[dm_exec_cached_plans] (NOLOCK) WHERE cacheobjtype LIKE '%Plan%' AND usecounts = 1),0);SET @Size2=COALESCE((SELECT SUM(CAST(size_in_bytes AS bigint)) AS Size2 FROM [sys].[dm_exec_cached_plans] (NOLOCK) WHERE cacheobjtype LIKE '%Plan%' AND usecounts > 1),0);SELECT @Size1/(@Size1+@Size2) AS [SingleUsePlansUseRatio];"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.Hypothetical.Indices": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"implementation": {
|
|
"query": "USE [@DatabaseName]; SELECT QUOTENAME(t.name) AS [Schema], QUOTENAME(o.[name]) AS [Object], i.name AS [IndexName] FROM [sys].[indexes] i INNER JOIN [sys].[objects] AS o ON o.[object_id] = i.[object_id] INNER JOIN [sys].[tables] AS mst ON mst.[object_id] = i.[object_id] INNER JOIN [sys].[schemas] AS t ON t.[schema_id] = mst.[schema_id] WHERE i.is_hypothetical = 1;"
|
|
}
|
|
}
|
|
],
|
|
"Microsoft.Hypothetical.Statistics": [
|
|
{
|
|
"type": "SQL",
|
|
"target": {
|
|
"type": "Database",
|
|
"platform": "Windows"
|
|
},
|
|
"implementation": {
|
|
"query": "USE [@DatabaseName]; SELECT QUOTENAME(t.name) AS [Schema], QUOTENAME(o.[name]) AS [Object], s.name AS [StatName] FROM [sys].[stats] s INNER JOIN [sys].[objects] AS o (NOLOCK) ON o.[object_id] = s.[object_id] INNER JOIN [sys].[tables] AS mst (NOLOCK) ON mst.[object_id] = s.[object_id] INNER JOIN [sys].[schemas] AS t (NOLOCK) ON t.[schema_id] = mst.[schema_id] WHERE (s.name LIKE 'hind_%' OR s.name LIKE '_dta_stat%') AND auto_created = 0 AND s.name NOT IN (SELECT name FROM sys.indexes);"
|
|
}
|
|
}
|
|
],
|
|
"SQLServerVersion": [
|
|
{
|
|
"type": "CLR",
|
|
"name": "SQLServerVersion",
|
|
"implementation": {
|
|
"class": "Microsoft.SqlServer.Management.Assessment.Probes.ServerVersionProbe"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|