aws rds监控慢sql
In this article, we will review how to monitor AWS RDS SQL Server database instances and setup email notifications using event subscriptions and CloudWatch alarms.
在本文中,我们将回顾如何监视AWS RDS SQL Server数据库实例以及如何使用事件订阅和CloudWatch警报设置电子邮件通知。
Database monitoring is one of the important tasks of a database administrator to ensure availability and performance. AWS provides different tools to monitor the database instance. Below are some of the options.
数据库监视是数据库管理员确保可用性和性能的重要任务之一。 AWS提供了不同的工具来监视数据库实例。 以下是一些选项。
- Amazon RDS Events Amazon RDS活动
- Enhanced Monitoring 增强监控
- CloudWatch metrics CloudWatch指标
- CloudWatch Alarms CloudWatch警报
- Database log files 数据库日志文件
AWS RDS事件 (AWS RDS Events)
Whenever there is a backup, configuration change, snapshot, failover or maintenance, etc. on the database instance, an Amazon RDS event is created. These events can be subscribed to get an email notification. AWS RDS SQL Server uses SNS (simple notification service) to send a notification when an event occurs. These events are grouped into below categories.
只要在数据库实例上进行备份,配置更改,快照,故障转移或维护等,就会创建一个Amazon RDS事件。 可以订阅这些事件以获得电子邮件通知。 当事件发生时,AWS RDS SQL Server使用SNS(简单通知服务)发送通知。 这些事件分为以下几类。
- Availability 可用性
- Backup 后备
- Configuration change 配置变更
- Creation 创建
- Deletion 删除中
- Failover 故障转移
- Failure 失败
- Low storage 储存空间不足
- Maintenance 保养
- Notification 通知
- Read replica 读取副本
- Recovery 复苏
- Restoration 恢复
For example, when a backup is started on AWS RDS SQL Server database instance an event is created in the backup category with the description “A backup of database instance is started”.
例如,在AWS RDS SQL Server数据库实例上启动备份时,将在备份类别中创建一个事件,其描述为“数据库实例的备份已启动”。
When a new parameter group is associated with database instance by modifying the instance, an event occurs in the configuration change category with the description “A parameter group for this DB instance has changed.”
通过修改实例将新参数组与数据库实例相关联时,配置更改类别中将发生一个事件,其描述为“此数据库实例的参数组已更改。”
创建事件订阅: (Creating event subscriptions:)
To receive emails notification on the Amazon RDS events, we need to create event subscriptions.
要接收有关Amazon RDS事件的电子邮件通知,我们需要创建事件订阅。
Navigate to Amazon RDS Console, Click on Event Subscriptions and click on Create event subscription.
导航到Amazon RDS控制台,单击事件订阅 ,然后单击创建事件订阅。
In Create event subscription page, Input the name of the subscription. Select the ARN if you already have one or create a new by selecting New email topic. Enter the topic name and the email address to send the notifications.
在“ 创建事件订阅”页面中,输入订阅的名称。 如果您已经拥有一个,请选择ARN或通过选择“ 新建电子邮件”主题来创建一个新的。 输入主题名称和电子邮件地址以发送通知。

Now select the source type as instances. Select the database instances if you want to monitor specific instances else select All instances to monitor all instances in your AWS RDS SQL Server.
现在,选择源类型作为实例。 如果要监视特定实例,请选择数据库实例,否则选择所有实例以监视AWS RDS SQL Server中的所有实例。
In event categories, select the