mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Moved link to second notebook higher, to make it more obvious how to continue this learning path.
115 lines
4.8 KiB
Plaintext
115 lines
4.8 KiB
Plaintext
{
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"name": "powershell",
|
|
"display_name": "PowerShell"
|
|
},
|
|
"language_info": {
|
|
"name": "powershell",
|
|
"codemirror_mode": "shell",
|
|
"mimetype": "text/x-sh",
|
|
"file_extension": ".ps1"
|
|
}
|
|
},
|
|
"nbformat_minor": 2,
|
|
"nbformat": 4,
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"source": [
|
|
"# SQL Assessment API Quick Start\r\n",
|
|
"## Assess your SQL Server configuration for best practices in 2 simple steps"
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "a49ad7c3-e68e-4829-bcec-0bfc9115e476"
|
|
}
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"source": [
|
|
"### 1. Setup\r\n",
|
|
"You need to install PowerShell SqlServer module using the following command. It is a good practice to run Import-Module at the beginning of your session as well. Get-Module will show you the version you have installed. The minimum version you want is 21.1.18206 — it is the version of SqlServer module containing SQL Assessment API GA."
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "2060c61e-6488-4b54-8aa8-8604a6159c0c"
|
|
}
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"source": [
|
|
"# Uncomment and run Install-Module only the first time \r\n",
|
|
"# Install-Module -Name SqlServer -AllowClobber -Force\r\n",
|
|
"Import-Module -Name SqlServer\r\n",
|
|
"Get-Module"
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "d16282b0-a7fe-4f94-aa23-88b773dd0329"
|
|
},
|
|
"outputs": [],
|
|
"execution_count": 4
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"source": [
|
|
"### 2. Invoke an assessment\r\n",
|
|
"This command runs an assessment against your local SQL Server instance.\r\n",
|
|
""
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "69d60fd2-727d-4b30-b723-b217fa8ea128"
|
|
}
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"source": [
|
|
"Get-SqlInstance -ServerInstance 'localhost' | Invoke-SqlAssessment"
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "7468c134-77ff-4786-a795-a3767b55bd3b"
|
|
},
|
|
"outputs": [],
|
|
"execution_count": 5
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"source": [
|
|
"\r\n",
|
|
"You will see in the results that each rule has some properties (not the full list):\r\n",
|
|
"- Severity (info, warning, critical) \r\n",
|
|
"- Message property explains the recommendation but if you need more info, there is a HelpLink property that points at documentation on the subject.\r\n",
|
|
"- Origin shows which ruleset and version the recommendation is coming from\r\n",
|
|
"\r\n",
|
|
"Visit SQL Assessment API GitHub page at http://aka.ms/sql-assessment-api for a full list of rules and properties.\r\n",
|
|
"\r\n",
|
|
"If you want to get recommendations for all databases on the local instance, you can run this command."
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "546c7f04-c14f-449d-ba34-53bc52e545a5"
|
|
}
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"source": [
|
|
"Get-SqlDatabase -ServerInstance 'localhost' | Invoke-SqlAssessment"
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "bbe2ef33-c5db-4a64-bb32-cd93b906c48d"
|
|
},
|
|
"outputs": [],
|
|
"execution_count": 6
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"source": [
|
|
"### Learn more about SQL Assessment API\r\n",
|
|
"To learn more about SQL Assesment API such as customizing and extending the rule set, saving the results in a table, etc., please visit:\r\n",
|
|
"- Continue learning more about SQL Assessments with the ➡ [SQL Assessment API Tutorial notebook](https://github.com/microsoft/sql-server-samples/blob/master/samples/manage/sql-assessment-api/notebooks/SQLAssessmentAPITutorialNotebook.ipynb)\r\n",
|
|
"- Docs online page: https://docs.microsoft.com/sql/sql-assessment-api/sql-assessment-api-overview \r\n",
|
|
"- GitHub repo: http://aka.ms/sql-assessment-api"
|
|
],
|
|
"metadata": {
|
|
"azdata_cell_guid": "180b3a6d-1dab-4641-acd4-dc319e81ef1f"
|
|
}
|
|
}
|
|
]
|
|
} |