介绍 (Introduction)

多维多维数据集和事务数据库是两个非常不同的事物。 从经验中,我什至是经验丰富的DBA都完全避免使用多维数据集这一主题,因为对于他们而言,多维数据集实在是一个未知领域。 通常,多维数据集工作会传递给开发人员,因为他们可以轻松使用Visual Studio。 这是非常遗憾的,因为实际上创建OLAP多维数据集并不是很困难。 可以肯定地说,大多数工作需要在传统SQL Server数据库引擎/ SSIS环境中完成,从创建数据仓库模型到保持ETL数据包的状态。 本文假设您已经有一个数据仓库,并以AdventureWorksDW2012为例。 遵循这些步骤将使您踏上基于读取优化的OLAP多维数据集的体面SQL Server商业智能解决方案。

  • *Please note: You will need SQL Server Data Tools or SQL Server Business Intelligence Developments Studio (BIDS). You can get it here.
  • *请注意:您将需要SQL Server数据工具或SQL Server商业智能开发工作室(BIDS)。 你可以在这里得到。

入门 (Getting started)

Every OLAP cube is created with an analytics solution. To create one, open SQL Server Data Tools or BIDS and create a new “Analysis Services Multidimensional and Data Mining Project”

每个OLAP多维数据集都是使用分析解决方案创建的。 要创建一个,请打开SQL Server数据工具或BIDS并创建一个新的“ Analysis Services多维和数据挖掘项目”

This will open a blank solution and will create the basic folders needed in the solution explorer. Something that is quite handy to know about SQL Server Analysis projects is that the order of creation or the workflow follows the order of the folders in the Solution Explorer.

这将打开一个空白解决方案,并将创建解决方案资源管理器中所需的基本文件夹。 关于SQL Server Analysis项目,很容易知道的一点是,创建或工作流的顺序遵循解决方案资源管理器中文件夹的顺序。

So the order of creation has to be:

因此创建顺序必须为:

  1. Data Source数据源
  2. Data Source View数据源视图
  3. OLAP CubeOLAP多维数据集
  4. Dimensions外型尺寸

So let’s start by creating a new data source. To do this, right click on Data Sources and click “New Data Source”. This will open a wizard that will allow you to make a normal database connection to your data warehouse:

因此,让我们开始创建一个新的数据源。 为此,请右键单击“数据源”,然后单击“新数据源”。 这将打开一个向导,该向导将允许您与数据仓库建立正常的数据库连接:

In the next step you will be asked to specify the type of connection. It is important here to think of the type of security you will need for your OLAP cube. I recommend creating service account on your Active Directory and using the “Use a specific Windows user name and password” option to set this user. You can find more information about this here.

在下一步中,将要求您指定连接类型。 在这里重要的是要考虑OLAP多维数据集所需的安全性类型。 建议您在Active Directory上创建服务帐户,并使用“使用特定的Windows用户名和密码”选项来设置该用户。 您可以在此处找到有关此信息的更多信息。

Having completed this step you now have a source of data for your OLAP cube. Next you have to create a data source view and specify which data you want to use for your cube. This is done by right clicking on the Data Source Views folder and adding a new one. The wizard will ask you which connection you would like to use and which fact / dimension tables you want to base your cube on. Generally you will want to select all dimension and fact tables and deal with the partitioning later in the cube, so you can go ahead and do this. You also have the option of choosing only parts of your data warehouse. For simplicity I have done this and only chosen the Internet Sales sections of the AdventureWorksDW2012 database.

完成此步骤后,您现在有了OLAP多维数据集的数据源。 接下来,您必须创建一个数据源视图,并指定要用于多维数据集的数据。 可以通过右键单击“数据源视图”文件夹并添加一个新文件夹来完成。 向导将询问您要使用哪个连接,以及要作为多维数据集基础的事实/维度表。 通常,您将需要选择所有维度表和事实表,并稍后在多维数据集中处理分区,因此可以继续进行操作。 您还可以选择仅选择数据仓库的一部分。 为简单起见,我这样做了,仅选择了AdventureWorksDW2012数据库的“ Internet销售”部分。

It is important to have correct foreign key relations in your data warehouse beforehand because SQL Server Data Tools is able to create a decent view diagram using existing relations in the DW. If you have not done this you will have to explicitly specify the relations between your fact and dimension tables. If all goes well you will have a view similar to this:

事先在数据仓库中具有正确的外键关系很重要,因为SQL Server数据工具能够使用DW中的现有关系创建体面的视图。 如果尚未执行此操作,则必须明确指定事实表和维表之间的关系。 如果一切顺利,您将具有类似于以下的视图:

Now comes the fun part: creating the cube structure. Once you have a data source view set up you can create a cube. Right click on “Cubes” and create a “New Cube”. In this wizard you should choose to “Use existing tables”. You will then be prompted to select your “Measure Group Tables”. These are your fact tables. Select them and click next. The wizard will then automatically detect fields that can be used as measures. Click next again. Assuming your foreign keys were correct in the DW or you did the explicit relations correctly in the data source view, the wizard will now automatically select the necessary dimensions. In order to explicitly declare the relations between tables the easiest way is to drag and drop the joins between the table key / foreign key in the interface / data source view model. Once this is done, click next once again. Give your cube a name and click “Finish”.

现在来了有趣的部分:创建多维数据集结构。 一旦设置了数据源视图,就可以创建多维数据集。 右键单击“多维数据集”,然后创建“新多维数据集”。 在此向导中,您应该选择“使用现有表”。 然后将提示您选择“度量值组表”。 这些是您的事实表。 选择它们,然后单击下一步。 然后,向导将自动检测可用作度量的字段。 再次单击下一步。 假设您的外键在DW中是正确的,或者您在数据源视图中正确地执行了显式关系,该向导现在将自动选择必要的尺寸。 为了明确声明表之间的关系,最简单的方法是在接口/数据源视图模型中拖放表键/外键之间的联接。 完成后,再次单击下一步。 给您的多维数据集命名,然后单击“完成”。

Voila! You now have your very first cube structure. It should look something like this:

瞧! 现在,您有了第一个多维数据集结构。 它看起来应该像这样:

You are nearly done. The basic configuration is complete but your cube only exists as a blueprint at this stage. In order to create it on your Analysis Services server you first need to tell Data Tools where your server is located. This is done by clicking on Project > [YourProjectName] Properties and then going to the deployment tab. Here you can specify the location of your Analysis Services server and the name of your database (if it does not exist it will be created):

您快完成了。 基本配置已完成,但是您的多维数据集在此阶段仅作为蓝图存在。 为了在Analysis Services服务器上创建它,您首先需要告诉Data Tools服务器所在的位置。 单击“项目”>“ [YourProjectName]属性”,然后转到“部署”选项卡,即可完成此操作。 在这里,您可以指定Analysis Services服务器的位置和数据库的名称(如果不存在,则将创建数据库):

To create the cube and process the data from the data warehouse to the new cube you need to click Build > Process… in the superior Visual Studio toolbar or by right clicking on your cube file within the solution.This will bring up a screen saying your database is out of date (which is normal as it does not exist yet), agree to build and deploy your project and Data Tools will create the database. Next a “Process Cube” screen will appear:

要创建多维数据集并处理从数据仓库到新多维数据集的数据,您需要单击高级Visual Studio工具栏中的Build> Process…,或在解决方案中右键单击您的多维数据集文件。这将弹出一个屏幕,提示您数据库已过时(这是正常的,因为尚不存在),请同意构建和部署您的项目,然后数据工具将创建数据库。 接下来将出现“ Process Cube”屏幕:

At this screen you can leave everything as default and click “Run…” and if you have no configuration errors your cube will process:

在此屏幕上,您可以将所有内容保留为默认值,然后单击“运行...”,如果没有配置错误,则多维数据集将处理:

Once you have processed the cube for the first time you can explore the data through the solution by opening the cube and clicking on the “Browser” tab. You can also bring up the same screen by opening SQL Server Management Studio and connecting to your Analysis Server (careful not to connect to the usual database engine) and right clicking on the cube. There you can choose “Explore”.

首次处理多维数据集后,您可以通过打开多维数据集并单击“浏览器”选项卡来浏览解决方案中的数据。 您还可以通过打开SQL Server Management Studio并连接到Analysis Server(请注意不要连接到常用的数据库引擎)并右键单击多维数据集来调出相同的屏幕。 在这里,您可以选择“浏览”。

On this screen you can verify the data in the cube and also generate basic queries to use in your reports. The reports also have this query designer window if you choose an analysis source instead of a normal SQL Server database source. The queries created are in MDX format which is a whole other language. You can get a feel for it on the MSDN website. However, the subject of creating SSRS reports based on MDX queries will be covered in a later article.

在此屏幕上,您可以验证多维数据集中的数据,还可以生成要在报表中使用的基本查询。 如果您选择分析源而不是普通SQL Server数据库源,则报表也具有此查询设计器窗口。 创建的查询采用MDX格式,这是另一种语言。 您可以在MSDN网站上找到它。 但是,在以后的文章中将介绍基于MDX查询创建SSRS报告的主题。

从这里到哪里? (Where to from here?)

Once you have a basic cube up and running there are many things you may want to do to enhance the user experience. Some examples of advanced features are calculated measures (to create year to date sums or current month sums that are pre-calculated), hierarchical dimensions which can be used to order dimensions and allow for a more meaningful drill down to the data a user may need. These types of things can be added to the cube by using the selection of tabs in the Cube screen in Data Tools:

一旦建立了基本的多维数据集并开始运行,您可能需要做很多事情来增强用户体验。 高级功能的一些示例包括:计算量度(用于创建预先计算的年初至今的总和或当月总和),可用于订购维度的分层维度,并允许更有意义地向下钻取用户可能需要的数据。 通过使用“数据工具”中“多维数据集”屏幕中的选项卡选择,可以将这些类型的事物添加到多维数据集中:

Once the changes have been made to your cube solution you can apply them to the cube by reprocessing from the analytics solution as you did above.

对多维数据集解决方案进行更改后,您可以像上面一样通过从分析解决方案重新处理将它们应用于多维数据集。

In conclusion, you may want to think of the following things:

总之,您可能需要考虑以下几点:

  • Add a cube processing step to your ETL package that is used to update the data warehouse.将多维数据集处理步骤添加到用于更新数据仓库的ETL包中。
  • Set up your report server and start creating reports设置您的报告服务器并开始创建报告
  • Add advanced calculated measures, hierarchical dimensions and cube perspectives添加高级计算量度,层次结构维度和多维数据集透视图
  • Investigate the utility of SharePoint and self-service reports调查SharePoint和自助服务报告的实用程序

参考资料 ( References)

The Basic MDX Query
SSAS Impersonation Smackdown – Specific Windows Acct vs Service Acct How to Create an Analysis Services Cube

基本MDX查询
SSAS模拟模仿-特定的Windows Acct与Service Acct 如何创建Analysis Services多维数据集

翻译自: https://www.sqlshack.com/sql-server-business-intelligence-features-olap-cube-creating/

SQL Server商业智能功能–创建简单的OLAP多维数据集相关推荐

  1. SQL Server商业智能功能– SQL Server数据工具–商业智能

    介绍 (Introduction) 在上一篇有关introduction to SQL Server business intelligence we covered the general stru ...

  2. ssas报表项目数据集_处理SSAS多维OLAP多维数据集的有效方法

    ssas报表项目数据集 介绍 (Introduction) While building and deploying an SSAS OLAP cube, there are two processi ...

  3. SQL Server商业智能–简介

    BL的负担 (What a load of Bl-) 您可能想知道什么是商业智能. 如果您正在阅读本文,则您可能具有Microsoft SQL Server或至少一个其他关系数据库管理系统(RDBMS ...

  4. SQL Server审计功能入门:CDC(Change Data Capture)

    原文:SQL Server审计功能入门:CDC(Change Data Capture) 介绍 SQL Server 2008引入了CDC(Change Data Capture),它能记录: 1. ...

  5. 使用SQL Server分区表功能提高数据库的读写性能

    首先祝大家新年快乐,身体健康,万事如意. 一般来说一个系统最先出现瓶颈的点很可能是数据库.比如我们的生产系统并发量很高在跑一段时间后,数据库中某些表的数据量会越来越大.海量的数据会严重影响数据库的读写 ...

  6. SQL Server审核功能–发现和体系结构

    介绍 (Introduction) Intended audience 目标听众 This document is intended for database administrators who p ...

  7. 使用SQL Server更改跟踪创建SQL Server审核

    This continuation of our SQL Server auditing series is on SQL Server Change Tracking and will cover ...

  8. sql server 加密_SQL Server机密–第II部分– SQL Server加密功能

    sql server 加密 透明数据加密(TDE) ( Transparent Data Encryption (TDE) ) SQL Server has two ways of encryptin ...

  9. sql server 加密_SQL Server机密–第一部分–加密基础知识和SQL Server加密功能

    sql server 加密 介绍 (Intro) We use cryptography every day: on the internet, mobile devices, ATM machine ...

最新文章

  1. dma接收双缓存 stm32_容易被大多数人忽视的STM32串口DMA问题
  2. python 函数调用列表_在项目列表上调用一个函数的最简洁方法 - python
  3. 分享一个Vant Weapp小程序UI组件库
  4. 全链路压测自动化实践 1
  5. vmware 虚拟机设置 redhat 桥接模式
  6. Ext JS 6开发实例(三) :主界面设计
  7. Spring源码之ApplicationContext(五)激活BeanFactory
  8. 容器就业市场持续增长,5条建议让您快速掌握Docker技能
  9. Java 网络爬虫,就是这么的简单
  10. JAVA--文本编辑器
  11. 谷哥学术2022年2月份资源分享下载列表 13/20
  12. 阿里云 mysql 100_【故障公告】阿里云 RDS 数据库服务器 CPU 100% 造成全站故障
  13. 如何建立线上问题快速响应机制
  14. 网络安全知识竞赛(国家信息安全水平考试NISP)模拟题1
  15. 51单片机寻迹小车完整程序
  16. 每日安全文章【1122】
  17. cf端游界面更新显示服务器繁忙,电脑登录cf老是显示更新失败怎么办
  18. 两款网页在线刷网站访客pv和ip的源码
  19. python2和python3的区别
  20. @EventListener 的使用

热门文章

  1. Java操作Hive
  2. H3C 典型数据链路层标准
  3. 2、Shiro的认证
  4. [转]B树(多向平衡查找树)详解
  5. LeetCode:Generate Parentheses
  6. 【24】淘宝sdk——入门实战之左右悬浮模块
  7. 麦考林周三股价下跌7.39%报收于6.1美元
  8. RHEL 4 下 ISCSI Enterprise Target 的常用配置和常用操作
  9. Error: listen EADDRINUSE: address already in use :::5000
  10. 去海南旅游什么时间段去最好,哪里最好玩?