sql azure 语法

In this article, we will explore SQL Server Profiler in Azure Data Studio in detail including download and installation, execution plans, coding T-SQL and more.

在本文中,我们将详细介绍Azure Data Studio中SQL Server Profiler,包括下载和安装,执行计划,编码T-SQL等。

Microsoft launched the cross-platform tool, which can be installed on the Windows, Linux and the MacOS. Previously its public preview launched on 15th November 2017 as SQL Operations Studio. Recently in Ignite 2018 event, Microsoft launched its general availability version on 24th September 2018 as Azure Data Studio. We can manage both the on-premises as well as the cloud database using this tool.

微软推出了跨平台工具,该工具可以安装在Windows,Linux和MacOS上。 之前,其公开预览版于2017年11月15日作为SQL Operations Studio启动。 最近在Ignite 2018活动中,Microsoft在2018年9月24日启动了其通用版本,即Azure Data Studio。 使用此工具,我们可以管理本地和云数据库。

We are getting the monthly release of the Azure Data Studio. In this article, I am using the November release of Azure Data Studio on Windows OS. The latest version of Azure Data Studio is 1.2.4.

我们将获得Azure Data Studio的每月版本。 在本文中,我正在使用Windows OS上的Azure Data Studio的十一月发行版。 最新版本的Azure Data Studio是1.2.4。

Get details of the installed Azure Data Studio from ‘ Help->about.’

从“帮助->关于”获取已安装的Azure Data Studio的详细信息。

You can download Azure Data Studio using the Microsoft docs. Download the tool as per the platform you have and install it accordingly.

您可以使用Microsoft文档下载Azure Data Studio。 根据您所拥有的平台下载该工具,然后进行相应安装。

Azure Data Studio allows adding functionality into this tool with extensions. We have many extensions available in the marketplace to download and install without any cost. Few important extensions in Azure Data Studio are as below:

Azure Data Studio允许通过扩展将此功能添加到此工具中。 我们在市场上有许多扩展程序可以免费下载和安装。 Azure Data Studio中的几个重要扩展如下:

  • SQL Server 2019 (preview): this extension provides support for the SQL Server 2019 features and enhancements including big data clusters, enhanced PolyBase, Azure notebook etc SQL Server 2019(预览版):此扩展提供对SQL Server 2019功能和增强功能的支持,包括大数据群集,增强的PolyBase,Azure笔记本等
  • SQL Server Agent: We can manage SQL Server jobs using this extension SQL Server代理:我们可以使用此扩展名管理SQL Server作业
  • Whoisactive: We can monitor and troubleshoot performance issue with this extension that runs a sp_whoIsActive stored procedure Whoisactive:我们可以使用运行sp_whoIsActive存储过程的此扩展监视和解决性能问题
  • Server Reports: We can view the server reports such as DB space usage, DB buffer usage, CPU utilization, backup growth trend using this extension 服务器报告:使用此扩展程序,我们可以查看服务器报告,例如数据库空间使用率,数据库缓冲区使用率,CPU使用率,备份增长趋势
  • Redgate SQL Search: we can search objects across multiple databases using this extension. Redgate SQL Search:使用此扩展,我们可以跨多个数据库搜索对象。
  • SQL Server Profiler: We can monitor SQL Server using this extension SQL Server Profiler:我们可以使用此扩展监视SQL Server

SQL Server探查器 (SQL Server Profiler)

SQL Server Profiler extension gives us feasibility to monitor or trace SQL Server. We can use this tool to identify problematic queries, slow running queries, monitor SQL Server performance, capture data using performance counter etc.

SQL Server Profiler扩展使我们可以监视或跟踪SQL Server。 我们可以使用此工具来识别有问题的查询,运行缓慢的查询,监视SQL Server性能,使用性能计数器捕获数据等。

First, we need to install it from the SQL Server Profiler. In the marketplace from the left menu bar, search the extension ‘SQL Server Profiler’ and Install it.

首先,我们需要从SQL Server Profiler安装它。 在市场左侧菜单栏中,搜索扩展名“ SQL Server Profiler”并安装。

It quickly installs the extension. Click on ‘Reload’ to restart the Azure Data Studio. This will activate the SQL Server Profiler extension.

它会快速安装扩展程序。 单击“重新加载”以重新启动Azure Data Studio。 这将激活SQL Server Profiler扩展。

>

>

After we restart Azure Data Studio, SQL Server Profiler extension status changes to ‘Disable or uninstall’. You can also note here that SQL Server Profiler extension is in a preview state, we might get further enhancements in coming releases.

重新启动Azure Data Studio之后,SQL Server Profiler扩展状态更改为“禁用或卸载”。 您还可以在此处注意到SQL Server Profiler扩展处于预览状态,我们可能会在后续版本中获得进一步的增强。

We can launch the SQL Server Profiler from the command pallet. Click on the View->Command Pallet -> Profiler->New Profiler

我们可以从命令托盘启动SQL Server Profiler。 单击查看->命令面板->探查器->新探查器

Alternatively, we can use the shortcut key Alt + P. It launches’ the create new profiler section’ as shown below.

或者,我们可以使用快捷键Alt +P。它将启动“创建新的探查器部分”,如下所示。

In this, we can define the session template from the drop-down list.

在此,我们可以从下拉列表中定义会话模板。

  • Standard_OnPrem: We can Monitor the SQL Server on Premise instance Standard_OnPrem:我们可以在前提实例上监视SQL Server
  • Standard_Azure: We can monitor Azure SQL DB using this template Standard_Azure:我们可以使用此模板监视Azure SQL DB
  • TSQL_OnPrem: We can monitor the transact SQL statements using this template TSQL_OnPrem:我们可以使用此模板监视事务SQL语句

Select the session template and specifies a session name. Click on Create to start the session.

选择会话模板并指定会话名称。 单击创建以开始会话。

This starts the profiler session as shown here.

如此处所示,这将启动事件探查器会话。

On top of the profiler window, we get the following menu bar.

在事件探查器窗口的顶部,我们得到以下菜单栏。

  • Start: If the profiler session is already running, it is disabled 开始:如果事件探查器会话已在运行,则将其禁用
  • Stop: Click on ‘stop’ to stop capturing the details 停止:单击“停止”以停止捕获详细信息
  • Pause Capture: We can pause the trace session using this option. While the session is pause state, it will not capture the event until it is resumed 暂停捕获:我们可以使用此选项暂停跟踪会话。 当会话处于暂停状态时,它将不会捕获事件,直到恢复为止
  • Auto Scroll – On: it automatically scrolls down the captured events with this option. If we do not want to scroll automatically, click on it and it changes to Auto Scroll – off 自动滚动–开启:使用此选项自动向下滚动捕获的事件。 如果我们不想自动滚动,请单击它,然后将其更改为“自动滚动”。
    • Standard View 标准检视
    • TSQL View TSQL视图
    • Tuning View 调整视图
    • TSQL_Locks View TSQL_Locks视图
    • TSQL_Duration View TSQL_Duration视图

Let us view each view in below images.

让我们在下图中查看每个视图。

Standard View: In the standard view, we get complete information about the query such as CPU, Reads, Writes, Duration, Login, Text data etc.

标准视图:在标准视图中,我们获得有关查询的完整信息,例如CPU,读取,写入,持续时间,登录名,文本数据等。

In other views, we can get specific information filtered out from the standard view.

在其他视图中,我们可以从标准视图中滤除特定信息。

TSQL View: In this view, we get the details about running SQL queries.

TSQL视图:在此视图中,我们获得有关运行SQL查询的详细信息。

Tuning View: In tuning view, we get information about the duration of SQL batch and additional details such as object type, login name.

调整视图:在调整视图中,我们获得有关SQL批处理持续时间的信息以及其他详细信息,例如对象类型,登录名。

Click on the ‘Details’ to get additional information.

单击“详细信息”以获取其他信息。

TSQL_Locks Views: In this view, we can see the reads, write, duration, application name, CPU for the running t-SQL.

TSQL_Locks视图:在此视图中,我们可以查看正在运行的t-SQL的读取,写入,持续时间,应用程序名称,CPU。

TSQL_Duration View: We can view the duration information for the t-SQL.

TSQL_Duration视图:我们可以查看t-SQL的持续时间信息。

查看Azure Data Studio中的执行计划 (View the execution plan in Azure Data Studio)

We can view the execution plan as well for the queries captured in the SQL Server Profiler. In the profiler window, click on the split editor. The arrow in the screenshot highlights this icon.

我们也可以查看SQL Server Profiler中捕获的查询的执行计划。 在事件探查器窗口中,单击拆分编辑器。 屏幕截图中的箭头突出显示了此图标。

It opens up an editor window on the right side.

它会在右侧打开一个编辑器窗口。

Now, suppose we want to see the execution plan of the query captured using the profiler event.

现在,假设我们要查看使用事件探查器事件捕获的查询的执行计划。

SELECT TOP (1000) [CustomerID],[CustomerName],[CustomerCategoryName],[PrimaryContact],[AlternateContact],[PhoneNumber],[FaxNumber],[BuyingGroupName],[WebsiteURL],[DeliveryMethod],[CityName],[DeliveryLocation],[DeliveryRun],[RunPosition]FROM [WideWorldImporters].[Website].[Customers]order by customername

In the right split window, right click and then click on ‘New File’.

在右拆分窗口中,右键单击,然后单击“新文件”。

This opens us the query editor window in the split window.

这将在拆分窗口中打开查询编辑器窗口。

Now, Copy the query from the left window and paste into the right split window.

现在,从左侧窗口复制查询,然后粘贴到右侧拆分窗口中。

Click on the ‘Explain’ in the right window and you can see the execution plan from the ‘Query Plan’ option.

单击右侧窗口中的“解释”,您可以从“查询计划”选项中查看执行计划。

We can view the XML execution plan as well. Click on the ‘Results’ near to the ‘Query Plan’. You get the XML Showplan using this option.

我们也可以查看XML执行计划。 单击“查询计划”附近的“结果”。 您可以使用此选项获得XML Showplan。

Now, Click on the XML Showplan and you can view the detailed XML execution plan in the new window as shown here.

现在,单击XML Showplan,您可以在新窗口中查看详细的XML执行计划,如下所示。

As shown above, you can view the execution plan in both the graphical as well as in XML plan. Look out the operators in the execution plan and troubleshoot the issue.

如上所示,您可以在图形计划和XML计划中查看执行计划。 在执行计划中查找操作员并解决问题。

结论 (Conclusion)

SQL Server Profiler is a useful enhancement to Azure Data Studio. However, currently, in a preview state, we cannot define the custom template or events to capture the relevant data. We learned to use the SQL Server Profiler in this article. This extension might get further enhancements in an upcoming release.

SQL Server Profiler是对Azure Data Studio的有用增强。 但是,当前,在预览状态下,我们无法定义自定义模板或事件来捕获相关数据。 我们在本文中学习了使用SQL Server Profiler。 此扩展可能会在即将发布的版本中得到进一步的增强。

翻译自: https://www.sqlshack.com/sql-server-profiler-in-azure-data-studio/

sql azure 语法

sql azure 语法_Azure Data Studio中SQL Server Profiler相关推荐

  1. sql azure 语法_Azure Data Studio中SQL Server架构比较扩展

    sql azure 语法 This article explores the SQL Server Schema Compare extension in the Azure Data Studio. ...

  2. sql azure 语法_Azure Data Studio中SQL代码段

    sql azure 语法 This article will fully cover the code snippet SQL developer productivity feature in Az ...

  3. sql azure 语法_Azure中的新SQL数据仓库

    sql azure 语法 介绍 (Introduction) In previous chapters, we taught how to create SQL Databases in Azure. ...

  4. sql azure 语法_Azure Kubernetes服务(AKS)中SQL Server

    sql azure 语法 In this article, we will review how to create a Kubernetes cluster in Azure Kubernetes ...

  5. sql azure 语法_Azure SQL Server中的CREATE DATABASE语句概述

    sql azure 语法 In this article, we will review CREATE DATABASE statement in the Azure SQL database wit ...

  6. sql azure 语法_Azure Kubernetes服务(AKS)–管理SQL Server数据库文件

    sql azure 语法 In this article, we will review on managing database files of SQL Server running on Azu ...

  7. sql azure 语法_Azure SQL Server自动故障转移组

    sql azure 语法 In this article, we will review how to set up auto-failover groups in Azure SQL Server ...

  8. sql azure 语法_Azure SQL –使用Azure自动化的索引表

    sql azure 语法 This article provides an overview of indexing tables in Azure SQL database using Azure ...

  9. azure云数据库_Azure Data Studio中Windows的数据库管理工具扩展

    azure云数据库 Azure Data Studio provides a modern and productive experience for managing on-premise and ...

最新文章

  1. Windows下Anaconda2(Python2)和Anaconda3(Python3)的共存
  2. 运行Android应用时提示ADB是否存在于指定路径问题
  3. 华润网络签约神策数据 数据赋能打造跨行业综合移动服务生态圈
  4. 案例:返回固定页面的http服务器
  5. C++实现双栈结构(一个顺序表中使用两个栈)
  6. oracle sga pga mysql_修改Oracle数据库SGA和PGA大小
  7. 因为有人说的WZ132
  8. 转:Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
  9. php红色风格,PHP理财版PC+WAP安装包(红色风格+蓝色风格)
  10. Python花式编程:多层嵌套列表扁平化
  11. MySQL的一些常用命令
  12. 【渝粤题库】陕西师范大学500901 基础物理专题(力、热) 作业(专升本)
  13. 守望先锋 获取cdn配置_英特尔酷睿i5 9400F万金油配置推荐 适合吃鸡 守望先锋
  14. 步进电机功率计算公式
  15. Weekly Recap!相对不平淡的行情 相对冷淡的 DeFi 市场
  16. python设置端口控制ie浏览器_[Python爬虫] 之二:Selenium 调用IEDriverServer打开IE浏览器安装配置...
  17. Vue笔记 (二) 如何做移动端适配 让你只用关心设计稿
  18. Win10设置系统补丁更新服务器,win10如何关闭自动更新补丁_win10关闭自动更新补丁的图文教程...
  19. Vxe Table一些简单的应用和踩坑记录
  20. Linux 挂载4T硬盘到根目录

热门文章

  1. [Lintcode]66. Binary Tree Preorder Traversal/[Leetcode]144. Binary Tree Preorder Traversal
  2. 滚动页面一定距离后固定导航条
  3. SSH框架整合截图总结(三)
  4. Shell 概述、截取字符操作等
  5. 安装php扩展后,执行时找不到扩展 class xxx no found
  6. shell脚本执行时报bad interpreter: Text file busy的解决方法
  7. 关于html中css无法作用的问题
  8. hdu 1171 dp(多重背包)
  9. ES6学习(七)—Set 和 Map 数据结构
  10. JavaScript学习(十六)—实现购物车加减数量,计算总金额