Remove extra spacing

This commit is contained in:
Lorin Thwaits
2023-02-20 19:33:29 +00:00
parent 434b798c98
commit b062f2c734
1461 changed files with 13333 additions and 76271 deletions
@@ -1,18 +1,18 @@
{
{
"schemaVersion": "1.0",
"version": "0.2",
"name": "Custom Overrides",
"rules":[
"name": "Custom Overrides",
"rules":[
{
"id": "LatestCU",
"id": "LatestCU",
"itemType": "override",
"enabled": false
},
{
"id": ["TraceFlag"],
"enabled": false
},
{
"id": ["TraceFlag"],
"itemType": "override",
"enabled": false
},
"enabled": false
},
{
"id": ["DefaultRuleset"],
"itemType": "override",
@@ -22,5 +22,5 @@
},
"enabled": false
}
]
]
}
@@ -1,7 +1,7 @@
{
"schemaVersion": "1.0",
"version": "0.2",
"name": "Custom Checks Ruleset",
"name": "Custom Checks Ruleset",
"rules":[
{
"target": {
@@ -40,6 +40,6 @@ Get-SqlDatabase -ServerInstance 'localhost' | Invoke-SqlAssessment
To learn more about SQL Assessment API such as customizing and extending the ruleset, saving the results in a table, etc., please visit:
- Docs online page: https://docs.microsoft.com/sql/sql-assessment-api/sql-assessment-api-overview
- Docs online page: https://docs.microsoft.com/sql/sql-assessment-api/sql-assessment-api-overview
- GitHub repo: http://aka.ms/sql-assessment-api
- SQL Assessment API Tutorial notebook: [SQLAssessmentAPITutorialNotebook.ipynb](./notebooks/SQLAssessmentAPITutorialNotebook.ipynb)
@@ -32,7 +32,7 @@
while (Prompt(out string? line))
{
// Use GetAssessmentResultsList to run assessment
List<IAssessmentResult> assessmentResults = string.IsNullOrWhiteSpace(line)
List<IAssessmentResult> assessmentResults = string.IsNullOrWhiteSpace(line)
? await target.GetAssessmentResultsList().ConfigureAwait(false) // all checks
: await target.GetAssessmentResultsList(line.Split()).ConfigureAwait(false); // selected checks
@@ -44,7 +44,7 @@ The next example extends the previous check with support for clustered servers.
],
"condition": [
{ "not": "@attr::service::SQLAgent" },
{
{
"ine": [
"@attr::service::SQLAgent.account",
"@localServiceAccount"
@@ -34,7 +34,7 @@ Take the following example:
"message": "Create index on @{Table} with key columns @{KeyCols}@{IncludedCols: and included columns: #}"
```
When `@IncludedCols` is empty the message would be
When `@IncludedCols` is empty the message would be
```plain
Create index on MyTable with key columns Id, Name
@@ -22,7 +22,7 @@ For example, the following rule makes a check with the `MaxMemory` ID appear in
{
"id": "MaxMemory",
"itemType": "definition",
"target":
"target":
{
"type": "Server",
"version": "[11.0,)"
@@ -47,7 +47,7 @@ Note that the rule override can modify checks for selected targets if needed. Th
{
"id": "MaxMemory",
"itemType": "override",
"targetFilter":
"targetFilter":
{
"engineEdition": "Standard"
},
@@ -57,7 +57,7 @@ Note that the rule override can modify checks for selected targets if needed. Th
{
"id": "MaxMemory",
"itemType": "override",
"targetFilter":
"targetFilter":
{
"engineEdition": "Express"
},
@@ -35,7 +35,7 @@ The `rules` and `probes` properties are optional because rules from one ruleset
implementation 2
},
],
"probe2": [
@@ -28,7 +28,7 @@ In the following example __engineEdition__ is any on-premises edition or Azure M
### name
A [string pattern](#string-pattern) for the target SQL
A [string pattern](#string-pattern) for the target SQL
Server object name. It's a database name or an instance name.
In the following example __name__ matches anything except _master_, _tempdb_, and _model_.
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="173px" preserveAspectRatio="none" style="width:273px;height:173px;background:#FFFFFF;" version="1.1" viewBox="0 0 273 173" width="273px" zoomAndPan="magnify"><defs/><g><rect fill="#F1F1F1" height="151.2656" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="251" x="10" y="10"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="39" x="15" y="26.5332">type?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="48" x="132" y="26.5332">Server</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="3" x="184" y="26.5332">|</text><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="65" x="191" y="26.5332">Database</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="10" y2="31.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="31.6094" y2="31.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="63" x="15" y="48.1426">version?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="110" x="132" y="48.1426">Version range list</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="31.6094" y2="53.2188"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="53.2188" y2="53.2188"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="107" x="15" y="69.752">engineEdition?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="64" x="132" y="69.752">Edition list</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="53.2188" y2="74.8281"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="74.8281" y2="74.8281"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="67" x="15" y="91.3613">platform?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="91.3613">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="74.8281" y2="96.4375"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="96.4375" y2="96.4375"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="47" x="15" y="112.9707">name?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="112.9707">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="96.4375" y2="118.0469"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="118.0469" y2="118.0469"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="95" x="15" y="134.5801">serverName?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="134.5801">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="118.0469" y2="139.6563"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="139.6563" y2="139.6563"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="101" x="15" y="156.1895">machineType?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="156.1895">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="139.6563" y2="161.2656"/><rect fill="none" height="151.2656" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="251" x="10" y="10"/><!--MD5=[b10fa2690d8d7a1881e1120e70bf9546]
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="173px" preserveAspectRatio="none" style="width:273px;height:173px;background:#FFFFFF;" version="1.1" viewBox="0 0 273 173" width="273px" zoomAndPan="magnify"><defs/><g><rect fill="#F1F1F1" height="151.2656" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="251" x="10" y="10"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="39" x="15" y="26.5332">type?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="48" x="132" y="26.5332">Server</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="3" x="184" y="26.5332">|</text><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="65" x="191" y="26.5332">Database</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="10" y2="31.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="31.6094" y2="31.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="63" x="15" y="48.1426">version?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="110" x="132" y="48.1426">Version range list</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="31.6094" y2="53.2188"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="53.2188" y2="53.2188"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="107" x="15" y="69.752">engineEdition?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="64" x="132" y="69.752">Edition list</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="53.2188" y2="74.8281"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="74.8281" y2="74.8281"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="67" x="15" y="91.3613">platform?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="91.3613">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="74.8281" y2="96.4375"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="96.4375" y2="96.4375"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="47" x="15" y="112.9707">name?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="112.9707">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="96.4375" y2="118.0469"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="118.0469" y2="118.0469"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="95" x="15" y="134.5801">serverName?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="134.5801">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="118.0469" y2="139.6563"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="261" y1="139.6563" y2="139.6563"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="101" x="15" y="156.1895">machineType?</text><text fill="#000000" font-family="sans-serif" font-size="14" font-style="italic" lengthAdjust="spacing" textLength="86" x="132" y="156.1895">String pattern</text><line style="stroke:#000000;stroke-width:1.0;" x1="127" x2="127" y1="139.6563" y2="161.2656"/><rect fill="none" height="151.2656" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="251" x="10" y="10"/><!--MD5=[b10fa2690d8d7a1881e1120e70bf9546]
@startjson
{
"type?": "<b>Server</b> | <b>Database</b>",
@@ -7,15 +7,15 @@
"platform?": "<i>String pattern</i>",
"name?": "<i>String pattern</i>",
"serverName?": "<i>String pattern</i>",
"machineType?": "<i>String pattern</i>"
"machineType?": "<i>String pattern</i>"
}
@end
PlantUML version 1.2022.7(Mon Aug 22 20:01:30 TRT 2022)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
PlantUML version 1.2022.7(Mon Aug 22 20:01:30 TRT 2022)
(GPL source distribution)
Java Runtime: Java(TM) SE Runtime Environment
JVM: Java HotSpot(TM) 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

@@ -8,7 +8,7 @@
"<i>rule B</i>",
"<i>rule C</i>",
"…"
],
"probes?":{
"<i>probe 1</i>": [
@@ -6,6 +6,6 @@
"platform?": "<i>String pattern</i>",
"name?": "<i>String pattern</i>",
"serverName?": "<i>String pattern</i>",
"machineType?": "<i>String pattern</i>"
"machineType?": "<i>String pattern</i>"
}
@end
@@ -25,17 +25,17 @@ PS:> Get-SqlInstance -ServerInstance localhost | Invoke-SqlAssessment
TargetPath: Server[@Name='LOCAL']
Sev. Message Check ID Origin
---- ------- -------- ------
Sev. Message Check ID Origin
---- ------- -------- ------
Info Enable trace flag 834 to use large-page allocations to improve TF834 Microsoft Ruleset 0.1.202
analytical and data warehousing workloads.
analytical and data warehousing workloads.
Low Detected deprecated or discontinued feature uses: String literals DeprecatedFeatures Microsoft Ruleset 0.1.202
as column aliases, syscolumns, sysusers, SET FMTONLY ON, XP_API,
Table hint without WITH, More than two-part column name. We
recommend to replace them with features actual for SQL Server
version 14.0.1000.
as column aliases, syscolumns, sysusers, SET FMTONLY ON, XP_API,
Table hint without WITH, More than two-part column name. We
recommend to replace them with features actual for SQL Server
version 14.0.1000.
Medi Amount of single use plans in cache is high (100%). Consider PlansUseRatio Microsoft Ruleset 0.1.202
enabling the Optimize for ad hoc workloads setting on heavy OLTP
enabling the Optimize for ad hoc workloads setting on heavy OLTP
ad-hoc workloads to conserve resources.
...
```
@@ -58,7 +58,7 @@ Get-SqlDatabase -ServerInstance 'localhost' | Invoke-SqlAssessment
To learn more about the SQL Assessment API such as customizing and extending rulesets, saving results to a table, etc., visit:
- Docs online page for SQL Assessment API PowerShell cmdlets: https://docs.microsoft.com/sql/sql-assessment-api/sql-assessment-api-overview
- Docs online page for SQL Assessment API PowerShell cmdlets: https://docs.microsoft.com/sql/sql-assessment-api/sql-assessment-api-overview
- [SQL Assessment User Guide](UserGuide/README.md)
- SQL Assessment API Tutorial notebook: [SQLAssessmentAPITutorialNotebook.ipynb](./notebooks/SQLAssessmentAPITutorialNotebook.ipynb)
- Azure Data Studio extension: https://techcommunity.microsoft.com/t5/sql-server/released-sql-server-assessment-extension-for-azure-data-studio/ba-p/1470603
@@ -5,7 +5,7 @@ With SQL Assessment cmdlets, you can assess an instance of SQL Server on an Azur
To use such rules, do the following:
1. Make sure that both the [Azure PowerShell module](https://aka.ms/AAbdhwk) and the [Az.ResourceGraph module](https://www.powershellgallery.com/packages/Az.ResourceGraph) are installed.
2. [Sign in with Azure PowerShell](https://aka.ms/AAbdogm) before invoking SQL Assessment against SQL Server on an Azure VM.
**NOTE:** It is possible to use Azure account connection persisted between PowerShell sessions, i.e. invoke **Connect-AzAccount** in one session and omit this command later. However, in such a scenario, SQL Assessment cmdlets need the **Az.ResourceGraph** module to be imported explicitly by running **Import-Module Az.ResourceGraph**.
@@ -32,7 +32,7 @@ The following example shows how to invoke assessment for SQL Server on an Azure
$cred = Get-Credential
```
4. Select SQL Server objects to assess. For example, the following command gets a SQL Server instance.
4. Select SQL Server objects to assess. For example, the following command gets a SQL Server instance.
```PowerShell
$target = Get-SqlInstance -ServerInstance "Computer002\InstanceName" -Credential $cred
@@ -51,12 +51,12 @@ As a result, you would get an output similar to the following one.
```
TargetPath : Server[@Name='ContosoAzureSQL']
Sev. Message Check ID Origin
---- ------- -------- ------
Sev. Message Check ID Origin
---- ------- -------- ------
Medi Amount of single use plans in cache is high (100%). Consider PlansUseRatio Microsoft Ruleset 0.1.202
enabling the Optimize for ad hoc workloads setting on heavy OLTP
ad-hoc workloads to conserve resources
Low Use memory optimized virtual machine sizes for the best AzSqlVmSize Microsoft Ruleset 0.1.202
enabling the Optimize for ad hoc workloads setting on heavy OLTP
ad-hoc workloads to conserve resources
Low Use memory optimized virtual machine sizes for the best AzSqlVmSize Microsoft Ruleset 0.1.202
performance of SQL Server workloads
```
@@ -18,5 +18,5 @@ The following steps are required to enable [xp_cmdshell](https://docs.microsoft.
``` sql
EXECUTE sp_configure 'xp_cmdshell', 0;
RECONFIGURE
RECONFIGURE
```
@@ -11,7 +11,7 @@ Takes all data rows returned from probes or previous transformations and calcula
## Grouping
By default aggregate functions are applied to all data records returned by probes or previous transformations. Optionally, aggregates may be applied to groups of rows having the same value(s) in selected column(s). it works much like `GROUP BY` T-SQL clause.
By default aggregate functions are applied to all data records returned by probes or previous transformations. Optionally, aggregates may be applied to groups of rows having the same value(s) in selected column(s). it works much like `GROUP BY` T-SQL clause.
## Example 1
@@ -144,7 +144,7 @@ The following JSON object represents a complete rule set using performance count
"type": "performance",
"counters": {
"transactions_sec": {
"type": "rate",
"type": "rate",
"instance": "_Total"
}
}
@@ -160,7 +160,7 @@ Condition expressions can be any expressions or an array of expressions. An arra
{"@version": "10.50.0"},
{"@memroySize": 4096}
]
}
}
```
Note: The short version for "OR" works only as condition expressions while the short version for "AND" works everywhere. The following expressions are equivalent:
@@ -199,7 +199,7 @@ The following JSON object represents a complete rule set using performance count
"type": "performance",
"counters": {
"transactions_sec": {
"type": "rate",
"type": "rate",
"instance": "_Total"
}
}
@@ -14,20 +14,20 @@ The following is an example of a rule:
```json
{
//Target describes a SQL Server object the check is supposed to run against
"target":
{
"target":
{
//This check targets an object of the Database type
"type": "Database",
//Applies to SQL Server 2016 and higher
//Another example: "[12.0,13.0)" reads as "any SQL Server version >= 12.0 and < 13.0"
"version": "[13.0,)",
"version": "[13.0,)",
//Applies to SQL Server on Windows and Linux
"platform": "Windows, Linux",
"platform": "Windows, Linux",
//Applies to SQL on Premises and Azure SQL Managed Instance. Here you can also filter specific editions of SQL Server
"engineEdition": "OnPremises, ManagedInstance",
"engineEdition": "OnPremises, ManagedInstance",
//Applies to any database excluding master, tempdb, and msdb
"name": { "not": "/^(master|tempdb|model)$/" }
@@ -50,15 +50,15 @@ The following is an example of a rule:
//Usually, it's for recommendation what user should do if the rule raises up an alert
"message": "Make sure Query Store actual operation mode is 'Read Write' to keep your performance analysis accurate",
//Reference material
"helpLink": "https://docs.microsoft.com/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store",
//List of probes that are used to get the required data for this check. See below to know more about probes.
"probes": [ "Custom_DatabaseConfiguration" ],
"probes": [ "Custom_DatabaseConfiguration" ],
//Condition object is to define "good" and "bad" state, the latter is when the rule should raise an alert. When the condition is true, it means that the checked object complies with the best practice or policy. Otherwise, the rule raises an alert (it actually adds its message to the resulting set of recommendations)
"condition":
"condition":
{
//It means that the variable came from the probe should be equal to 2
"equal": [ "@query_store_state", 2 ]
@@ -77,11 +77,11 @@ The following is an example of a probe:
//Probe name is used to reference the probe from a rule
//Probe can have a few implementations that will be used for different targets
//This probe has two implementations for different version of SQL Server
"Custom_DatabaseConfiguration":
"Custom_DatabaseConfiguration":
[
{
//Probe uses a T-SQL query to get the required data. Use 'CLR' for assemblies.
"type": "SQL",
"type": "SQL",
//Probes have their own target, usually to separate implementation for different versions, editions, or platforms. Probe targets work the same way as rule targets do.
"target":
@@ -95,7 +95,7 @@ The following is an example of a probe:
},
//Implementation object with a T-SQL query. This probe is used in many rules, that's why the query return so many fields
"implementation":
"implementation":
{
"query": "SELECT db.is_auto_create_stats_on, db.is_auto_update_stats_on, 0 AS query_store_state, db.collation_name, (SELECT collation_name FROM master.sys.databases (NOLOCK) WHERE database_id = 1) AS master_collation, db.is_auto_close_on, db.is_auto_shrink_on, db.page_verify_option, db.is_db_chaining_on, NULL AS is_auto_create_stats_incremental_on, db.is_trustworthy_on, db.is_parameterization_forced FROM [sys].[databases] (NOLOCK) AS db WHERE db.[name]=@TargetName"
}
@@ -104,19 +104,19 @@ The following is an example of a probe:
//This implementation object is to get the required data from SQL Server 2014 (look at target.version)
{
"type": "SQL",
"target":
"target":
{
"type": "Database",
"version": "[12.0, 13.0)",
"platform": "Windows, Linux",
"engineEdition": "OnPremises, ManagedInstance"
},
"implementation":
"implementation":
{
"query": "SELECT db.is_auto_create_stats_on, db.is_auto_update_stats_on, 0 AS query_store_state, db.collation_name, (SELECT collation_name FROM master.sys.databases (NOLOCK) WHERE database_id = 1) AS master_collation, db.is_auto_close_on, db.is_auto_shrink_on, db.page_verify_option, db.is_db_chaining_on, db.is_auto_create_stats_incremental_on, db.is_trustworthy_on, db.is_parameterization_forced FROM [sys].[databases] (NOLOCK) AS db WHERE db.[name]=@TargetName"
}
},
//This implementation object is to get the required data from SQL Server 2016 and up (look at target.version)
{
"type": "SQL",
@@ -127,10 +127,10 @@ The following is an example of a probe:
"platform": "Windows, Linux",
"engineEdition": "OnPremises, ManagedInstance"
},
"implementation":
"implementation":
{
//Use this key if your query requires to run on a database that is being assessed (it's a replacement for 'USE <DATABASENAME>;')
"useDatabase": true,
"useDatabase": true,
"query": "SELECT db.is_auto_create_stats_on, db.is_auto_update_stats_on, (SELECT CAST(actual_state AS DECIMAL) FROM [sys].[database_query_store_options]) AS query_store_state, db.collation_name, (SELECT collation_name FROM master.sys.databases (NOLOCK) WHERE database_id = 1) AS master_collation, db.is_auto_close_on, db.is_auto_shrink_on, db.page_verify_option, db.is_db_chaining_on, db.is_auto_create_stats_incremental_on, db.is_trustworthy_on, db.is_parameterization_forced FROM [sys].[databases] (NOLOCK) AS db WHERE db.[name]=@TargetName"
}
}
@@ -5,32 +5,32 @@ You can silence specific rules when they aren't applied to your environment or u
The following is an example consisting of three rules. The first rule shows how to disable the check by specifying its ID, the second example disables all checks that have the **TraceFlag** tag, and the third example disables all checks from the default ruleset using the **DefaultRuleset** tag for databases **DBName1** and **DBName2**.
```json
{
{
"schemaVersion": "1.0",
"version": "0.2",
"name": "Custom Overrides",
"name": "Custom Overrides",
"rules":
[
[
{
"id": "LatestCU",
"id": "LatestCU",
"itemType": "override",
"enabled": false
},
{
"id": ["TraceFlag"],
"enabled": false
},
{
"id": ["TraceFlag"],
"itemType": "override",
"enabled": false
},
"enabled": false
},
{
"id": ["DefaultRuleset"],
"itemType": "override",
"targetFilter":
"targetFilter":
{
"type": "Database",
"name": [ "DBName1", "DBName2" ]
},
"enabled": false
}
]
]
}
```
@@ -35,7 +35,7 @@ Let's say you need to change this rule to validate backups that were created mor
"name": "Backup Policy",
//Sets the override for the specified rule
"rules":
"rules":
[
{
//Sets the type, which is 'override'
@@ -2,7 +2,7 @@
"schemaVersion": "1.0",
"version": "1.1",
"name": "Custom Ruleset",
"rules":[
"rules":[
{
"target": {
"type": "Database",
@@ -34,7 +34,7 @@
"platform": [ "Windows", "Linux" ]
},
"implementation": {
"useDatabase": true,
"useDatabase": true,
"query": "SELECT (total - used)/total AS space_available_rel, total as space_total, used as space_used, total - used as space_available FROM ( SELECT SUM(a.size)/128.0 AS total, SUM(fileproperty(a.name,'SpaceUsed'))/128.0 AS used FROM dbo.sysfiles a WHERE groupid <> 0)data;"
}
}
@@ -2,7 +2,7 @@
"schemaVersion": "1.0",
"version": "1.2",
"name": "Custom Ruleset 2",
"rules":[
"rules":[
{
"id": "DBSpaceAvailable",
"itemType": "override",
@@ -1,6 +1,6 @@
# Release notes for SQL Assessment API
This article provides details about updates, improvements, and bug fixes for the current and previous versions of SQL Assessment API.
This article provides details about updates, improvements, and bug fixes for the current and previous versions of SQL Assessment API.
To start working with the API, install the SQL Assessment Extention to Azure Data Studio or utilize either the SqlServer module or SMO.
@@ -268,9 +268,9 @@ Version: SqlServer PowerShell module wasn't updated, SqlManagementObjects (SMO)
### Bug fixes and improvements
- Updated the 'LatestCU' rule with the latest CU versions
- Updated the 'ReplErrors24H' rule to collect information for all 'Publisher' databases
- Fixed an issue with local variables used for displaying extended details in messages
- Updated the 'LatestCU' rule with the latest CU versions
- Updated the 'ReplErrors24H' rule to collect information for all 'Publisher' databases
- Fixed an issue with local variables used for displaying extended details in messages
- Fixed an issue with the wrong Linux target type for the 'PriorityBoostOn' rule
## December 2020 - 1.0.302
@@ -311,7 +311,7 @@ Version: SqlServer module 21.1.18226, SqlManagementObjects (SMO) package wasn't
- Added new types of probes in addition to SQL and EXTERNAL: CMDSHELL, WMI, REGISTRY, POWERSHELL
- Enabling/disabling database checks for particular SQL Server instances (by instance name)
- Added 40 rules, including
- Added 40 rules, including
- Ad Hoc Distributed Queries are enabled
- Affinity Mask and Affinity I/O Mask overlapping
- Auto Soft NUMA should be enabled