aws rds监控慢sql_AWS RDS SQL Server –启动新的数据库实例

aws rds监控慢sql

This article will review on how to launch an AWS RDS SQL Server instance and how to connect the instance and modify the properties of database instance.

本文将回顾如何启动AWS RDS SQL Server实例以及如何连接实例以及修改数据库实例的属性。

总览 (Overview)

AWS RDS SQL Server comes with license included and there is no need to purchase license from Microsoft separately.

AWS RDS SQL Server随附了许可证,因此无需单独从Microsoft购买许可证。

You can deploy multiple editions of SQL Server (2008 R2, 2012, 2014, 2016, and 2017) including Express, Web, Standard and Enterprise, in minutes with cost-efficient and re-sizable compute capacity.

您可以在数分钟内部署具有成本效益和可调整大小的计算能力的多个版本SQL Server(2008 R2、2012、2014、2016和2017),包括Express,Web,Standard和Enterprise。

在AWS RDS SQL Server上创建数据库实例 (Creating a database instance on AWS RDS SQL Server)

Here is step by step for creating a database instance on AWS RDS SQL Server.

这是逐步在AWS RDS SQL Server上创建数据库实例的步骤。

Login in to AWS management console using your email and password. Navigate to Services and type RDS in search box. Click on RDS managed relational database services as show in the below image.

使用您的电子邮件和密码登录到AWS管理控制台。 导航到服务,然后在搜索框中键入RDS。 单击RDS托管的关系数据库服务,如下图所示。

AWS RDS SQL Server - Service

Click on Create Database and select Microsoft SQL Server as database engine.

单击创建数据库,然后选择Microsoft SQL Server作为数据库引擎。

SQL Server engine

Select the type of edition as per your need. If your looking for free tier check Only enable options eligible for RDS Free Usage Tier.

根据需要选择版本类型。 如果您在寻找免费套餐,请选中“ 仅启用符合RDS免费使用等级的选项”。

Only SQL Server expression edition is available in free tier and all other editions will be graded out if you opt for free tier.

免费版仅提供SQL Server表达式版本,如果您选择免费版,则所有其他版本将被淘汰。

SQL Server edition

Click Next once you select the edition and choose the use case as per your need. Please refer to the below image. Click Next. AWS RDS recommends deploying production database instances in multiple available zones for high availability.

选择版本后,单击“ 下一步”,然后根据需要选择用例。 请参考下图。 单击下一步。 AWS RDS建议在多个可用区域中部署生产数据库实例以实现高可用性。

AWS RDS SQL Server - Use Case

The are various SQL server versions available. Choose the SQL Server version of your choice and select the DB instance class. You will be charged based on the type of DB engine version and DB instance class you choose. The default time zone is UTC and changing the time zone is optional. You can choose the time zone of your choice. The time zone can not be changed once the instance is created.

有各种可用SQL Server版本。 选择您选择SQL Server版本,然后选择数据库实例类。 将根据您选择的数据库引擎版本和数据库实例类的类型向您收费。 默认时区是UTC,更改时区是可选的。 您可以选择自己选择的时区。 创建实例后便无法更改时区。

DB engine version

Select Multi AZ deployment to have replica of your database instance in a different availability zone. Amazon relational database services uses mirroring/ always on in background to support multi AZ deployment.

选择“多可用区部署”以使数据库实例的副本位于其他可用性区域中。 Amazon关系数据库服务使用镜像/始终在后台启用以支持多可用区部署。

AWS RDS SQL Server will automatically fail over to the standby in the case of a planned or unplanned outage of the primary.

如果主数据库计划内或计划外停机,AWS RDS SQL Server将自动故障转移到备用数据库。

Select the type of storage. There are different storage types available.

选择存储类型。 有不同的存储类型可用。

  1. General Purpose SSD: Performance is determined by the size of the volume. Baseline I/O performance for General Purpose SSD storage is 3 IOPS for each GB. For example, 100GB IOPS will 300 and for 1000 GB IPOS will be 3000

    通用SSD:性能取决于卷的大小。 通用SSD存储的基准I / O性能为每GB 3 IOPS。 例如,100GB IOPS将为300,而1000 GB IPOS将为3000
  2. Provisioned IOPS: Ranges from 1000-32000 IOPS. Recommended for OLTP database instances

    预配置的IOPS:范围为1000-32000 IOPS。 推荐用于OLTP数据库实例

When we select the provisioned IPOS we must input the IOPS number and the IOPS will be used until we change the number again. You can see the estimated monthly cost of your instance based on the configuration you selected.

当选择预配置的IPOS时,我们必须输入IOPS编号,并且将使用IOPS,直到再次更改编号。 您可以根据所选配置查看实例的估计每月费用。

AWS SQL Server - Storage type

The IPOS is based on the storage capacity. Example, for a 20 GB allocated storage the maximum IPOS is 1000. If you try to increase IPOS beyond 1000 for a 20 GB storage. It will show waring as in below image.

IPOS基于存储容量。 例如,对于20 GB分配的存储,最大IPOS为1000。如果您尝试将20 GB存储的IPOS增加到1000以上。 它将显示警告,如下图所示。

If you increase the allocated storage, you can increase IPOS. You will be charged based on your IPOS and storage you choose.

如果增加分配的存储,则可以增加IPOS。 将根据您选择的IPOS和存储空间向您收费。

Provisioned IOPS

In settings section, specify the name of the DB instance identifier and this should be unique among all the instances in your AWS account in the region. Input the master username and password of your choice and click Next.

在设置部分中,指定数据库实例标识符的名称,并且该名称在该区域的AWS账户中的所有实例中应该是唯一的。 输入您选择的主用户名和密码,然后单击下一步

AWS SQL Server - Instance name

In advanced configuration settings, Select the VPC and subnet. Select the public accessibility as per your choice. If you select Yes, you can connect to DB instance from SQL Server management studio or any other tools which are outside of the VPC network.

在高级配置设置中,选择VPC和子网。 根据您的选择选择公共可访问性。 如果选择“ 是”,则可以从SQL Server Management Studio或VPC网络外部的任何其他工具连接到数据库实例。

If you select No, you can connect to the instance from devices or ec2 which are within VPC network only.

如果选择No ,则只能从VPC网络内的设备或ec2连接到实例。

VPC and public accessibility

Select the security group. This security group will have inbound and outbound rules defined. If you need to open any specific port or limit the connectivity from specific IP address, all these rules can be defined in these security groups.

选择安全组。 此安全组将定义入站和出站规则。 如果需要打开任何特定端口或限制来自特定IP地址的连接,则可以在这些安全组中定义所有这些规则。

Input the port number, Select the DB parameter group and the option group. Parameter group is the database engine configuration. If you want to use your own parameter group, you create a new parameter group and modify the parameters that you want to. Select the newly created parameter group while creating database instance. You can also associate the custom parameter group after creating the database instance.

输入端口号,选择数据库参数组和选项组。 参数组是数据库引擎配置。 如果要使用自己的参数组,请创建一个新的参数组并修改所需的参数。 创建数据库实例时,选择新创建的参数组。 您还可以在创建数据库实例后关联自定义参数组。

AWS RDS SQL Server - Security groups

Select the backup retention period. select the backup window if you want take backups at specific time.

选择备份保留期。 如果要在特定时间进行备份,请选择备份窗口。

Input the start time. These timings are in UTC.

输入开始时间。 这些时间以UTC为单位。

Backup window and retention

If you want your database instance to be auto upgraded select Enable auto minor version upgrade. These automatic upgrades occur during the maintenance window. You can specify the maintenance window by selecting the Select Window option and input start day and start time.

如果要自动升级数据库实例,请选择“ 启用自动次要版本升级” 。 这些自动升级在维护窗口期间发生。 您可以通过选择“ 选择窗口”选项并输入开始日期和开始时间来指定维护窗口。

AWS RDS SQL Server - Maintenance window

Enable deletion protection. If you enable this option, you cannot delete the database instance. Click on Create Database. Your database instance will be created in few minutes.

启用删除保护。 如果启用此选项,则无法删除数据库实例。 单击创建数据库 。 您的数据库实例将在几分钟内创建。

Creation of DB Instance.

Navigate to the Databases tab and click on database instance name to view more details of the instance like endpoint which is used to connect database instance, logs, monitoring, configuration etc.

导航到“ 数据库”选项卡,然后单击数据库实例名称以查看实例的更多详细信息,例如用于连接数据库实例,日志,监视,配置等的终结点。

Database instance

Database instance details

Once the database instance is available, it will display the endpoint which will be used to connect the database instance.

数据库实例可用后,它将显示用于连接数据库实例的端点。

连接到AWS RDS SQL Server上的数据库实例 (Connecting to a database instance on AWS RDS SQL Server)

Once the instance is available on AWS RDS SQL Server, you can SQL Server management studio to connect the instance. Copy the endpoint and open SQL Server management studio from windows machine and input the endpoint in server name and use the master account username and password you created previously.

一旦实例在AWS RDS SQL Server上可用,您就可以使用SQL Server Management Studio连接实例。 复制端点并从Windows计算机打开SQL Server Management Studio,然后在服务器名称中输入端点,并使用您先前创建的主帐户用户名和密码。

AWS RDS SQL Server - Endpoint

SSMS

To connect using SQLCMD, open command prompt pass endpoint as server parameter and master login credentials to SQLCMD.

要使用SQLCMD进行连接,请打开命令提示符,将端点作为服务器参数传递给SQLCMD,并将主登录凭据传递给SQLCMD。

SQLCMD

If you have connection issues, please look at your public access settings of your database instance and your security groups associated with instance.

如果遇到连接问题,请查看数据库实例的公共访问设置以及与该实例关联的安全组。

If the database instance is not enabled for public access, make sure you are connecting using tools with in VPC network.

如果未启用数据库实例的公共访问权限,请确保使用VPC网络中的工具进行连接。

To access the log files and default trace files, Navigate to Databases -> click on the database instance -> in database instance details page, Click on Events and Logs. You can also read the error log using rds_read_error_log procedure. Login to database instance using SQL Server management studio and execute the procedure in rdsadmin database.

要访问日志文件和默认跟踪文件,请导航到数据库 -> 单击数据库实例->在数据库实例详细信息页面中,单击事件和日志 。 您也可以使用rds_read_error_log过程读取错误日志。 使用SQL Server Management Studio登录到数据库实例,然后在rdsadmin数据库中执行该过程。

EXEC rdsadmin.dbo.rds_read_error_log @index = 0, @type = 1;

To stop the database instance, select the instance and click on Actions. Click Stop.

要停止数据库实例,请选择该实例,然后单击“ 操作” 。 点击停止

Amazon RDS SQL Server - Stop the insatnce

If you need the snapshot before stopping the instance, Click Yes and give the snapshot name.

如果在停止实例之前需要快照,请单击“ 是”并提供快照名称。

The status of the DB instance changes to stopping and then stopped. Even though you stop the database instance you will be charged for the provisioned storage.

数据库实例的状态更改为停止,然后停止。 即使您停止了数据库实例,也将向预配置的存储收费。

snapshot

If the instance is not started again with in the seven days, it will be automatically started.

如果实例在7天内没有再次启动,它将自动启动。

To start the database instance, select the instance and click on Actions. In the drop down click on Start.

要启动数据库实例,请选择实例,然后单击“ 操作”。 在下拉菜单中单击开始

At any point of time if you forgot the master password or wish to change the master password, navigate to the Databases, select the database instance and click on Modify.

在任何时候,如果您忘记了主密码或希望更改主密码,请导航至数据库 ,选择数据库实例,然后单击修改

Enter new master password and click Continue at bottom

输入新的主密码,然后单击底部的继续

Amazon SQL Server - reset master password

In modifications summary page, you will be able to see the all modification done. If you plan to apply these changes in maintenance window, select Apply during the next scheduled maintenance window.

在“修改摘要”页面中,您将能够看到已完成的所有修改。 如果您打算在维护窗口中应用这些更改,请在下一个计划的维护窗口中选择“应用”

If you want these changes to reflect immediately, select Apply Immediately.

如果您希望这些更改立即反映出来,请选择立即应用

Similarly, you can also modify other properties of the database instance like increasing the allocated storage, change the security group, public accessibility, port number and backup settings etc.

同样,您还可以修改数据库实例的其他属性,例如增加分配的存储空间,更改安全组,公共可访问性,端口号和备份设置等。

Please note that modifying some properties and applying them immediately may reboot the AWS RDS SQL Server database instance.

请注意,修改某些属性并立即应用它们可能会重启AWS RDS SQL Server数据库实例。

翻译自: https://www.sqlshack.com/aws-rds-sql-server-launching-a-new-database-instance/

aws rds监控慢sql

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值