ssas报表项目数据集
In this article, I’m going to discuss the different ways in which we can deploy SSAS cubes. SSAS or SQL Server Analysis Services is an enterprise-grade analytical data engine which helps business to create semantic models that can be used for reporting and making better decisions. The semantic layer created by SSAS can be accessed by client tools like Power BI, or Excel and reports can be prepared from thereon. SSAS comes with a few different versions, which are as follows.
在本文中,我将讨论部署SSAS多维数据集的不同方法。 SSAS或SQL Server Analysis Services是企业级分析数据引擎,可帮助企业创建可用于报告和做出更好决策的语义模型。 可以通过Power BI或Excel等客户端工具访问SSAS创建的语义层,并可以在其上准备报告。 SSAS带有一些不同的版本,如下所示。
- SQL Server Analysis Services – This is the on-premise version that ships with SQL Server and can be installed on any server running Windows. This version supports both multidimensional and tabular data models SQL Server Analysis Services –这是SQL Server附带的本地版本,可以安装在运行Windows的任何服务器上。 该版本支持多维和表格数据模型
- Azure Analysis Services – This is the SaaS offering from Microsoft, which can be consumed as an Azure resource. Azure Analysis Services currently supports only Tabular models with a compatibility level of 1200 or higher. You can develop the tabular data models using Visual Studio and deploy it to the Azure Analysis Services Azure分析服务 –这是Microsoft提供的SaaS产品,可以作为Azure资源使用。 Azure分析服务当前仅支持兼容级别为1200或更高的表格模型。 您可以使用Visual Studio开发表格数据模型,并将其部署到Azure Analysis Services
- Power BI Premium – This is currently in preview mode and has added support for Power BI Premium datasets, which have a compatibility level of 1500 or higher. It also provides extensibility by providing client libraries and APIs which can support the open-standard XMLA protocol Power BI Premium –当前处于预览模式,并增加了对Power BI Premium数据集的支持,兼容性级别为1500或更高。 它还通过提供可支持开放标准XMLA协议的客户端库和API来提供可扩展性。
SQL Server Data Tools (SSDT) is the authoring tool that is used to develop and deploy SSAS cubes. This feature comes with a stand-alone installation until Visual Studio 2017. However, for Visual Studio 2019, it can be downloaded and installed as an extension from the Visual Studio Marketplace. This article focusses only on how to deploy SSAS cubes and does not emphasize on the development of SSAS cubes.
SQL Server数据工具(SSDT)是用于开发和部署SSAS多维数据集的创作工具。 此功能随Visual Studio 2017之前的独立安装一起提供。但是,对于Visual Studio 2019,可以从Visual Studio Marketplace中下载并作为扩展安装。 本文仅专注于如何部署SSAS多维数据集,而没有重点介绍SSAS多维数据集的开发。
First, it is important to know the different artifacts that are being generated while building as SSAS cube. If you see the figure below, you can see that there are four files. These files are generated when you build any SSAS project.
首先,重要的是要知道在构建为SSAS多维数据集时正在生成的不同工件。 如果您看到下图,则可以看到有四个文件。 这些文件是在您构建任何SSAS项目时生成的。
File Name | Purpose |
ASDATABASE | This is the actual deployment file that contains data related to all the dimensions and cubes that you have developed using Visual Studio. All the objects are defined in this file |
CONFIGSETTINGS | This file is specific to contain information regarding the data sources and other environment-related information. Although this information is already defined in the ASDATABASE file, it is overridden by the information from this file |
DEPLOYMENTOPTIONS | This file contains information regarding whether to deploy and process all objects and how the objects should be processed |
DEPLOYMENTTARGETS | This is a configuration file that contains the details of the server and instance name on which the project has to be deployed |
文档名称 | 目的 |
数据库 | 这是实际的部署文件,其中包含与使用Visual Studio开发的所有维度和多维数据集相关的数据。 所有对象都在此文件中定义 |
配置 | 该文件专用于包含有关数据源的信息以及其他与环境有关的信息。 尽管此信息已在ASDATABASE文件中定义,但被该文件中的信息覆盖 |
部署选项 | 该文件包含有关是否部署和处理所有对象以及应如何处理对象的信息 |
部署目标 | 这是一个配置文件,其中包含必须在其上部署项目的服务器和实例名称的详细信息 |
Let us now understand different methods by which we can deploy SSAS cubes. I’ll be explaining the following three methods in this article.
现在让我们了解可用于部署SSAS多维数据集的不同方法。 我将在本文中解释以下三种方法。
- Using the Analysis Services Deployment Wizard 使用Analysis Services部署向导
- Using the command-line interface with Analysis Management Objects (AMO) 将命令行界面与Analysis Management Objects(AMO)结合使用
- Using the Database Synchronization Wizard 使用数据库同步向导
Analysis Services部署向导 (Analysis Services Deployment Wizard)
You can start up the Analysis Services Wizard by navigating to the directory mentioned below and run the Microsoft.AnalysisServices.Deployment.exe. For my PC, which has SQL Server 2017 installed, the default location is – “C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Microsoft.AnalysisServices.Deployment.exe”.
您可以通过导航到下面提到的目录来启动Analysis Services向导,然后运行Microsoft.AnalysisServices.Deployment .exe。 对于安装了SQL Server 2017的PC,默认位置为–“ C:\ Program Files(x86)\ Microsoft SQL Server \ 140 \ Tools \ Binn \ ManagementStudio \ Microsoft.AnalysisServices.Deployment.exe ”。
Once the wizard starts, you need to provide the path of the ASDATABSE file and proceed with the deployment process.
向导启动后,您需要提供ASDATABSE文件的路径并继续进行部署过程。
In the next screen, the details of the target server and instance must be provided on which we want to deploy the SSAS cubes. Since I’m deploying it on the default instance, there is no instance name mentioned after the server name. Also, we need to provide the name of the database on which the project must be deployed. By default, it takes the name of the SSAS project as the default database name.
在下一个屏幕中,必须提供要在其上部署SSAS多维数据集的目标服务器和实例的详细信息。 由于我将其部署在默认实例上,因此在服务器名称之后没有提及实例名称。 另外,我们需要提供必须在其上部署项目的数据库的名称。 默认情况下,它将SSAS项目的名称作为默认数据库名称。
In the following screen, you need to define the options pertaining to Partitions and Roles and memberships. In an ideal deployment scenario, we use the options “Deploy Partitions. Any existing partitions will be replaced.” and “Deploy roles and retain members. Roles will be deployed along with their members for new roles. Members for existing roles will be retained.”
在以下屏幕中,您需要定义与分区和角色以及成员资格有关的选项。 在理想的部署方案中,我们使用选项“ 部署分区。 任何现有分区将被替换。 ”和“ 部署角色并保留成员。 角色将与其成员一起部署以用于新角色。 现有角色的成员将保留。 ”
In the following screen, you need to define the Data Source Connection Strings to the source of the SSAS cubes. Click on the button with three dots and define the connection. Also, select an appropriate Data Source Impersonation Information that can be used by the SSAS cube while processing the cubes.
在以下屏幕中,您需要将数据源 连接字符串定义为SSAS多维数据集的源。 单击带有三个点的按钮并定义连接。 另外,选择适当的数据源 模拟信息 ,SSAS多维数据集在处理多维数据集时可以使用该信息 。
Finally, select the Processing Method as “Default Processing” and check the box for “Include all processing in a single transaction”. Hit Next and then Finish. The cube will be deployed and processed accordingly.
最后,将处理方法选择为“ 默认处理 ”,然后选中“将所有处理包括在单个事务中 ”复选框。 点击下一步 ,然后点击完成 。 该多维数据集将进行相应的部署和处理。
The SSAS cube will be deployed, and you can browse the cubes using SQL Server Management Studio.
将部署SSAS多维数据集,并且您可以使用SQL Server Management Studio浏览多维数据集。
分析管理对象命令行界面 (Analysis Management Object Command Line Interface)
Navigate to the directory – “C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Microsoft.AnalysisServices.Deployment.exe” and start the command prompt.
导航到目录–“ C:\ Program Files(x86)\ Microsoft SQL Server \ 140 \ Tools \ Binn \ ManagementStudio \ Microsoft.AnalysisServices.Deployment.exe ”,然后启动命令提示符。
Start with the Microsoft.AnalysisServices.Deployment.exe and provide the path of the ASDATABASE file. Additionally, add the parameters “/d” and “/o” to generate a deployment script in XMLA format.
从Microsoft.AnalysisServices.Deployment.exe开始,并提供ASDATABASE文件的路径。 另外,添加参数“ / d”和“ / o”以生成XMLA格式的部署脚本。
- /d – Represents that the deployment is to be done is a disconnected mode / d –表示要完成的部署是断开模式
- /o – The path of the deployment script / o –部署脚本的路径
Microsoft.AnalysisServices.Deployment.exe
C:\temp\deploy-ssas-cubes\WideWorldImportersMultidimensionalCube.asdatabase
/d /o: C:\temp\deploy-ssas-cubes\DeploymentScript.xlma
Microsoft.AnalysisServices.Deployment.exe
C:\ temp \ deploy-ssas-cubes \ WideWorldImportersMultiDimensionCube.asdatabase
/ d /o:C:\temp\deploy-ssas-cubes\DeploymentScript.xlma
Once the deployment script is generated, you can open the script in SQL Server Management Studio and execute it against the target server. It will deploy the SSAS cube to the target server as required.
生成部署脚本后,您可以在SQL Server Management Studio中打开脚本并针对目标服务器执行该脚本。 它将根据需要将SSAS多维数据集部署到目标服务器。
数据库同步向导 (Database Synchronization Wizard)
The Database Synchronization Wizard is another way to deploy SSAS cubes from one server to another directly. For example, this is useful when the SSAS cubes have already been tested in the test environment and are now ready to be deployed to the staging or production; we can leverage this method and deploy the SSAS cubes. The wizard compares the metadata between two instances of Analysis Services and then makes the target equivalent to that of the source by copying the metadata information from the source server to the target.
数据库同步向导是将SSAS多维数据集从一台服务器直接部署到另一台服务器的另一种方法。 例如,当已经在测试环境中对SSAS多维数据集进行了测试并且现在准备将其部署到阶段或生产中时,这将非常有用。 我们可以利用此方法并部署SSAS多维数据集。 该向导将比较两个Analysis Services实例之间的元数据,然后通过将元数据信息从源服务器复制到目标来使目标与源等效。
I have two instances of Analysis Services running – “SQLTEST01” and “SQLTEST02”. For this example, I’ll try to migrate the SSAS cube “WideWorldImportersMultidimensionalCube” from SQLTEST01 to SQLTEST02 using the Database Synchronization Wizard.
我有两个正在运行的Analysis Services实例–“ SQLTEST01 ”和“ SQLTEST02 ”。 对于此示例,我将尝试使用数据库同步向导将SSAS多维数据集“ WideWorldImportersMultiDimensionCube ”从SQLTEST01迁移到SQLTEST02 。
Right-click on the Databases under SQLTEST02 and select Synchronize.
右键单击SQLTEST02下的数据库 ,然后选择同步 。
In the next screen that appears, select the Synchronization Source Server as the “SQLTEST01” instance and the Database as the “WideWorldImportersMultidimensionalCube”. Click Next once done.
在出现的下一个屏幕中,选择“ 同步源服务器”作为“ SQLTEST01 ”实例,并选择“ 数据库”作为“ WideWorldImportersMultiDimensionCube ”。 完成后,单击“ 下一步” 。
In the following screen, leave everything as default and click on Next.
在以下屏幕中,将所有内容保留为默认值,然后单击Next 。
Finally, select the “Copy all” option for Security roles and members and click on Next. In the next screen, select Synchronize Now and click Finish.
最后,为安全角色和成员选择“ 全部复制 ”选项,然后单击“ 下一步” 。 在下一个屏幕中,选择立即同步 ,然后单击完成 。
Depending on the size of the database, it might take a while to synchronize the databases. You can monitor the progress in the Database Synchronization Progress window.
根据数据库的大小,可能需要一段时间才能同步数据库。 您可以在“ 数据库同步进度”窗口中监视进度。
As you can see, now, the SSAS cube has been deployed to the SQLTEST02 instance as well.
如您所见,现在,SSAS多维数据集也已部署到SQLTEST02实例。
结论 (Conclusion)
In this article, I have explained how to deploy SSAS cubes using three different methods. Although it depends on the environment that you’re trying to deploy the SSAS cubes, the most preferred way of deploying the cubes is by using Analysis Services Deployment Wizard as it has a GUI, which makes the task easier for a lot.
在本文中,我已经解释了如何使用三种不同的方法来部署SSAS多维数据集。 尽管它取决于您尝试部署SSAS多维数据集的环境,但是部署多维数据集的最优选方式是使用Analysis Services部署向导,因为它具有GUI,这使任务简化了很多。
ssas报表项目数据集