aws rds监控慢sql_在AWS RDS SQL Server上的SSAS中部署表格数据库-程序员宅基地

技术标签: python  java  mysql  数据库  大数据  

aws rds监控慢sql

In this article, we are going to explore Analysis Service for AWS RDS SQL Server in detail.

在本文中,我们将详细探讨适用于AWS RDS SQL Server的Analysis Service。

Amazon offers various database services to support completely managed database infrastructure. We can deploy RDS for SQL Server, but it supports only database service until now. If we look at the relational database Microsoft SQL Server, it offers the following useful services as well:

Amazon提供了各种数据库服务来支持完全托管的数据库基础架构。 我们可以为SQL Server部署RDS,但是到目前为止它仅支持数据库服务。 如果我们查看关系数据库Microsoft SQL Server,它还提供以下有用的服务:

  • SQL Server Analysis Service – SSAS

    SQL Server分析服务– SSAS
  • SQL Server Reporting Service – SSRS

    SQL Server报告服务– SSRS
  • SQL Server Integration Service – SSIS

    SQL Server集成服务– SSIS

But RDS limitation to database service was stopping a few users from migrating on it. Recently AWS announced that we can now run the Analysis Service on AWS RDS SQL Server as well.

但是RDS对数据库服务的限制阻止了一些用户对其进行迁移。 最近,AWS宣布我们现在也可以在AWS RDS SQL Server上运行Analysis Service

先决条件 (Prerequisites)

支持的版本 (Supported editions)

RDS supports SQL Server Analysis Service on the following SQL Server editions:

RDS在以下SQL Server版本上支持SQL Server Analysis Service:

  1. SQL Server 2016 Standard or Enterprise edition (minimum version:13.00.5426.0.v1)

    SQL Server 2016 Standard或Enterprise版本(最低版本:13.00.5426.0.v1)
  2. SQL Server 2017 Standard or Enterprise edition(minimum version:14.00.3223.3.v1)

    SQL Server 2017 Standard或Enterprise版本(最低版本:14.00.3223.3.v1)

Follow the article AWS RDS SQL Server – Launching a new database instance to launch a new AWS RDS SQL Server instance.

按照文章AWS RDS SQL Server –启动新的数据库实例启动新的AWS RDS SQL Server实例。

You can verify the SQL instance edition in the RDS dashboard, as shown below:

您可以在RDS仪表板中验证SQL实例版本,如下所示:

AWS RDS SQL Server dashboard

加入域的RDS实例 (Domain Joined RDS instance)

Join this RDS instance with an Amazon managed Active directory.

将此RDS实例与Amazon托管的Active Directory加入。

将EC2实例配置为域的成员 (Configure EC2 instance as a member of Domain)

Create an EC2 instance, and it should be part of the same active directory.

创建一个EC2实例,它应该是同一活动目录的一部分。

For requirement 2 and 3, follow the articles below:

对于要求2和3,请遵循以下文章:

Once you follow steps 2 and 3, you can use the Windows authentication to connect to AWS RDS SQL Server:

完成步骤2和步骤3后,即可使用Windows身份验证连接到AWS RDS SQL Server:

Connect using Windows authentcation

将Amazon S3存储桶与AWS RDS SQL Server集成 (Integrate an Amazon S3 bucket with AWS RDS SQL Server)

We require an S3 bucket to transfer tabular database models, backups between the AWS instance and S3 bucket. I have already associated the SQLshackdemo bucket with my RDS instance.

我们需要一个S3存储桶来传输表格数据库模型,AWS实例和S3存储桶之间的备份。 我已经将SQLshackdemo存储桶与我的RDS实例相关联。

In the below image, we can see the sqlshackrole role associated with the RDS instance for the S3 integration feature. This role should have permissions to do tasks in the S3 bucket for RDS instance.

在下图中,我们可以看到与S3集成功能的RDS实例关联的sqlshackrole角色。 该角色应具有在R3实例的S3存储桶中执行任务的权限。

Integrate an Amazon S3 bucket

Refer to the article Integrating an AWS RDS SQL Server with Amazon S3 bucket to go through the integration process.

请参阅文章将AWS RDS SQL Server与Amazon S3存储桶集成以完成集成过程。

SSMS安装 (SSMS installation)

Launch EC2 instance and install SQL Server Management Studio to connect with RDS DB and Analysis Service instance

启动EC2实例并安装SQL Server Management Studio以与RDS DB和Analysis Service实例连接

带有SQL Server数据工具(SSDT)的Visual Studio (Visual Studio with SQL Server Data Tools (SSDT))

We require Visual Studio 2019 along with SQL Server data tools for creating database projects. You can install Visual Studio in the EC2 instance and enable the extension for the Analysis Service project.

我们需要Visual Studio 2019以及SQL Server数据工具来创建数据库项目。 您可以在EC2实例中安装Visual Studio,并为Analysis Service项目启用扩展。

Refer to the article Download SQL Server Data Tools (SSDT) for Visual Studio for more details.

有关更多详细信息,请参阅文章下载Visual StudioSQL Server数据工具(SSDT)

Note: Complete all prerequisites specified so far in this article to go further.

注意 :完成本文到目前为止指定的所有先决条件,以进一步进行操作。

在AWS RDS SQL Server上启用SSAS (Enable SSAS on the AWS RDS SQL Server)

SQL Server Analysis Service is an Online analytical processing (OLAP) application. In a traditional SQL Server, we get two options to choose, Tabular or Multi-dimensional. RDS supports the tabular model.

SQL Server Analysis Service是一个联机分析处理(OLAP)应用程序。 在传统SQL Server中,我们有两个选项可供选择:表格格式或多维格式。 RDS支持表格模型。

To enable the Analysis Service in RDS, we need to add an option group in the RDS instance. In the RDS dashboard, click on Options groups. You can see existing options groups as well on this page.

要在RDS中启用分析服务,我们需要在RDS实例中添加一个选项组。 在RDS仪表板中,单击“ 选项”组。 您也可以在此页面上看到现有的选项组。

Click on Create group to configure a new option group:

单击创建组以配置新的选项组:

为RDS创建一个新的选项组 (Create a new Option group for RDS)

Create a new Option group

On this Create option group page, enter the name and description. We also need to select the SQL engine (standard, enterprise, express) along with the SQL version:

在此创建选项组页面上,输入名称和描述。 我们还需要选择SQL引擎(标准,企业,快递)以及SQL版本:

Fill details

It creates the option group, but it is not configured for any services yet. We need to select the newly created option group and click on Add option:

它创建了选项组,但尚未为任何服务进行配置。 我们需要选择新创建的选项组,然后单击添加选项:

Add SSAS in the option group

在选项组中添加SQL Server Analysis Service (Add SQL Server Analysis Service in the option group)

In the option details page, select the SSAS option from the drop-down. It gives you brief information that this option enables SQL Server Analysis Services on the DB instance.

在选项详细信息页面中,从下拉列表中选择SSAS选项。 它为您提供了有关此选项在数据库实例上启用SQL Server Analysis Services的简要信息。

Analysis Service runs on port 2383, so this port should be allowed in the security groups (AWS firewall) from the EC2 instance. Refer to article security groups for your VPC for more detail.

Analysis Service在端口2383上运行,因此应在EC2实例的安全组(AWS防火墙)中允许该端口。 有关更多详细信息,请参阅VPC的文章安全组

We also need to configure the Max memory for the Analysis Service. You might be aware that Analysis Service is a memory-intensive application, and you might do bulk data processing, so max memory should be configured appropriately. Analysis Service instance runs on the same RDS database, so if we specify a high memory, it might impact memory available for RDS instance. I allocated 50% memory for the SSAS instance.

我们还需要为Analysis Service配置最大内存 。 您可能知道Analysis Service是一个占用大量内存的应用程序,并且可能会进行批量数据处理,因此应适当配置最大内存。 Analysis Service实例在同一RDS数据库上运行,因此,如果我们指定高内存,则可能会影响RDS实例的可用内存。 我为SSAS实例分配了50%的内存。

Option SSAS for Analysis Service

The RDS instance and options group must remain in the same VPC. You can verify the RDS instance VPC in the connectivity & Security tab:

RDS实例和选项组必须保留在同一VPC中。 您可以在“ 连接性和安全性”选项卡中验证RDS实例VPC:

Check VPC

Select the RDS instance VPC (in my case vpc-9c710fe6) in the security groups as shown below:

在安全组中选择RDS实例VPC(在我的情况下为vpc-9c710fe6 ),如下所示:

RDS instance VPC

Scroll down, and you can schedule to add the option group immediately or on next scheduled maintenance window:

向下滚动,您可以计划立即或在下一个计划的维护窗口中添加选项组:

schedule changes

It adds the SSAS in the newly created option group, and you get a message for it as well:

它将SSAS添加到新创建的选项组中,并且您也收到一条消息:

adds the SSAS in the newly created option group

修改RDS实例以使用SSAS选项组 (Modify RDS instance to use SSAS option group)

Now, lunch SSMS in EC2 instance and try to connect the Analysis Services using the RDS endpoint. We get the error message that connection did not succeed:

现在,在EC2实例中午餐SSMS,然后尝试使用RDS端点连接Analysis Services。 我们收到错误消息,连接未成功:

Modify RDS instance for SSAS

The above error comes because we have not assigned an option group for the RDS instance. Click on modify on RDS instance and select the option group (in my case SSASforRDS) we created earlier:

出现上述错误是因为我们尚未为RDS实例分配选项组。 单击修改RDS实例,然后选择我们之前创建的选项组(在我的情况下为SSASforRDS ):

Database option group

We can view the modification summary for the option group in the below image. Apply the changes immediately. It restarts the RDS instances and enables Analysis Services for the selected SQL instance:

我们可以在下图中查看选项组的修改摘要。 立即应用更改。 它将重新启动RDS实例并为所选SQL实例启用Analysis Services:

Summary of modification

Now, connect to SSAS service again from the EC2 SSMS using Windows authentication. We do not see any database in this instance by default:

现在,使用Windows身份验证从EC2 SSMS重新连接到SSAS服务。 默认情况下,我们在此实例中看不到任何数据库:

Connect to SSAS

Right-click on the connected instance and view the properties of the Analysis Server. You can see its hostname, Server mode, version, and supported compatibility level:

右键单击连接的实例,然后查看Analysis Server的属性。 您可以查看其主机名,服务器模式,版本和支持的兼容性级别:

Analysis Server

为RDS创建Analysis Service表格项目 (Create an Analysis Service tabular project for RDS )

We will create a sample project for this demonstration. We already installed Visual Studio for creating projects. Go to start and launch Visual Studio 2019 and create a new project for Analysis Service tabular database:

我们将为此演示创建一个示例项目。 我们已经安装了Visual Studio来创建项目。 转到启动并启动Visual Studio 2019并为Analysis Service表格数据库创建一个新项目:

tabular project for RDS

Specify a project name, solution name, and the directory that holds all the required project files:

指定项目名称,解决方案名称以及包含所有必需项目文件的目录:

Configure project

Click on Create. In the next tabular model designer, select the option Integrated workspace:

单击创建。 在下一个表格模型设计器中,选择选项集成工作区

Integrated workspace

It creates a solution and project. Right-click on the project solution and view its properties. In the processing option, select the value Do Not Process:

它创建一个解决方案和项目。 右键单击项目解决方案,然后查看其属性。 在处理选项中,选择值不处理

You can also view the database name TestProject in the below screenshot. We require this database name in the following SQL queries:

您还可以在下面的屏幕快照中查看数据库名称TestProject 。 在以下SQL查询中,我们需要此数据库名称:

Project properties

In the Visual Studio, go to Build > Build Solution:

在Visual Studio中,转到“ 构建”>“构建解决方案”:

Build Solution

Now, go to the directory that we specified earlier while creating the project. Here, we see the project solution file and a folder holding project files:

现在,转到我们在创建项目时指定的目录。 在这里,我们看到了项目解决方案文件和一个保存项目文件的文件夹:

View project files

Open the folder, and you can see two files highlighted below:

打开文件夹,您将看到下面突出显示的两个文件:

  • Model.asdatabase模型数据库
  • Model.deploymentoptions模型部署选项

Deployment files

Open the S3 bucket that is integrated with AWS RDS SQL Server and upload the files into S3:

打开与AWS RDS SQL Server集成的S3存储桶,并将文件上传到S3:

Upload to S3

We use the msdb.dbo.rds_download_from_s3 stored procedure to download the project files from the S3 bucket to the RDS instance. Connect to the AWS RDS SQL instance in the SSMS and execute the following queries. In these queries, we specified the project file name that we uploaded in the S3 bucket:

我们使用msdb.dbo.rds_download_from_s3存储过程将项目文件从S3存储桶下载到RDS实例。 连接到SSMS中的AWS RDS SQL实例,然后执行以下查询。 在这些查询中,我们指定了我们在S3存储桶中上传的项目文件名:

exec msdb.dbo.rds_download_from_s3 @s3_arn_of_file='arn:aws:s3:::sqlshackdemo/Model.asdatabase' , @rds_file_path='d:\S3\model.asdatabase' , @overwrite_file=1
 
exec msdb.dbo.rds_download_from_s3 @s3_arn_of_file='arn:aws:s3:::sqlshackdemo/Model.deploymentoptions' , @rds_file_path='d:\S3\model.deploymentoptions' , @overwrite_file=1

It starts the tasks to download the files from the S3 bucket to the RDS instance folder:

它开始执行将文件从S3存储桶下载到RDS实例文件夹的任务:

Upload file t o RDS instance

We can check the status of the tasks using the stored procedure msdb.dbo.rds_fn_task_status using the task ID we got earlier. The first parameter is always a NULL value:

我们可以使用存储过程msdb.dbo.rds_fn_task_status和我们之前获得的任务ID来检查任务的状态。 第一个参数始终为NULL值:

SELECT * FROM msdb.dbo.rds_fn_task_status(null,19);
SELECT * FROM msdb.dbo.rds_fn_task_status(null,20);

We can see that both tasks completed successfully:

我们可以看到两个任务都成功完成了:

RDS Task status

Now, we are ready to deploy the tabular project in the RDS instance. It uses the msdb.dbo.rds_msbi_task stored procedure with the following arguments:

现在,我们准备在RDS实例中部署表格项目。 它使用msdb.dbo.rds_msbi_task存储过程以及以下参数:

  • @task_type:@task_type
  • @file_path: @file_pathD:\S3 D:\ S3
exec msdb.dbo.rds_msbi_task @task_type='SSAS_DEPLOY_PROJECT', @file_path='d:\S3\Model.asdatabase';

It also starts a task for the RDS instance. Once we track it using the msdb.dbo.rds_fn_task_status, its status shows success after some time. It might take longer, depending on the project:

它还为RDS实例启动任务。 一旦使用msdb.dbo.rds_fn_task_status对其进行跟踪,一段时间后它的状态就会显示成功。 可能需要更长的时间,具体取决于项目:

Task status

We also need to give permissions to the user that connects with the AWS RDS SQL Server Analysis Service. To do so, we use the stored procedure msdb.dbo.rds_msbi_task with the following arguments:

我们还需要向与AWS RDS SQL Server Analysis Service连接的用户授予权限。 为此,我们将存储过程msdb.dbo.rds_msbi_task与以下参数一起使用:

  • @task_type:@task_typeSSAS_ADD_DB_ADMIN_MEMBER in this argument SSAS_ADD_DB_ADMIN_MEMBER
  • @Database_name:@Database_name
  • @ssas_role_name@ssas_role_name
  • @ssas_role_member@ssas_role_member
exec msdb.dbo.rds_msbi_task @task_type='SSAS_ADD_DB_ADMIN_MEMBER',
@database_name='Testproject', @ssas_role_name='Sample', @ssas_role_member='sqlshackdemo\rajendra.gupta';

We can see this stored procedure successfully added specified user in the specified role:

我们可以看到此存储过程已成功以指定角色添加了指定用户:

Add users in the SSAS role

Now, refresh the Analysis Server connection in SSMS. We can see the TestProject database in the Analysis Service of AWS RDS SQL Server:

现在,刷新SSMS中的Analysis Server连接。 我们可以在AWS RDS SQL Server的Analysis Service中看到TestProject数据库:

View tabular database

结论 (Conclusion)

In this article, we explored that AWS RDS now supports SQL Server Analysis Service as well. We can configure it for RDS instance and deploy projects using Visual Studio, and RDS stored procedures. We deployed a primary tabular database in this demonstration.

在本文中,我们探讨了AWS RDS现在也支持SQL Server Analysis Service。 我们可以为RDS实例配置它,并使用Visual Studio和RDS存储过程部署项目。 在此演示中,我们部署了一个主要的表格数据库。

Follow the article Creating your first SSAS tabular model database to create a tabular model database in RDS.

请按照文章创建第一个SSAS表格模型数据库来在RDS中创建表格模型数据库。

翻译自: https://www.sqlshack.com/deploy-tabular-databases-in-ssas-on-aws-rds-sql-server/

aws rds监控慢sql

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/culuo4781/article/details/107626061

智能推荐

《第一行代码》(第二版)广播的问题及其解决_代码里的广播错误-程序员宅基地

文章浏览阅读2.6k次,点赞5次,收藏13次。1)5.2.1弹出两次已连接或者未连接这是因为你同时打开了流量和WiFi,他就会发出两次广播。2)5.3.1中发送自定义广播问题标准广播未能弹出消息:Intent intent=new Intent("com.example.broadcasttest.MY_BROADCAST");sendBroadcast(intent);上述已经失效了。修改:Intent intent=new Intent("com.example.broadcasttest...._代码里的广播错误

K8s 学习者绝对不能错过的最全知识图谱(内含 58个知识点链接)-程序员宅基地

文章浏览阅读249次。作者 |平名 阿里服务端开发技术专家导读:Kubernetes 作为云原生时代的“操作系统”,熟悉和使用它是每名用户的必备技能。本篇文章概述了容器服务 Kubernet..._k8知识库

TencentOS3.1安装PHP+Nginx+redis测试系统_tencentos-3.1-程序员宅基地

文章浏览阅读923次。分别是etc/pear.conf,etc/php-fpm.conf, etc/php-fpm.d/www.conf,lib/php.ini。php8安装基本一致,因为一个服务期内有2个版本,所以注意修改不同的安装目录和端口号。可以直接使用sbin下的nginx命令启动服务。完成编译安装需要gcc支持,如果没有,使用如下命令安装。安装过程基本一致,下面是安装7.1.33的步骤。执行如下命令,检查已经安装的包和可安装的包。执行如下命令,检查已经安装的包和可安装的包。执行如下命令,检查已经安装的包和可安装的包。_tencentos-3.1

urllib.request.urlopen()基本使用_urllib.request.urlopen(url)-程序员宅基地

文章浏览阅读3.1w次,点赞21次,收藏75次。import urllib.requesturl = 'https://www.python.org'# 方式一response = urllib.request.urlopen(url)print(type(response)) # <class 'http.client.HTTPResponse'># 方式二request = urllib.request.Req..._urllib.request.urlopen(url)

如何用ChatGPT+GEE+ENVI+Python进行高光谱,多光谱成像遥感数据处理?-程序员宅基地

文章浏览阅读1.5k次,点赞12次,收藏15次。如何用ChatGPT+GEE+ENVI+Python进行高光谱,多光谱成像遥感数据处理?

RS485总线常识_rs485 差分走綫間距-程序员宅基地

文章浏览阅读1.2k次。RS485总线常识 2010-10-12 15:56:36| 分类: 知识储备 | 标签:rs485 总线 传输 差分 |字号大中小 订阅RS485总线RS485采用平衡发送和差分接收方式实现通信:发送端将串行口的TTL电平信号转换成差分信号A,B两路输出,经过线缆传输之后在接收端将差分信号还原成TTL电平信号。由于传输线通常使用双绞线,又是差分传输,所_rs485 差分走綫間距

随便推点

移植、制作uboot、Linux(一)_uboot制作-程序员宅基地

文章浏览阅读621次。u-boot、linux烧录_uboot制作

windows下安装git和gitbash安装教程_64-bit git for windows setup.-程序员宅基地

文章浏览阅读1.2w次,点赞10次,收藏44次。windos上git安装,git bash安装_64-bit git for windows setup.

环形链表(算法java)_java 实现环形链表-程序员宅基地

文章浏览阅读196次。环形链表(算法java)的两种解决方法_java 实现环形链表

docker部署Airflow(修改URL-path、更换postgres -->myslq数据库、LDAP登录)_airflow docker-程序员宅基地

文章浏览阅读5.7k次。Airflow什么是 Airflow?Airflow 的架构Airflow 解决哪些问题一、docker-compose 安装airflow(postgres)1、创建启动文件airflow-docker-compose.yml.1.1、添加挂载卷,需要修改airflow-docker-compose.yml的位置2、创建本地配置文件airflow.cfg2.1、如果想修改WEB URL地址,需要修改airflow.cfg中以下两个地方3、之后up -d直接启动即可web访问地址:二、存储数据库更换post_airflow docker

计算机毕业设计springboot高校教务管理系统532k79【附源码+数据库+部署+LW】-程序员宅基地

文章浏览阅读28次。选题背景:随着社会的发展和教育的普及,高校教务管理系统在现代高等教育中扮演着至关重要的角色。传统的手工管理方式已经无法满足高校日益增长的规模和复杂的管理需求。因此,开发一套高效、智能的教务管理系统成为了当今高校管理的迫切需求。选题意义:高校教务管理系统的开发具有重要的意义和价值。首先,它可以提高高校教务管理的效率和准确性。通过自动化处理学生选课、排课、考试安排等繁琐的事务,大大减轻了教务人员的工作负担,提高了工作效率。同时,系统可以实时更新学生信息和课程信息,减少了数据错误和冗余,保证了管理的准确性

javaint接收float_Java Integer转换double,float,int,long,string-程序员宅基地

文章浏览阅读132次。首页>基础教程>常用类>常用 Integer类Java Integer转换double,float,int,long,stringjava中Integer类可以很方便的转换成double,float,int,long,string等类型,都有固定的方法进行转换。方法double doubleValue() //以 double 类型返回该 Integer 的值。flo..._java integet接收float类型的参数

推荐文章

热门文章

相关标签