你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft Copilot skills in Azure SQL Database(预览版)

适用于:Azure SQL 数据库

Microsoft Copilot in Azure 是一款 AI 助手,旨在简化 Azure SQL 数据库驱动的应用程序的设计、操作、优化和运行状况。 它通过提供自然语言到 SQL 转换和自助数据库管理,来提高 Azure 门户的工作效率。

若要详细了解 Microsoft Copilot skills in Azure SQL Database 的当前预览版,请观看下面的视频:


注意

Copilot skills in Azure SQL Database 当前为预览版,仅面向有限数量的早期采用者。 要注册此计划,请访问请求访问 Azure SQL 数据库的 Copilot 助手:个人预览版

Copilot 为用户问题提供相关答案,通过利用数据库上下文、文档、动态管理视图、查询存储和其他知识源来简化数据库管理。 例如:

  • 数据库管理员可以独立管理数据库并解决问题,或详细了解数据库的性能和功能。
  • 开发人员可以像打字或说话一样来生成 T-SQL 查询,从而询问有关数据的问题。 开发人员还可以了解如何通过生成的查询的详细说明更快地编写查询。

Azure SQL 数据库体验

当前预览版包括两种不同的体验

  • Microsoft Copilot in Azure 集成:此体验将 Azure SQL 数据库技能添加到 Microsoft Copilot in Azure,为客户提供自我引导式协助,使他们能够独立管理数据库和解决问题。

  • 自然语言到 SQL:Azure 门户查询编辑器内的这种体验将自然语言查询转换为 SQL,使数据库交互更加直观。 有关 Azure SQL 数据库中的 Copilot 自然语言到 SQL 功能的教程和示例,请参阅 Azure 门户查询编辑器中的自然语言到 SQL(预览版)

Copilot 使用公共文档、动态管理视图、目录视图和 Azure 支持功能诊断来集成数据并制定适用的响应。

自然语言到 SQL 查询

Azure 门户查询编辑器内的这种体验利用表和视图名称、列名、主键和外键元数据来生成 T-SQL 代码。 然后,你可以查看和执行代码建议。

此集成意味着 Microsoft Copilot in Azure 可以通过以下提示回答问题:

  • Which agents have listed more than two properties for sale?
  • Tell me the rank of each agent by property sales and show name, total sales, and rank
  • 甚至高级方案,如 Show me a pivot summary table that displays the number of properties sold in each year from 2020 to 2023

有关 Azure SQL 数据库中的 Copilot 自然语言到 SQL 功能的教程和示例,请参阅 Azure 门户查询编辑器中的自然语言到 SQL(预览版)

Microsoft Copilot in Azure 增强应用场景

可以在 Azure 门户内向 Microsoft Copilot in Azure 询问并接收有用的、上下文丰富的建议。

警告

Microsoft Copilot in Azure 是一组由大型语言模型 (LLM) 提供支持的预览版体验。 Copilot 生成的输出可能包含不准确、偏见或其他意外内容。 与任何生成式 AI 模型一样,应在使用前人为查看 Copilot 生成的输出。

Microsoft Copilot in Azure 的一些示例应用场景:

  • 使用速度较慢的 Azure SQL 数据库时,可以提供提示 My database is slow

    Microsoft Copilot in Azure(预览版)开始根据 Azure 门户中的上下文查看数据库。 检查后,Copilot 将详细说明可能导致问题的具体区域。 在此示例中,有一个特定查询导致高 CPU 使用率:

    屏幕截图,其中显示了查询提示和有关高 CPU 使用率的生成示例查询。

  • 可以在 How can I tune that high CPU query? 提示下继续对话和调查。

    Copilot 了解到此提示引用了之前标识的查询,并提供了新的索引建议:

    屏幕截图,其中显示了对话中的查询提示和有关搞 CPU 使用率的生成示例查询。

示例提示

可以针对不同功能区域提供关于 Microsoft Copilot in Azure 的提示,例如:

技能名称 技能描述 示例提示
活动用户连接 显示与数据库的活动用户连接。 Who are currently actively connected to the database?
反模式查询分析 确定具有反模式的查询及其对性能的潜在影响。 Show me all the queries in my workload that have anti-patterns in them.
自动优化分析 调查自动优化失败和潜在的解决方案。 Why is automatic plan correction failing?
基本数据库信息 检索有关数据库的基本信息。 What is the name of the logical server for this database?
阻止会话分析 识别和分析阻止会话。 Check top blocking sessions.
兼容级别 提供有关数据库兼容性级别的信息。 What's the compatibility level of this database?
连接字符串生成 为数据库生成适当的连接字符串。 Which connection string should I use to connect to my DB?
助手帮助 提供有关 Azure SQL 的一般帮助和指导。 What can you do related to Azure SQL?
数据同步分析 排查数据同步问题,尤其是与辅助数据库。 Why do my secondaries not have the latest data?
数据库和表大小 提供有关数据库和表大小的信息。 What's the size of this database?
数据库性能分析 分析数据库的总体性能并提出改进建议。 Why is my database slow?
数据库权限列表 列出用户的数据库权限和访问级别。 Which users have access to master database?
死锁分析 调查死锁并提出解决方案建议。 Why am I getting deadlock errors? How can I fix it?
丢弃的连接分析 调查丢弃的数据库连接的实例。 Show me all the instances where my database had a dropped connection.
碎片索引分析 确定碎片索引及其对性能的影响。 Help me find fragmented indexes.
常规反模式信息 提供有关常见 SQL 反模式的常规信息。 What are the most common SQL anti-patterns?
获取服务器的数据库名称 列出特定服务器上的所有数据库。 List all the databases on this server.
CPU 消耗量较高的查询分析 识别和分析 CPU 使用率高的查询。 Why is the CPU usage high on this database?
索引列表 显示数据库中的所有索引。 What are all the indexes?
特定表的索引建议 为一个或多个表提供索引建议。 Should I add an index on this table?
最新备份信息 提供有关最新数据库备份的信息。 When was the most recent backup of my database created?
MAXDOP 优化 分析和建议 MAXDOP 设置的优化。 What's the current MAXDOP and how to optimize?
内存授予分析 分析内存授予问题和潜在原因。 Why am I having memory grant issues?
缺失索引建议 建议缺失索引以提高查询性能。 Missing index suggestion for improving query performance?
时间点还原保留 提供有关时间点还原保持期的信息。 How far back in time can I go for a point-in-time restore?
查询性能分析 调查运行缓慢的查询并提出解决方案。 Why is this query running so slow?
查询存储 - 查找强制计划 显示在指定时间范围内具有强制计划的查询。 Show me all the queries from the past 2 days that have forced plans.
查询存储 - 查找高执行时间变化 识别执行时间变化较大的查询。 Which queries on my database have a high variation in execution time?
查询存储 - 查找最高的 I/O 查询 显示 I/O 使用率最高的查询。 What queries on this database use the most I/O?
查询存储 - 按 ID 获取查询文本 显示基于所提供查询 ID 的查询文本 What is the query text for Query ID 1333?
查询存储 - 最新执行的查询 显示最近执行的查询。 What are the most recently executed queries in my database?
查询存储 - 运行时间最长的查询 显示在指定时间范围内运行时间最长的查询。 What are the longest running queries in the past day?
查询存储 - 等待时间最高的查询 识别等待时间最高的查询。 Which queries have had the highest wait times?
查询存储 - 具有多个计划的查询 检查是否存在具有多个执行计划的查询。 Show me the queries that have had more than one execution plan.
查询存储 - 退化的查询 识别性能退化的查询。 Have any of my queries gotten significantly slower recently?
查询存储 - 具有计划更改的退化的查询 显示具有计划更改、性能退化的查询。 Are there any queries that had plan changes and regressed in performance?
查询存储 - 显示每个查询的执行数 显示每个查询的执行数。 What queries are being executed most often?
查询存储 - 资源消耗量最大的几个查询 识别和分析资源消耗量最高的查询。 What are the most expensive queries in my workload?
查询存储模式故障排除 调查处于只读模式的查询存储并提供解决方案。 Why is Query Store in read-only mode? How can I fix it?
相关文档 基于用户的查询提供相关文档的链接。 What does database compatibility level mean?
资源使用状况分析 分析资源使用状况和潜在瓶颈。 Is the database hitting resource limits? Which limits?
表列表 列出数据库中的所有表。 What are the names of all the tables?
等待统计信息分析 分析等待统计信息和潜在性能瓶颈。 What do the wait statistics look like for my database?
工作负载增加和缩放分析 评估工作负载增加和缩放的潜在需求。 Has increased workload or traffic caused performance issues?

负责任的 AI

如需详细了解 Microsoft 如何在 Microsoft Copilot in Azure 中实现负责任 AI 工具,请参阅 Microsoft Copilot in Azure(预览版)的负责任 AI 常见问题解答