使用 SQL Insights (預覽版) 建立警示

適用於:Azure SQL DatabaseAzure SQL 受控執行個體

SQL Insights (預覽版) 包含一組警示規則範本,可用來在 Azure 監視器中建立警示規則,以解決常見的 SQL 問題。 SQL Insights (預覽版) 中的警示規則是以 Azure 監視器記錄中 InsightsMetrics 資料表所儲存的效能資料為基礎的記錄警示規則。

注意

若要使用 Resource Manager 範本為 SQL Insights (預覽版) 建立警示,請參閱 SQL Insights (預覽版) 的 Resource Manager 範本範例

注意

如果您有更多 SQL Insights (預覽版) 警示規則範本的要求,請使用此頁面底部的連結或使用 Azure 入口網站 中的 SQL Insights (預覽版) 意見反應連結傳送意見反應。

啟用警示規則

使用下列步驟,從 Azure 入口網站啟用 Azure 監視器中的警示。 所建立的警示規則會限定在所選監視設定檔下監視的所有 SQL 資源範圍內。 當觸發警示規則時,它會在特定 SQL 執行個體或資料庫上觸發。

注意

您也可以藉由在 InsightsMetrics 資料表中的資料集上執行查詢,然後將這些查詢儲存為警示規則,來建立自訂記錄警示規則

從 Azure 入口網站中 [Azure 監視器] 功能表的 [深入解析] 區段中,選取 [SQL (預覽版)]。 選取 [警示]

Screenshot of the Azure Monitor page for SQL in the Azure portal. The Alerts button is highlighted.

[警示]窗格會在頁面的右側開啟。 根據預設,它會以您已經建立的警示規則為基礎,顯示選取的監視設定檔中的 SQL 資源引發警示。 選取 [警示範本],其中會顯示可用來建立警示規則的可用範本清單。

Screenshot of the Alerts page for Azure Monitor in the Azure portal. In the tab for Alert templates, a Create rule link for one of the alerts is highlighted.

在 [建立警示規則] 頁面上,檢閱規則的預設設定,並視需要加以編輯。 您也可以選取 [動作群組],建立觸發警示規則時的通知和動作。 選取 [啟用警示規則],在您驗證其所有屬性之後建立警示規則。

Screenshot of the Alert rules page for Azure Monitor in the Azure portal. The Create Alert rule (step 1 of 2) page shows the thresholds to use for alerts, the name and severity of the alert, and an alert group for notifications (optional).

若要立即部署警示規則,請選取 [部署警示規則]。 如果您想要在實際部署規則範本之前檢視規則範本,請選取 [檢視範本]。

Screenshot of the Deploy alert rule page for Azure Monitor in the Azure portal. The Create Alert rule (step 2 of 2) page shows 'Ready to deploy your log alert' and the Deploy alert rule button is highlighted.

如果您選擇檢視範本,請從範本頁面選取 [部署] 以建立警示規則。

Screenshot of the Deploy from view template page for Azure Monitor in the Azure portal, displaying the json of the alert. The Deploy menu button is highlighted.

下一步

深入了解 Azure 監視器中的警示