SQL Server Profiler 扩展(预览版)SQL Server Profiler extension (Preview)

SQL Server Profiler 扩展(预览版)提供类似于 SQL Server Management Studio (SSMS) Profiler 的简单 SQL Server 跟踪解决方案,但前者是使用扩展事件构建的。The SQL Server Profiler extension (preview) provides a simple SQL Server tracing solution similar to SQL Server Management Studio (SSMS) Profiler except built using Extended Events. SQL Server Profiler 非常易于使用,为最常见的跟踪配置设置了很合适的默认值。SQL Server Profiler is very easy to use and has good default values for the most common tracing configurations. UX 针对事件浏览和关联 Transact-SQL (T-SQL) 文本的查看性能进行了优化。The UX is optimized for browsing through events and viewing the associated Transact-SQL (T-SQL) text. Azure Data Studio 的 SQL Server Profiler 还为实现后列操作设置了很合适的默认值:通过易于使用的 UX 收集 T-SQL 执行活动。The SQL Server Profiler for Azure Data Studio also assumes good default values for collecting T-SQL execution activities with an easy to use UX. 此扩展当前处于预览状态。This extension is currently in preview.

常见的 SQL Profiler 用例:Common SQL Profiler use-cases:

  • 逐步分析有问题的查询以找到问题的原因。Stepping through problem queries to find the cause of the problem.
  • 查找并诊断运行慢的查询。Finding and diagnosing slow-running queries.
  • 捕获导致问题的一系列 Transact-SQL 语句。Capturing the series of Transact-SQL statements that lead to a problem.
  • 监视 SQL Server 的性能以优化工作负荷。Monitoring the performance of SQL Server to tune workloads.
  • 使性能计数器与诊断问题关联。Correlating performance counters to diagnose problems.

安装 SQL Server Profiler 扩展Install the SQL Server Profiler extension

  1. 若要打开扩展管理器并访问可用扩展,请选择扩展图标,或在“视图”菜单中选择“扩展” 。To open the extensions manager and access the available extensions, select the extensions icon, or select Extensions in the View menu.

  2. 选择某个可用扩展以查看其详细信息。Select an available extension to view its details.

    Profiler 扩展管理器

  3. 选择所需的扩展并“安装”它。Select the extension you want and Install it.

  4. 选择“重新加载”以启用扩展(仅在第一次安装扩展时是必需的) 。Select Reload to enable the extension (only required the first time you install an extension).

启动 ProfilerStart Profiler

  1. 要启动 Profiler,需先在“服务器”选项卡中建立与服务器的连接。To start Profiler, first make a connection to a server in the Servers tab.

  2. 建立连接后,键入“Alt + P”启动 Profiler 。After you make a connection, type Alt + P to launch Profiler.

  3. 要启动 Profiler,请键入“Alt + S” 现在可以开始查看扩展事件。To start Profiler, type Alt + S. You can now start seeing Extended Events.

    查看探查器

  4. 要停止 Profiler,请键入“Alt + S” 。此热键是一个开关。To stop Profiler, type Alt + S. This hotkey is a toggle.

后续步骤Next steps

要了解有关 Profiler 和扩展事件的详细信息,请参阅扩展事件To learn more about Profiler and extended events, see Extended Events.