1. SQL Server服务器监控实现方法
对于服务器的监控,和对数据库的监控,很少有合二为一的工具,如果有的话,一般是付费软件,或者自行开发的工具。 所以如果不想购买软件,也不想花精力去开发的话,可以结合一些免费/开源的工具、自定义脚本,来完成对数据库服务器的监控。 一. 第三方工具 1
对于服务器的监控,和对数据库的监控,很少有合二为一的工具,如果有的话,一般是付费软件,或者自行开发的工具。
所以如果不想购买软件,也不想花精力去开发的话,可以结合一些免费/开源的工具、自定义脚本,来完成对数据库服务器的监控。
一. 第三方工具
1. 开源工具
比如:CACTI,Nagios,Zabbix等等,除了主机外,对于网络上的其他设备,比如路由器等也可以一并监控。
以CACTI为例(CACTI可以在windows下安装),服务器监控的图示:
(1) 设备状态
(2) SQL Server服务状态
(3) 服务器事件日志
(4) 磁盘空间
(5) 内存使用
(6) CPU使用
(7) 网卡使用
(8) 交换机流量
从图片中可以发现,服务器状态监控没问题,不过对于服务器性能的监控,仅仅是在磁盘空间/内存/CPU/网络带宽的使用量上面,没有细致的性能计数器信息。
这些开源的工具,香港服务器租用,大多基于SNMP协议(Simple Network Management Protocol,简单网络管理协议),该协议用以监测连接到网络上的设备状态,对于设备自身的详细性能参数,通常需要安装额外的插件来完成(这也是unix的思想 ),比如上面用到的syslog插件,用于接收windows事件日志;比如有人集成了snmptools插件,用于接受windows性能计数器信息。
2. 付费工具
不同工具,侧重点也不一样:
(1) 有的偏向主机监控,比如:MOM,SCOM,whatsup gold;
(2) 有的偏向SQL Server数据库监控,比如:Idera SQL Diagnostic Manager,SQL Sentry,Red-gate SQL Monitor;
(3) 有的是工具套件,不同功能选择其中某一款,比如:Quest Spotlight,BMC Patrol(已改名为BMC Performance Manager)
这些Windows平台的工具,大多对性能计数器支持的很好,通常是基于WMI实现的。
WMI :Windows Management Instrumentation,服务器空间,Windows 管理规范,WMI允许通过一个公共的接口访问多种操作系统构成单元,用户可以使用工具软件和脚本程序,调用 WMI 管理本地和远程计算机。
以sql monitor为例,服务器监控的图示:
(1) 有限的windows监控选项
(2) 对性能计数器支持的很直接
二. 性能监视器可以用来做监控吗?
关于性能监控,很多人可能想过在SQL语句里,把性能计数器的值一并读出来,不过从权限/安全的角度来说,SQL Server(应用程序)不应该也不能反向关心windows(操作系统)没有分配给它的资源,所以在sys.dm_os_performance_counters里能查到的也只是SQL Server自己的性能计数器值。不过话说回来,有些DMV/SQL语句确实是可以查看操作系统资源使用情况的,仅限部分,应该是SQL Server自身做了实现,毕竟是自家的东西。
如果想要自己做基于性能计数器的监视,不会使用开发工具,只会写点SQL语句,怎么办?
把性能计数器的日志记录保存出来,导入到数据库里用SQL语句分析,做告警。
1. 如何取性能计数器的值?
(1) 直接查看性能计数器的界面,仅限于查看,无法保存日志记录;
(2) 事先定义一个文件来保存性能计数器,打开性能监视器,里面有这个功能,windows 2003叫counter logs,windows 2008叫data collector,如图:
如果要自动化的话,可以用命令行工具typeperf,功能和图形界面是一样的。
2. 如何分析性能计数器日志?
(1) 直接查看日志,可以借助perfmon/excel/PAL等工具来分析,但这些工具只能帮忙生成图表,不能做自动化,不能做告警;
(2) 导入数据库做分析,可使用 Log Parser/SSIS等任何能自动把性能计数器日志导入数据库的工具,然后利用SQL 语句来做分析,既然是监控,那就得实时点,导入的频率得高些。
第三方工具通常都有页面告警,短信,邮件等等告警方式,如果自己做开发,告警这块也需要自己来实现,通常数据库这端都是用邮件来告警。
设置告警的阀值需要有系统的性能基线,如果不是很确定的话,就设的高一点,至少性能日志已经被记录了,追溯也不是问题。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Unfortunately, people often delete certain contacts accidentally for some reasons. WeChat is a widely used social software. To help users solve this problem, this article will introduce how to retrieve deleted contacts in a simple way. 1. Understand the WeChat contact deletion mechanism. This provides us with the possibility to retrieve deleted contacts. The contact deletion mechanism in WeChat removes them from the address book, but does not delete them completely. 2. Use WeChat’s built-in “Contact Book Recovery” function. WeChat provides “Contact Book Recovery” to save time and energy. Users can quickly retrieve previously deleted contacts through this function. 3. Enter the WeChat settings page and click the lower right corner, open the WeChat application "Me" and click the settings icon in the upper right corner to enter the settings page.

Tomato Novel is a very popular novel reading software. We often have new novels and comics to read in Tomato Novel. Every novel and comic is very interesting. Many friends also want to write novels. Earn pocket money and edit the content of the novel you want to write into text. So how do we write the novel in it? My friends don’t know, so let’s go to this site together. Let’s take some time to look at an introduction to how to write a novel. Share the Tomato novel tutorial on how to write a novel. 1. First open the Tomato free novel app on your mobile phone and click on Personal Center - Writer Center. 2. Jump to the Tomato Writer Assistant page - click on Create a new book at the end of the novel.

The role of a DHCP relay is to forward received DHCP packets to another DHCP server on the network, even if the two servers are on different subnets. By using a DHCP relay, you can deploy a centralized DHCP server in the network center and use it to dynamically assign IP addresses to all network subnets/VLANs. Dnsmasq is a commonly used DNS and DHCP protocol server that can be configured as a DHCP relay server to help manage dynamic host configurations in the network. In this article, we will show you how to configure dnsmasq as a DHCP relay server. Content Topics: Network Topology Configuring Static IP Addresses on a DHCP Relay D on a Centralized DHCP Server

Mobile games have become an integral part of people's lives with the development of technology. It has attracted the attention of many players with its cute dragon egg image and interesting hatching process, and one of the games that has attracted much attention is the mobile version of Dragon Egg. To help players better cultivate and grow their own dragons in the game, this article will introduce to you how to hatch dragon eggs in the mobile version. 1. Choose the appropriate type of dragon egg. Players need to carefully choose the type of dragon egg that they like and suit themselves, based on the different types of dragon egg attributes and abilities provided in the game. 2. Upgrade the level of the incubation machine. Players need to improve the level of the incubation machine by completing tasks and collecting props. The level of the incubation machine determines the hatching speed and hatching success rate. 3. Collect the resources required for hatching. Players need to be in the game

How to implement dual WeChat login on Huawei mobile phones? With the rise of social media, WeChat has become one of the indispensable communication tools in people's daily lives. However, many people may encounter a problem: logging into multiple WeChat accounts at the same time on the same mobile phone. For Huawei mobile phone users, it is not difficult to achieve dual WeChat login. This article will introduce how to achieve dual WeChat login on Huawei mobile phones. First of all, the EMUI system that comes with Huawei mobile phones provides a very convenient function - dual application opening. Through the application dual opening function, users can simultaneously

Setting font size has become an important personalization requirement as mobile phones become an important tool in people's daily lives. In order to meet the needs of different users, this article will introduce how to improve the mobile phone use experience and adjust the font size of the mobile phone through simple operations. Why do you need to adjust the font size of your mobile phone - Adjusting the font size can make the text clearer and easier to read - Suitable for the reading needs of users of different ages - Convenient for users with poor vision to use the font size setting function of the mobile phone system - How to enter the system settings interface - In Find and enter the "Display" option in the settings interface - find the "Font Size" option and adjust it. Adjust the font size with a third-party application - download and install an application that supports font size adjustment - open the application and enter the relevant settings interface - according to the individual

In today's society, mobile phones have become an indispensable part of our lives. As an important tool for our daily communication, work, and life, WeChat is often used. However, it may be necessary to separate two WeChat accounts when handling different transactions, which requires the mobile phone to support logging in to two WeChat accounts at the same time. As a well-known domestic brand, Huawei mobile phones are used by many people. So what is the method to open two WeChat accounts on Huawei mobile phones? Let’s reveal the secret of this method. First of all, you need to use two WeChat accounts at the same time on your Huawei mobile phone. The easiest way is to

How to implement the WeChat clone function on Huawei mobile phones With the popularity of social software and people's increasing emphasis on privacy and security, the WeChat clone function has gradually become the focus of people's attention. The WeChat clone function can help users log in to multiple WeChat accounts on the same mobile phone at the same time, making it easier to manage and use. It is not difficult to implement the WeChat clone function on Huawei mobile phones. You only need to follow the following steps. Step 1: Make sure that the mobile phone system version and WeChat version meet the requirements. First, make sure that your Huawei mobile phone system version has been updated to the latest version, as well as the WeChat App.
