使用迁移仪表板跟踪大规模 SQL Server 实例的迁移过程 - 由 Azure Arc 启用的 SQL Server(预览版)

适用于:SQL Server

迁移仪表板是一个方便的视图,显示 Azure Arc 启用的所有 SQL Server 实例及其迁移准备情况。 由 Azure Arc 启用的 SQL Server 会自动生成迁移到 Azure 的评估。 此评估对于云迁移和现代化旅程的成功具有至关重要的作用。 使用此仪表板,可以大规模跟踪迁移过程。 就绪情况被投影为 Azure 管理平面中的属性,允许使用 Azure 原生的组织、标记和查询功能。

注释

作为预览版功能,本文中介绍的技术受制于 Microsoft Azure 预览版补充使用条款

可以在已启用 Azure Arc 的 SQL Server 的发行说明中找到最新更新。

仪表板提供:

  • 已发现的 SQL Server 实例和数据库的概述。
  • 包含生成的评估的 SQL Server 实例的概述。
  • 每个 Azure SQL 产品/服务的迁移就绪情况摘要。
  • 丰富的筛选功能,使你可以根据需求定制视图。

审查迁移评估

可按如下所示访问迁移仪表板:

  • 在 Azure 门户中,搜索 Azure Arc 并导航到 Arc 中心。
  • 在左侧功能区中,展开 数据服务 并导航到 SQL Server 实例
  • 现在,导航到 “迁移仪表板 ”选项卡

Azure Arc 为 SQL Server 启用的迁移仪表板的屏幕截图。

发现的 SQL Server 实例和数据库的摘要

仪表板的第一部分概述了可供你访问的所有 SQL Server 实例和数据库。 还可以按版本和版本号查看实例的分布情况。 Azure Arc 支持的 SQL Server 迁移仪表板第一部分的屏幕截图。它显示了 SQL Server 实例和数据库的清单,并按版本和版本类别分布。

SQL Server 迁移评估摘要

仪表板的此部分概述了 Azure Arc 启用的 SQL Server 实例的迁移评估和迁移准备情况。可以看到有多少实例具有可用的评估。 每个 Azure SQL 产品/服务的迁移准备情况单独显示。

Azure Arc 启用的 SQL Server 迁移仪表板第二部分的屏幕截图。其中概述了每个 Azure SQL 产品/服务的实例和数据库的迁移评估和迁移准备情况。

Azure Resource Graph 查询

Azure Resource Graph 提供高效且高性能的方法,用于查询 Azure Arc 启用的 SQL Server 实例的就绪性属性。下面是一些示例查询。

resources 
 | where type == 'microsoft.azurearcdata/sqlserverinstances' 
 | where properties.migration.assessment.assessmentUploadTime > ago(14d) and properties.migration.assessment.enabled == true and isnotnull(parse_json(properties.migration.assessment.skuRecommendationResults))
 | extend azureSqlDatabaseRecommendationStatus = tostring(properties.migration.assessment.skuRecommendationResults.azureSqlDatabase.recommendationStatus)
 | extend azureSqlManagedInstanceRecommendationStatus = tostring(properties.migration.assessment.skuRecommendationResults.azureSqlManagedInstance.recommendationStatus)
 | extend azureSqlVirtualMachineRecommendationStatus = tostring(properties.migration.assessment.skuRecommendationResults.azureSqlVirtualMachine.recommendationStatus)
 | extend serverAssessments = tostring(properties.migration.assessment.serverAssessments)
 | extend subscriptionId = extract(@"/subscriptions/([^/]+)", 1, id)
 | extend resourceGroup = extract(@"/resource[g/G]roups/([^/]+)", 1, id) 
 | mv-expand platformStatus = pack_array( 
     pack("platform", "Azure SQL Database", "status", azureSqlDatabaseRecommendationStatus),
     pack("platform", "Azure SQL Managed Instance", "status", azureSqlManagedInstanceRecommendationStatus),
     pack("platform", "Azure SQL Virtual Machine", "status", azureSqlVirtualMachineRecommendationStatus)
   )
 | extend platformIncludedString = strcat('"AppliesToMigrationTargetPlatform":', strcat('"', replace(" ", "", tolower(tostring(platformStatus["platform"]))), '"'))
 | extend platformHasIssues = tolower(serverAssessments) has tolower(platformIncludedString)                                                    
 | project Platform = tostring(platformStatus["platform"]), status = tostring(platformStatus["status"]), tostring(serverAssessments), id, platformHasIssues
 | extend finalStatus = case(
     status == "Ready" and platformHasIssues, "Ready with Conditions",
     status == "Ready", "Ready",
     status == "NotReady", "NotReady",
     isnull(status) or status !in ("Ready", "NotReady", "Ready with Conditions"), "Unknown",
     "Unknown")
 | summarize TotalAssessed = count(), Ready = countif(finalStatus == "Ready"), NotReady = countif(finalStatus == "NotReady"), 
     ReadyWithConditions = countif(finalStatus == "Ready with Conditions"), Unknown = countif(finalStatus == "Unknown")
     by Platform
az graph query -q "resources | where type =~ 'microsoft.hybridcompute/machines' | extend machineId = tolower(tostring(id)), datacenter = iif(isnull(tags.Datacenter), '', tags.Datacenter), status = tostring(properties.status) | extend mssqlinstalled = coalesce(tobool(properties.detectedProperties.mssqldiscovered),false) | extend pgsqlinstalled = coalesce(tobool(properties.detectedProperties.pgsqldiscovered),false) | extend mysqlinstalled = coalesce(tobool(properties.detectedProperties.mysqldiscovered),false) | extend osSku = properties.osSku, osName = properties.osName, osVersion = properties.osVersion | extend coreCount = tostring(properties.detectedProperties.logicalCoreCount), totalPhysicalMemoryinGB = tostring(properties.detectedProperties.totalPhysicalMemoryInGigabytes)  | extend operatingSystem = iif(isnotnull(osSku), osSku, osName) | where mssqlinstalled or mysqlinstalled or pgsqlinstalled | project id ,name, type, resourceGroup, subscriptionId, ___location, kind, osVersion, status, osSku,coreCount,totalPhysicalMemoryinGB,tags, mssqlinstalled, mysqlinstalled, pgsqlinstalled | sort by (tolower(tostring(name))) asc"