Module 5: Creating Multidimensional Databases Course 10778A Module 5: Creating Multidimensional Databases Module 5 Creating Multidimensional Databases
Module 5: Creating Multidimensional Databases Course 10778A Module Overview Module 5: Creating Multidimensional Databases Introduction to Multidimensional Analysis Creating Data Sources and Data Source Views Creating a Cube Overview of Cube Security Inform students that this is an introductory module and most concepts are covered in more depth in subsequent modules. Try not to spend too long going into extra detail because you will just repeat yourself later on.
Lesson 1: Introduction to Multidimensional Analysis Course 10778A Lesson 1: Introduction to Multidimensional Analysis Module 5: Creating Multidimensional Databases The Business Problem The Concepts of Multidimensional Analysis Data Sources Data Source Views Dimensions Measures and Measure Groups Cubes SQL Server Analysis Services as an OLAP Platform Software Requirements for Multidimensional Analysis
Module 5: Creating Multidimensional Databases Course 10778A The Business Problem Module 5: Creating Multidimensional Databases ? Emphasize that there is nothing wrong with online transaction processing (OLTP) systems, but they are designed for a specific task and, even with denormalization, they are not optimized for aggregation. Ask students about their experience of running large reports against transactional systems. Most databases are designed for OLTP, and are not optimal for reporting and analyzing data: Aggregated spanning queries are slow to generate Large queries can cause performance issues for transactional workloads Relational data models are not intuitive for business users
The Concepts of Multidimensional Analysis Course 10778A The Concepts of Multidimensional Analysis Module 5: Creating Multidimensional Databases Only explain the key concepts on this slide. Each of the objects is discussed in more detail in the subsequent topics and lesson. Product Aggregation of sales value by product, customer, and time Customer Time Multidimensional analysis is based on cubes whose core components are measures and dimensions OLAP cubes have aggregations precalculated during processing
Module 5: Creating Multidimensional Databases Course 10778A Data Sources Module 5: Creating Multidimensional Databases SQL Server Analysis Services data sources define connections to databases that contain data for the cube Typically, a data warehouse or data mart
Module 5: Creating Multidimensional Databases Course 10778A Data Source Views Module 5: Creating Multidimensional Databases It can be helpful to compare data source views to a view in a relational database. They are similar in the way that they can filter and format data, and combine data from multiple sources. A data source view provides an abstraction layer that: Combines data from one or more underlying data source Creates a tabular model for cube measures and dimensions Enhances the underlying data schemas with friendly names, queries, and calculated columns
Module 5: Creating Multidimensional Databases Course 10778A Dimensions Module 5: Creating Multidimensional Databases Describe several varying examples of dimensions including regular and ragged. For example, you could describe a time dimension, a product dimension, and a geography dimension. Are used to aggregate numeric business measures Include attributes for analysis and keys that relate them to measures Are typically arranged into hierarchies
Measures and Measure Groups Course 10778A Measures and Measure Groups Module 5: Creating Multidimensional Databases A measure is a column that contains aggregate-able data Usually a column in a fact table Can be defined by using a measure expression Measures are grouped by their underlying fact tables into measure groups Ask students for examples of the values that need to be aggregated in their systems. Some systems will have many measures and some will only have one or two.
Module 5: Creating Multidimensional Databases Course 10778A Cubes Module 5: Creating Multidimensional Databases Point out that although the term cube is used, most cubes in this context have more than three dimensions. To help students understand cubes, however, it makes sense for them to visualize a three-dimensional cube and see how slicing and dicing would retrieve values from this. Provide the point of access to multidimensional data Define the properties of measures and dimensions Are intuitive to navigate for business users
SQL Server Analysis Services as an OLAP Platform Course 10778A SQL Server Analysis Services as an OLAP Platform Module 5: Creating Multidimensional Databases Emphasize that Microsoft® SQL Server® has evolved into an enterprise-level online analytical processing (OLAP) platform. High performance Highly scalable Wide range of tools Intuitive front end through Microsoft Office and Microsoft SharePoint
Software Requirements for Multidimensional Analysis Course 10778A Software Requirements for Multidimensional Analysis Module 5: Creating Multidimensional Databases Windows Server 2008 SP2 or R2 (64-bit) or later SQL Server Standard, Business Intelligence, Developer, Enterprise, or Evaluation Edition
Lesson 2: Creating Data Sources and Data Source Views Course 10778A Lesson 2: Creating Data Sources and Data Source Views Module 5: Creating Multidimensional Databases Creating a Data Source Creating a Data Source View Modifying a Data Source View
Module 5: Creating Multidimensional Databases Course 10778A Creating a Data Source Module 5: Creating Multidimensional Databases You could demonstrate the creation of a data source to show students how straightforward it is. Use the Data Source Wizard in SQL Server Data Tools
Creating a Data Source View Course 10778A Creating a Data Source View Module 5: Creating Multidimensional Databases Compare data source views to views in relational databases. Most of the concepts are the same. Use the Data Source View Wizard in SQL Server Data Tools
Modifying a Data Source View Course 10778A Modifying a Data Source View Module 5: Creating Multidimensional Databases Tell students that they can apply the core settings of a data source view by using the Data Source View Wizard, but to completely configure the data source view, they should modify its properties. Create user-friendly names Use named queries Create relationships to improve performance
Demonstration: Creating a Data Source and a Data Source View Course 10778A Demonstration: Creating a Data Source and a Data Source View Module 5: Creating Multidimensional Databases In this demonstration, you will see how to: Create a new SSAS project Create a data source Create a data source view Modify a data source view Task 1: Create a new SSAS project Ensure that the MIA-DC1 and MIA-SQLBI virtual machines are both running, and then log on to MIA- SQLBI as ADVENTUREWORKS\Student with the password Pa$$w0rd. Then in the D:\10778A\Demofiles\Mod05 folder, run Setup.cmd as Administrator. Click Start, click All Programs, click Microsoft SQL Server 2012, and then click SQL Server Data Tools. Click New Project. Select Analysis Services Multidimensional and Data Mining Project. In the Name field, type Demo. In the Location field, type D:\10778A\Demofiles\Mod05, and then click OK. Task 2: Create a data source for the AdventureWorksDW relational database In Solution Explorer, right-click Data Sources, and then click New Data Source. On the Welcome to the Data Source Wizard page, click Next. On the Select how to define the connection page, click New. In the Server name field, type localhost. In the Select or enter a database name field, click AdventureWorksDW, and then click OK. Click Next. Click Use a Specific Windows user name and password, and enter the user name ADVENTUREWORKS\Student and the password Pa$$w0rd. Then click Next. In the Data source name field, type AdventureWorks Demo DS, and then click Finish. 17
Lesson 3: Creating a Cube Course 10778A Lesson 3: Creating a Cube Module 5: Creating Multidimensional Databases Options for Creating a Cube Considerations for Time Dimensions The Cube Designer Browsing a Cube
Options for Creating a Cube Course 10778A Options for Creating a Cube Module 5: Creating Multidimensional Databases Use the Cube Wizard to create the cube Create dimensions in the Cube Wizard or separately Build a cube by using an existing data source and data source view or create the database schema after cube creation Automatically build attributes and hierarchies or define them in the Cube Designer after cube creation Talk through the options for a data source. When would students use a data source that connects to existing data? When would students create an empty cube that does not use an existing data source? When would students generate tables in the data source?
Considerations for Time Dimensions Course 10778A Considerations for Time Dimensions Module 5: Creating Multidimensional Databases Discuss how the different levels of time (years, quarters, months, weeks, and days) do not fit neatly into each other. A single hierarchy cannot contain both weeks and months. Discuss which week the last day of the year goes into (week 53) and how this could affect weekly sales reports. Discuss alternative methods of storing dates (some companies use 13 four-week months). Ask students whether there are any additional properties that they might store, such as public holidays. Time dimensions can have multiple hierarchies You can store time dimensions on the server or in a table: Server time dimensions are fast and straightforward Time dimension tables allow additional properties and can be more functional
Module 5: Creating Multidimensional Databases Course 10778A The Cube Designer Module 5: Creating Multidimensional Databases Use the Cube Designer to: Set and modify cube properties Add KPIs and actions Change cube partitioning and storage Create aggregations Create perspectives Add translations Browse cube data Inform students that this is just an introduction and the Cube Designer is discussed in detail in the next module.
Module 5: Creating Multidimensional Databases Course 10778A Browsing a Cube Module 5: Creating Multidimensional Databases Inform students that this is an introductory module and that they will browse cubes by using subcubes and perspectives in subsequent modules. Browse the cube from within SQL Server Data Tools Analyze in Excel
Demonstration: Creating and Browsing a Cube Course 10778A Demonstration: Creating and Browsing a Cube Module 5: Creating Multidimensional Databases In this demonstration, you will see how to: Create a cube Deploy and browse a cube Customize cube measures and dimensions Task 1: Create a cube Ensure that you have completed the previous demonstration in this module. Maximize SQL Server Data Tools, which should be open with the Demo project loaded. In Solution Explorer, right-click Cubes, and click New Cube. On the Welcome to the Cube Wizard page, click Next. On the Select Creation Method page, ensure that Use existing tables is selected, and click Next. On the Select Measure Group Tables page, click Suggest. Then note that the wizard identifies Internet Sales as a measure group table, and click Next. On the Select Measures page, clear the Internet Sales checkbox to clear all selections, and then select the Total Product Cost and Sales Amount measures. Then click Next. On the Select New Dimensions page, clear the parent Internet Sales checkbox, and click Next. On the Completing the Wizard page, change the cube name to Demo Cube and click Finish. The cube is created and opened in the cube designer. Task 2: Deploy and browse a cube In Solution Explorer, right-click Demo and click Deploy. If prompted, enter the password Pa$$w0rd for the ADVENTUREWORKS\Student user. Then wait for the deployment process to finish. In the cube designer, click the Browser tab. In the Metadata pane, expand Measures and expand Internet Sales. The wizard has created the measures you selected. Drag the Sales Amount measure to the Drag levels or measures here to add to the query area. The total sales amount for all Internet sales is shown. In the Metadata pane, note that the wizard has created dimensions for the DimCustomer and DimProduct tables. It has also determined that there are three relationships defined between the Internet Sales table and the DimDate table, and so has a dimension for each related column (Due Date, Order Date, and Ship Date). Expand each of the dimensions and note the wizard has only created attributes for key columns. You will need to modify the dimensions to add meaningful attributes for analysis. Drag the Product Key attribute from the Dim Product dimension and drop it to the left of the Sales Amount value in the grid. The browser now shows the aggregated sales amount totals for each product key. 24
Lesson 4: Overview of Cube Security Course 10778A Lesson 4: Overview of Cube Security Module 5: Creating Multidimensional Databases SSAS Security Model Adding Members to the Server Role Creating Database Roles Granting Data Source and Cube Permissions Granting Cell Permissions Granting Dimension and Dimension Data Permissions Testing Security Permissions
Module 5: Creating Multidimensional Databases Course 10778A SSAS Security Model Module 5: Creating Multidimensional Databases Point out the differences with security in the SQL Server Database Engine. The only security model in SSAS is Windows authentication. Uses Windows authentication Assigns permissions based on role membership Permissions can be applied to databases, data sources, dimensions, individual dimension members, and individual cells
Adding Members to the Server Role Course 10778A Adding Members to the Server Role Module 5: Creating Multidimensional Databases Describe the server role and the level of administrator rights that it allows. Ask students whether all administrators need this level of access to the database. The server role is the only role at server level You cannot change server role permissions
Creating Database Roles Course 10778A Creating Database Roles Module 5: Creating Multidimensional Databases Ask students what roles they would create in their database. Are any of these roles replicated? Decide access levels Group users into these roles Create database roles: Using SQL Server Management Studio Using SQL Server Data Tools
Granting Data Source and Cube Permissions Course 10778A Granting Data Source and Cube Permissions Module 5: Creating Multidimensional Databases Ask students why most users do not need data source permissions. Ask students whether most users would need read permission to the whole cube and no other security settings need to be applied. Most users do not need data source permissions Cube permissions are either read or read/write By default, the cube permission applies to dimensions and individual cells within the cube
Granting Cell Permissions Course 10778A Granting Cell Permissions Module 5: Creating Multidimensional Databases Spend some time discussing read-contingent permissions until students fully understand the implications. Read-only Read/write Read-contingent
Granting Dimension and Dimension Data Permissions Course 10778A Granting Dimension and Dimension Data Permissions Module 5: Creating Multidimensional Databases Point out that although Multidimensional Expressions (MDX) statements are used to specify dimension members, in most cases, this is achieved by simply selecting the dimension member from a list. By default, cube access grants read-only access to all members of all dimensions Read/write access enables dimension processing Use MDX statements to specify the exact dimension members that permissions should apply to
Testing Security Permissions Course 10778A Testing Security Permissions Module 5: Creating Multidimensional Databases The main point is to ensure that students perform security tests. The data that is stored in an OLAP cube is typically very sensitive and you must ensure security of that data. Using SQL Server Data Tools Using other applications
Demonstration: Applying Cube Security Course 10778A Demonstration: Applying Cube Security Module 5: Creating Multidimensional Databases In this demonstration, you will see how to: Create a role Test a role Task 1: Create a role Ensure that you have completed the previous demonstration in this module. Maximize SQL Server Data Tools, which should be open with the Demo project loaded. In Solution Explorer, right-click Roles, and click New Role. Then in Solution Explorer, right-click the Role.role icon that has been added, click Rename, and change the name to Restricted User.role. when prompted to change the object name as well, click Yes. In the role designer, on the General tab, note that by default this role has no database permissions. On the Membership tab, note that this is where you can add Windows users and groups to the role. On the Data Sources tab, note that by default the role has no access to any data sources. On the Cubes tab, change the Access value for Demo Cube to Read. This allows the role to access the cube and read its data. On the Cell Data tab, note that this is where you can specify MDX statements that define cells in the cube which you want to permit or deny this role to access. On the Dimensions tab, note that the role has Read access to all dimensions in the database. Then in the Select Dimension Set list at the top of the page, click Demo Cube cube dimensions and note that these permissions are inherited by the dimensions in the Demo Cube cube. On the Dimension Data tab, in the Dimension list, under Demo Cube, select Measures Dimension. Then on the Basic tab, clear the checkbox for the Cost measure. In the Dimension list, under Demo Cube, select Product, and on the Basic tab, in the Attribute hierarchy list, select Product Name. Select Deselect all members. Then scroll to the bottom of the list of product names and select only the products that begin with the word Touring. On the File menu, click Save All. 34
Module 5: Creating Multidimensional Databases Course 10778A Lab Scenario Module 5: Creating Multidimensional Databases Students will perform the lab in the role of a BI professional in the Adventure Works Cycles company, and: Create a SQL Server Analysis Services project and add a data source for the data warehouse containing the company’s business data Create a data source view that acts as an abstraction layer for the data warehouse and provides the basis for an OLAP cube Create a and modify a cube that provides some simple analytical capabilities Point out that the instructions in the lab are deliberately designed to be high-level so that students need to think carefully about what they are trying to accomplish and work out how best to proceed for themselves. Encourage students to read the scenario information carefully and collaborate with each other to meet the scenario requirements. Remind students that if they find a particular task or exercise too challenging, they can find step-by-step instructions in the lab answer key. You have created a reporting solution at Adventure Works Cycles, but some business analysts have requested an analytical solution that enables them to “slice and dice” business data to perform their own business analysis.
Lab 5: Creating a Multidimensional Database Course 10778A Lab 5: Creating a Multidimensional Database Module 5: Creating Multidimensional Databases Exercise 1: Creating a Data Source Exercise 2: Creating and Modifying a Data Source View Exercise 3: Creating and Modifying a Cube In this lab, students will develop a multidimensional database that contains a basic cube. Exercise 1 In this exercise, students will create a data source for the AdventureWorksDW database. Exercise 2 In this exercise, students will create a data source view and modify the presentation of the AdventureWorksDW schema in SSAS. Exercise 3 In this exercise, students will create, modify, and browse a multidimensional cube. Logon information Virtual machine MIA-SQLBI User name ADVENTUREWORKS\Student Password Pa$$w0rd Estimated time: 30 minutes
Module Review and Takeaways Course 10778A Module Review and Takeaways Module 5: Creating Multidimensional Databases What are some of the name matching methods available when creating a data source view? How can you use the Cube Designer to configure a cube after it has been created? After creating a data source by using the Data Source Wizard, what tool would you use to modify the data source? How do time dimensions differ from other dimensions? Review Questions Point the students to the appropriate section in the course so that they are able to answer the questions presented in this section. Some guidance for discussing the answers to the questions is included below. What are some of the name matching methods available when creating a data source view? Some of the name matching methods that are available when creating a data source view include Same name as primary key, Same name as destination table name, Destination table name + primary key name. How can you use the Cube Designer to configure a cube after it has been created? You can do this by using the Cube Structure tab, the Dimension Usage tab, or other tabs of Cube Designer as needed. After creating a data source by using the Data Source Wizard, what tool would you use to modify the data source? You would use Data Source Designer to modify the data source. How do time dimensions differ from other dimensions? Time dimensions contain inherent functionality that groups the members into levels, such as days, weeks, months, and years.