Home Database Mysql Tutorial SQLSERVER2012里的扩展事件初尝试(上)

SQLSERVER2012里的扩展事件初尝试(上)

Jun 07, 2016 pm 05:37 PM
event try Expand

SQLSERVER2012里的扩展事件初尝试(上) SQLSERVER2012里的扩展事件初尝试(下) 周未看了这两篇文章: 扩展事件在Denali CTP3里的新UI(一) 扩展事件在Denali CTP3里的新UI(二) 觉得在SQLSERVER2012开始,扩展事件的管理更加容易了,之前一直没有用过扩

SQLSERVER2012里的扩展事件初尝试(上)

SQLSERVER2012里的扩展事件初尝试(下)

周未看了这两篇文章:

扩展事件在Denali CTP3里的新UI(一)

扩展事件在Denali CTP3里的新UI(二)

觉得在SQLSERVER2012开始,扩展事件的管理更加容易了,之前一直没有用过扩展事件

只是听过,看了文章的介绍,觉得扩展事件跟SQLSERVER PROFILER有很多相似之处

大家可以融会贯通

 

之前有一篇文章:扩展事件在Denali CTP1里的新功能

文章里说在SQLSERVER2012之前,扩展事件的所有操作只能用TSQL或C#代码来实现

现在SQLSERVER2012就方便多了,有了新的GUI,趋向于傻瓜了,对我来讲是好事o(∩_∩)o 哈哈

趁机学习一下扩展事件

 

简单介绍

首先打开SQLSERVER2012的SSMS,依次点击打开管理-》扩展事件-》会话

 

在会话文件夹中,点击右键-》可以新建会话/新建会话向导

在已有的会话中,点击右键-》启动会话、新建会话、导出会话、删除、属性

这些菜单已经很丰富了

 

点击-》新建会话向导 ,SQLSERVER会一步一步引导您怎麽新建一个会话

包括设置会话熟悉感、选择模板、选择要捕获的事件、选择要捕获的全局字段、设置事件会话筛选器、指定会话数据存储

这个向导我就不介绍了,我们一般都不喜欢用傻瓜的向导,生怕漏了什么东西没有设置

其实大家看到向导中要设置的步骤:选择模板、设置事件会话筛选器、选择要捕获的全局字段,有没有觉得和SQLSERVER PROFILER差不多的感觉

建立会话

我们新建一个会话

弹出 新建会话 对话框

左边有常规、事件、数据存储、高级这些tab页

等一下会陆续介绍

常规页面

输入会话名称

在sql profiler里面就是输入跟踪名称

下面有一些选项,,例如在服务器启动时启动事件会话,你可以根据自己实际情况进行勾选

大家知道开启sql profiler会对SQLSERVER的性能造成影响

那么,从下面的“在服务器启动时启动事件会话”

这里告诉我们两个信息

信息一:自动化程度高了,以往我们都是重启服务器就需要自己手动打开sql profiler来重新跟踪SQLSERVER的事件,现在有这个选项就方便多了

不用手动打开扩展事件

信息二:扩展事件对SQLSERVER的性能损耗不大

在园子里的燕洋天大侠的文章大话扩展事件第一篇:概述(上)里提到:

扩展事件的出现与设计主要是以性能为主要的出发点

我们可以使用一个文件目标对象在相关的时间发生之后将信息写入到文件中,这样就非常的轻量级了,并且可以精确到事件发生点

我们在会话名称里输入“blogtest”

会话中也提供了很多模板给我们使用

就像sql profiler里面

在文章扩展事件在Denali CTP3里的新UI(一)中也说了

我们支持与Profiler里模板类似的概念,只要选择一个模板,Event(包括Action和Predicate)和Target以及某些选项就自动选择好了

但是在CTP3里只有一个Standard模板,这个模板所选择的事件和Profiler里的Standard模板相对应

你也可以把自己创建的Session作为模板保存起来以备后用,保存模板只需要右键点击某个Session然后选择Export Session…即可

因为那篇文章出来的时候SQLSERVER2012也只是CTP3的阶段,所以那时候只有一个标准模板,现在SQLSERVER2012出来了

已经多了很多模板了

导出会话就相当于导出模板了

sql profiler里导出模板

导入会话模板

在新建会话对话框里选择模板的下拉列表有一个 

事件页面

事件页面是最复杂的,你首先看到它分为左右两部分,左边是事件库,所有在SQL Server里注册的扩展事件都列在这里,右边是你选择的事件。

在选择事件的时候,你可以点击名称列表头,进行事件名称的首字母进行顺序或者倒序排序,

类别和通道也是可以排序的

事件的类别非常多,包括cdc功能的事务日志扫描、死锁监视、高度可用性和数据的安全性(High Availability and Disaster Recovery,HADR)、垃圾回收等等

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

From start to finish: How to use php extension cURL to make HTTP requests From start to finish: How to use php extension cURL to make HTTP requests Jul 29, 2023 pm 05:07 PM

From start to finish: How to use php extension cURL for HTTP requests Introduction: In web development, it is often necessary to communicate with third-party APIs or other remote servers. Using cURL to make HTTP requests is a common and powerful way. This article will introduce how to use PHP to extend cURL to perform HTTP requests, and provide some practical code examples. 1. Preparation First, make sure that php has the cURL extension installed. You can execute php-m|grepcurl on the command line to check

Extensions and third-party modules for PHP functions Extensions and third-party modules for PHP functions Apr 13, 2024 pm 02:12 PM

To extend PHP function functionality, you can use extensions and third-party modules. Extensions provide additional functions and classes that can be installed and enabled through the pecl package manager. Third-party modules provide specific functionality and can be installed through the Composer package manager. Practical examples include using extensions to parse complex JSON data and using modules to validate data.

How to install mbstring extension under CENTOS7? How to install mbstring extension under CENTOS7? Jan 06, 2024 pm 09:59 PM

1.UncaughtError:Calltoundefinedfunctionmb_strlen(); When the above error occurs, it means that we have not installed the mbstring extension; 2. Enter the PHP installation directory cd/temp001/php-7.1.0/ext/mbstring 3. Start phpize(/usr/local/bin /phpize or /usr/local/php7-abel001/bin/phpize) command to install php extension 4../configure--with-php-config=/usr/local/php7-abel

Get upcoming calendar events on your iPhone lock screen Get upcoming calendar events on your iPhone lock screen Dec 01, 2023 pm 02:21 PM

On iPhones running iOS 16 or later, you can display upcoming calendar events directly on the lock screen. Read on to find out how it's done. Thanks to watch face complications, many Apple Watch users are used to being able to glance at their wrist to see the next upcoming calendar event. With the advent of iOS16 and lock screen widgets, you can view the same calendar event information directly on your iPhone without even unlocking the device. The Calendar Lock Screen widget comes in two flavors, allowing you to track the time of the next upcoming event, or use a larger widget that displays event names and their times. To start adding widgets, unlock your iPhone using Face ID or Touch ID, press and hold

Outlook insists on trying to connect [Fix] Outlook insists on trying to connect [Fix] Mar 13, 2024 am 09:22 AM

This article will explore the steps you can take to resolve situations where Outlook is stuck while trying to connect. No matter what version of Microsoft Office, including Microsoft 365, you may encounter this problem. This issue causes the Outlook desktop application to be unable to receive emails properly, so it becomes crucial to resolve this issue. Fix Outlook Hangs on Trying to Connect If Outlook is having trouble connecting and you find that you're not receiving new mail on the desktop app, the following suggestions may be able to help resolve the issue. Before trying these methods, check to see if your internet connection is working properly. Try restarting your router sometimes

How to use the Aurora Push extension to implement batch message push function in PHP applications How to use the Aurora Push extension to implement batch message push function in PHP applications Jul 25, 2023 pm 08:07 PM

How to use the Aurora Push extension to implement batch message push function in PHP applications. In the development of mobile applications, message push is a very important function. Jiguang Push is a commonly used message push service that provides rich functions and interfaces. This article will introduce how to use the Aurora Push extension to implement batch message push functionality in PHP applications. Step 1: Register a Jiguang Push account and obtain an API key. First, we need to register on the Jiguang Push official website (https://www.jiguang.cn/push)

In JavaScript, what is the purpose of the 'oninput' event? In JavaScript, what is the purpose of the 'oninput' event? Aug 26, 2023 pm 03:17 PM

When a value is added to the input box, the oninput event occurs. You can try running the following code to understand how to implement oninput events in JavaScript - Example<!DOCTYPEhtml><html> <body> <p>Writebelow:</p> <inputtype="text&quot

How do the types of PHP function return values ​​relate to the interoperability of PHP extensions? How do the types of PHP function return values ​​relate to the interoperability of PHP extensions? Apr 15, 2024 pm 09:06 PM

PHP function return value types can be expressed as type description syntax, which clearly specifies the return value type of each function. Understanding return value types is critical to creating extensions that are compatible with the PHP core engine, avoiding unexpected conversions, improving efficiency, and enhancing code readability. Specifically, extension functions can define a return value type so that the PHP engine can optimize code execution based on that type and allow developers to explicitly handle the return value. In practice, extension functions can return PHP objects, and PHP code can handle the returned results according to the return value type.

See all articles