Tải bản đầy đủ (.pdf) (889 trang)

Microsoft SQL Server 2008 Analysis Services Unleashed ppt

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (9.84 MB, 889 trang )

Microsoft
®
SQL
Server

2008
Analysis Services
UNLEASHED
800 East 96th Street, Indianapolis, Indiana 46240 USA
Irina Gorbach
Alexander Berger
Edward Melomed


Microsoft® SQL Server™ 2008 Analysis Services Unleashed
Copyright © 2009 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval
system, or transmitted by any means, electronic, mechanical, photocopying, recording,
or otherwise, without written permission from the publisher. No patent liability is
assumed with respect to the use of the information contained herein. Although every
precaution has been taken in the preparation of this book, the publisher and author
assume no responsibility for errors or omissions. Nor is any liability assumed for
damages resulting from the use of the information contained herein.
ISBN-13: 978-0-672-33001-8
ISBN-10: 0-672-33001-6
Library of Congress Cataloging-in-Publication Data:

Melomed, Edward.
Microsoft SQL server 2008 analysis services unleashed / Edward
Melomed, Alexander Berger, Irina Gorbach.
p. cm.
ISBN 978-0-672-33001-8
1. SQL server. 2. Client/server computing. 3. Relational databases.
I. Berger, Alexander. II. Gorbach, Irina. III. Title.
QA76.9.C55M483 2008
005.75'65 dc22
2008049303
Printed in the United States of America
First Printing December 2008

Trademarks
All terms mentioned in this book that are known to be trademarks or service marks
have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of
this information. Use of a term in this book should not be regarded as affecting the
validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possi-
ble, but no warranty or fitness is implied. The information provided is on an “as is”
basis. The authors and the publisher shall have neither liability nor responsibility to any
person or entity with respect to any loss or damages arising from the information
contained in this book.
Bulk Sales

Pearson offers excellent discounts on this book when ordered in quantity for bulk
purchases or special sales. For more information, please contact:
U.S. Corporate and Government Sales
1-800-382-3419

For sales outside of the U.S., please contact:
International Sales
+1-317-581-3793

Editor-in-Chief
Karen Gettman
Executive Editor

Neil Rowe
Acquisitions Editor
Brook Farling
Development Editor
Mark Renfrow
Managing Editor
Patrick Kanouse
Project Editor
Jennifer Gallant
Copy Editor
Keith Cline
Indexer

Ken Johnson
Proofreader
Water Crest
Publishing, Inc.
Publishing
Coordinator
Cindy Teeters
Book Designer
Gary Adair
Compositor
Mark Shirar
Graphics

Laura Robbins
Contents at a Glance
Introduction 1
Part 1: Introduction to Analysis Services
1 Introduction to OLAP and Its Role in Business Intelligence 7
2 Multidimensional Space 17
3 Client/Server Architecture and Multidimensional Databases: An Overview27
Part 2: Creating Multidimensional Models
4 Conceptual Data Model 37
5 Dimensions in the Conceptual Model 43
6 Cubes and Multidimensional Analysis 63
7 Measures and Multidimensional Analysis 75

8 Advanced Modeling 91
9 Multidimensional Models and Business Intelligence
Development Studio 109
Part 3 Using MDX To Analyze Data
10 MDX Concepts 139
11 Advanced MDX 161
12 Cube-Based MDX Calculations 189
13 Dimension-Based MDX Calculations 221
14 Extending MDX with Stored Procedures 237
15 Key Performance Indicators, Actions, and the
DRILLTHROUGH Statement 261
16 Writing Data into Analysis Services 291

Part 4 Creating a Data Warehouse
17 Loading Data from a Relational Database 307
18 DSVs and Object Bindings 317
19 Multidimensional Models and Relational Database Schemas 329
Part 5 Bringing Data into Analysis Services
20 The Physical Data Model 345
21 Dimension and Partition Processing 377
22 Using SQL Server Integration Services to Load Data 407
23 Aggregation Design and Usage-Based Optimization 417
24 Proactive Caching and Real-Time Updates 435
25 Building Scalable Analysis Services Applications 451
Part 6 Analysis Server Architecture

26 Server Architecture and Command Execution 477
27 Memory Management 503
28 Thread Management 521
29 Architecture of Query Execution—Calculating MDX Expressions 527
30 Architecture of Query Execution—Retrieving Data from Storage 553
Part 7 Accessing Data in Analysis Services
31 Client/Server Architecture and Data Access 569
32 XML for Analysis 579
33 ADOMD.NET 599
34 Analysis Management Objects 669
Part 8 Security
35 Security Model for Analysis Services 713

36 Securing Dimension Data 731
37 Securing Cell Values 751
Part 9 Management
38 Using Trace to Monitor and Audit Analysis Services 763
39 Backup and Restore Operations 787
40 Deployment Strategies 805
41 Resource Monitoring 815
Index 823
Table of Contents
Introduction 1
Part 1: Introduction to Analysis Services
1 Introduction to OLAP and Its Role in Business Intelligence 7

The Multidimensional Data Model 8
The Conceptual Data Model 9
The Application Data Model 9
The Physical Data Model 9
Unified Dimensional Model 11
Basic Concepts 13
2 Multidimensional Space 17
Describing Multidimensional Space 17
Dimension Attributes 20
Cells 22
Measures 22
Aggregation Functions 23

Subcubes 24
3 Client/Server Architecture and Multidimensional Databases: An Overview 27
Two-Tier Architecture 28
One-Tier Architecture 29
Three-Tier Architecture 30
Four-Tier Architecture 31
Distributed Systems 32
Distributed Storage 32
Thin Client/Thick Client 32
Part 2: Creating Multidimensional Models
4 Conceptual Data Model 37
Data Definition Language 37

Objects in DDL 38
Multilanguage Support 39
Rules of Ordering 41
Specifying Default Properties 41
Rules of Inheritance 42
5 Dimensions in the Conceptual Model 43
Dimension Attributes 44
Attribute Properties and Values 45
Relationships Between Attributes 47
Attribute Member Keys 50
Attribute Member Names 53
Relationships Between Attributes 54

Dimension Hierarchies 57
Types of Hierarchies 57
Attribute Hierarchies 60
6 Cubes and Multidimensional Analysis 63
Cube Dimensions 65
Cube Dimension Attributes 68
Cube Dimension Hierarchies 69
Role-Playing Dimensions 70
The Dimension Cube 71
Perspectives 72
7 Measures and Multidimensional Analysis 75
Measures in a Multidimensional Cube 76

SUM 78
MAX and MIN 79
COUNT 79
DISTINCT COUNT 79
Measure Groups 81
Measure Group Dimensions 84
Granularity of a Fact 84
Measure Group Dimension Attributes and
Cube Dimension Hierarchies 87
8 Advanced Modeling 91
Parent-Child Relationships 91
Parent-Child Hierarchies 94

Attribute Discretization 95
Indirect Dimensions 97
Referenced Dimensions 98
Many-to-Many Dimensions 102
Measure Expressions 105
Linked Measure Groups 107
9 Multidimensional Models and Business Intelligence Development Studio 109
Creating a Data Source 110
Creating a New Data Source 110
Modifying an Existing Data Source 111
Modifying a DDL File 112
Designing a Data Source View 114

Creating a New Data Source View 114
Modifying a DSV 115
Contents
vi
Designing a Dimension 117
Creating a Dimension 118
Modifying an Existing Dimension 119
Designing a Cube 124
Creating a Cube 124
Modifying a Cube 125
Building a Cube Perspective 130
Defining Cube Translations 131

Configuring and Deploying a Project So That You
Can Browse the Cube 133
Configuring a Project 133
Deploying a Project 135
Browsing a Cube 136
Part 3 Using MDX To Analyze Data
10 MDX Concepts 139
The SELECT Statement 140
The SELECT Clause 140
Defining Coordinates in Multidimensional Space 141
Default Members and the WHERE Clause 144
Query Execution Context 147

Set Algebra and Basic Set Operations 149
Union 149
Intersect 150
Except 150
CrossJoin 151
Extract 152
MDX Functions 152
Functions for Navigating Hierarchies 153
The Function for Filtering Sets 155
Functions for Ordering Data 157
Referencing Objects in MDX and Using Unique Names 158
By Name 158

By Qualified Name 159
By Unique Name 159
11 Advanced MDX 161
Using Member and Cell Properties in MDX Queries 161
Member Properties 161
Cell Properties 162
Dealing with Nulls 165
Null Members, Null Tuples, and Empty Sets 165
Nulls and Empty Cells 170
Contents
vii
Type Conversions Between MDX Objects 173

Strong Relationships 174
Sets in a WHERE Clause 177
SubSelect and Subcubes 180
Applying Visual Totals 185
12 Cube-Based MDX Calculations 189
MDX Scripts 191
Calculated Members 192
Defining Calculated Members 193
Assignments 198
Assignment Operator 199
Specifying a Calculation Property 202
Scope Statements 203

Root and Leaves Functions 206
Calculated Cells 208
Named Sets 209
Static Name Sets 210
Dynamic Named Sets 213
Order of Execution for Cube Calculations 215
The Highest Pass Wins 216
Recursion Resolution 218
13 Dimension-Based MDX Calculations 221
Unary Operators 221
Custom Member Formulas 225
Semi-Additive Measures 227

ByAccount Aggregation Function 229
Order of Execution for Dimension Calculations 232
The Closest Wins 233
14 Extending MDX with Stored Procedures 237
Creating Stored Procedures 239
Creating Common Language Runtime Assemblies 239
Using Application Domains to Sandbox Common
Language Runtime Assemblies 244
Creating COM Assemblies 245
Calling Stored Procedures from MDX 246
Security Model 248
Role-Based Security 248

Code Access Security 248
User-Based Security 249
Contents
viii
Server Object Model 251
Operations on Metadata Objects 252
Operations on MDX Objects 255
Calling Back into Stored Procedures 257
Using Default Libraries 260
15 Key Performance Indicators, Actions, and the DRILLTHROUGH Statement 261
Key Performance Indicators 261
Defining KPIs 262

Discovering and Querying KPIs 270
Actions 272
Defining Actions 273
Discovering Actions 279
Drillthrough 283
DRILLTHROUGH Statement 285
Defining DRILLTHROUGH Columns in a Cube 287
16 Writing Data into Analysis Services 291
Using the UPDATE CUBE Statement to Write Data into Cube Cells 292
Updatable and Non-Updatable Cells 298
Lifetime of the Update 299
Enabling Writeback 301

Converting a Writeback Partition to a Regular Partition 303
Other Ways to Perform Writeback 304
Part 4 Creating a Data Warehouse
17 Loading Data from a Relational Database 307
Loading Data 307
Data Source Objects 310
Data Source Object Properties 310
Data Source Security 312
Connection Timeouts 314
Connection Pooling 314
18 DSVs and Object Bindings 317
DSV Objects 317

Named Queries and Named Calculations 319
Object Bindings 321
Column Bindings 321
Row Bindings 323
Tabular Bindings 324
Query Bindings 326
Contents
ix
19 Multidimensional Models and Relational Database Schemas 329
Relational Schemas for Data Warehouses 329
Optimizing Relational Schemas 331
Building Relational Schemas from the Multidimensional Model 334

Using Wizards to Create Relational Schemas 334
Using Templates to Create Relational Schemas 339
Part 5 Bringing Data into Analysis Services
20 The Physical Data Model 345
Internal Components for Storing Data 346
Data Store Structure 346
File Store Structure 346
Bit Store Structure 348
String Store Structure 348
Compressed Store Structure 349
Hash Index of a Store 350
Data Structure of a Dimension 351

Data Structures of the Attributes 351
Attribute Relationships 355
Data Structures of Hierarchies 360
Physical Model of the Cube 364
Defining a Partition Using DDL 364
Physical Model of the Partition 367
Overview of Cube Data Structures 375
21 Dimension and Partition Processing 377
Dimension Processing 377
Attribute Processing 377
Hierarchy Processing 383
Building Decoding Tables 384

Building Indexes 384
Schema of Dimension Processing 385
Dimension Processing Options 386
Processing ROLAP Dimensions 388
Processing Parent-Child Dimensions 389
Cube Processing 390
Data Processing 391
Building Aggregations and Indexes 393
Cube Processing Options 395
Progress Reporting and Error Configuration 400
ErrorConfiguration Properties 402
Processing Error Handling 405

Contents
x
22 Using SQL Server Integration Services to Load Data 407
Using SSIS 408
Using Direct-Load ETL 409
Creating an SSIS Dimension-Loading Package 410
Creating an SSIS Partition-Loading Package 414
23 Aggregation Design and Usage-Based Optimization 417
Aggregations and Collection of Aggregations 417
Designing Aggregations 419
Relational Reporting-Style Dimensions 420
Flexible Versus Rigid Aggregations 422

Aggregation Objects and Aggregation Design Objects 423
The Aggregation Design Algorithm 426
Query Usage Statistics 427
Setting Up a Query Log 428
Manual Design and Management of Aggregations 431
Monitoring Aggregation Usage 433
24 Proactive Caching and Real-Time Updates 435
Data Latency and Proactive Caching 436
Timings and Proactive Caching 438
Update Frequency 438
Long-Running MOLAP Cache Processing 439
Proactive Caching Scenarios 440

MOLAP Scenario 440
Scheduled MOLAP Scenario 440
Automatic MOLAP Scenario 441
Medium-Latency MOLAP Scenario 442
Low-Latency MOLAP Scenario 442
Real-Time HOLAP Scenario 442
Real-Time ROLAP Scenario 443
Change Notifications and Object Processing During Proactive Caching 443
Scheduling Processing and Updates 443
Change Notification Types 445
Incremental Updates Versus Full Updates 447
General Considerations for Proactive Caching 448

Monitoring Proactive Caching Activity 448
25 Building Scalable Analysis Services Applications 451
Approaches to Scalability 451
The Scale-Up Approach 451
The Scale-Out Approach 452
Contents
xi
OLAP Farm 453
Data Storage 453
Network Load Balancing 455
Linked Dimensions and Measure Groups 455
Updates to the Source of a Linked Object 457

Linked Dimensions 457
Linked Measure Groups 461
Remote Partitions 464
Processing Remote Partitions 466
Using Business Intelligence Development Studio to
Create Linked Dimensions 467
Using BI Dev Studio to a Create Virtual Cube 468
Shared Scalable Databases 470
Attach\Detach, Read-Only, and DbStorageLocation 470
Detach 470
Attach 472
Read-Only 473

DbStorageLocation 473
Part 6 Analysis Server Architecture
26 Server Architecture and Command Execution 477
Command Execution 477
Session Management 481
Server State Management 482
Executing Commands That Change Analysis Services Objects 483
Creating Objects 484
Editing Objects 484
Deleting Objects 486
Processing Objects 486
Commands That Control Transactions 489

Managing Concurrency 491
Using a Commit Lock for Transaction Synchronization 492
Canceling a Command Execution 494
Batch Command 496
27 Memory Management 503
Economic Memory Management Model 504
Server Performance and Memory Manager 504
Memory Holders 504
Memory Cleanup 507
Managing Memory of Different Subsystems 509
Cache System Memory Model 509
Contents

xii
Managing Memory of File Stores 510
Managing Memory Used by User Sessions 510
Other Memory Holders 510
Memory Allocators 511
Effective Memory Distribution with Memory Governor 512
Memory Models of Attribute and Partition Processing 515
Memory Model of Building Aggregations 517
Memory Model of Building Indexes 518
28 Thread Management 521
Thread Pools 522
Architecture of a Thread Pool 523

Managing Threads by Different Subsystems 525
29 Architecture of Query Execution—Calculating MDX Expressions 527
Query Execution Stages 528
Parsing an MDX Request 530
Creation of Calculation Scopes 531
Global Scope and Global Scope Cache 535
Session Scope and Session Scope Cache 536
Global and Session Scope Lifetime 536
Building a Virtual Set Operation Tree 538
Optimizing Multidimensional Space by Removing Empty Tuples 541
Calculating Cell Values 542
Logical Plan Construction 542

Physical Plan Construction 546
Execution of the Physical Plan 547
Cache Subsystem 548
Dimension and Measure Group Caches 548
Formula Caches 550
30 Architecture of Query Execution—Retrieving Data from Storage 553
Query Execution Stages 554
Querying Different Types of Measure Groups 556
Querying Regular Measure Groups 556
Querying ROLAP Partitions 559
Querying Measure Groups with DISTINCT_COUNT Measures 560
Querying Remote Partitions and Linked Measure Groups 563

Querying Measure Groups with Indirect Dimensions 564
Part 7 Accessing Data in Analysis Services
31 Client/Server Architecture and Data Access 569
Using TCP/IP for Data Access 569
Using Binary XML and Compression for Data Access 570
Contents
xiii
Using HTTP for Data Access 571
Offline Access to Data 573
Client Components Shipped with Analysis Services 574
Using XML for Analysis to Build Your Application 574
Using Analysis Services Libraries to Build Your Application 575

Query Management for Applications Written in Native Code 576
Query Management for Applications Written in Managed Code 576
Using DSO and AMO for Administrative Applications 577
32 XML for Analysis 579
State Management 580
XML/A Methods 583
The Discover Method 583
The Execute Method 587
Handling Errors and Warnings 593
Errors That Result in the Failure of the Whole Method 594
Errors That Occur After Serialization of the Response Has Started 596
Errors That Occur During Cell Calculation 597

Warnings 598
33 ADOMD.NET 599
Creating an ADOMD.NET Project 599
Writing Analytical Applications 602
ADOMD.NET Connections 603
Working with Metadata Objects 610
Operations on Collections 612
Caching Metadata on the Client 615
Working with a Collection of Members (MemberCollection) 618
Working with Metadata That Is Not Presented in the
Form of Objects 625
AdomdCommand 630

Properties 630
Methods 632
Using the CellSet Object to Work with Multidimensional Data 636
Handling Object Symmetry 644
Working with Data in Tabular Format 647
AdomdDataReader 649
Using Visual Studio User Interface Elements to Work with
OLAP Data 652
Which Should You Use: AdomdDataReader or CellSet? 654
Using Parameters in MDX Requests 655
Asynchronous Execution and Cancellation of Commands 657
Contents

xiv
Error Handling 662
AdomdErrorResponseException 663
AdomdUnknownResponseException 666
AdomdConnectionException 666
AdomdCacheExpiredException 666
34 Analysis Management Objects 669
AMO Object Model 669
Types of AMO Objects 670
Dependent and Referenced Objects 678
Creating a Visual Studio Project That Uses AMO 685
Connecting to the Server 685

Canceling Long-Running Operations 688
AMO Object Loading 692
Working with AMO in Disconnected Mode 693
Using the Scripter Object 694
Using Traces 697
Error Handling 706
OperationException 706
ResponseFormatException 707
ConnectionException 708
OutOfSyncException 708
Part 8 Security
35 Security Model for Analysis Services 713

Connection Security 714
TCP/IP Connection Security 714
HTTP Security 715
External Data Access Security 718
Choosing a Service Logon Account 718
Configuring Access to External Data Sources 719
Changing a Service Logon Account 720
Security for Running Named Instances (SQL Server Browser) 721
Security for Running on a Failover Cluster 721
Object Security Model for Analysis Services 721
Server Administrator Security 722
Database Roles and Permission Objects 723

Defining Object Permissions 726
Managing Database Roles 730
36 Securing Dimension Data 731
Defining Dimension Security 734
The AllowedSet and DeniedSet Properties 735
Contents
xv
The VisualTotals Property 740
Defining Dimension Security Using the User Interface 742
Testing Dimension Security 744
Dynamic Dimension Security 746
Dimension Security Architecture 748

Dimension Security, Cell Security, and MDX Scripts 748
37 Securing Cell Values 751
Defining Cell Security 751
Testing Cell Security 754
Contingent Cell Security 756
Dynamic Cell Security 758
Part 9 Management
38 Using Trace to Monitor and Audit Analysis Services 763
Trace Architecture 764
Types of Trace Objects 765
Administrative Trace 765
Session Trace 765

Flight Recorder Trace 765
Creating Trace Command Options 766
SQL Server Profiler 768
Defining a Trace 768
Running a Trace 770
Flight Recorder 773
How the Flight Recorder Works 774
Configuring Flight Recorder Behavior 775
Discovering Server State 776
Tracing Processing Activity 776
Reporting the Progress of Dimension Processing 776
Reporting the Progress of Partition Processing 779

Query Execution Time Events 780
Running a Simple Query 780
Changing the Simple Query 781
Running a More Complex Query 782
Changing the Complex Query 783
Changing Your Query Just a Little More 784
Contents
xvi
39 Backup and Restore Operations 787
Backing Up Data 787
Planning Your Backup Operation 788
Using the Backup Database Dialog Box to Back Up Your Database 790

Using a DDL Command to Back Up Your Database 792
Backing Up Related Files 793
Backing Up the Configuration File 793
Backing Up the Query Log Database 793
Backing Up Writeback Tables 794
Backup Strategies 795
Typical Backup Scenario 795
High-Availability System Backup Scenario 795
Automating Backup Operations 796
SQL Server Agent 796
SQL Server Integration Services 797
AMO Application 798

Restoring Lost or Damaged Data 798
Using the Restore Database Dialog Box 799
Using the DDL Command to Restore Your Database 800
Using DISCOVER_LOCATIONS to Specify Alternative
Locations for Partitions 801
MDX Extensions for Browsing Your File System 803
The MDX Extensions 804
40 Deployment Strategies 805
Using the Deployment Wizard 805
Synchronizing Your Databases 807
Using the Synchronize Database Wizard 809
Using a DDL Command to Synchronize Databases 809

Similarities Between the Synchronization and Restore Commands 811
Synchronization and Remote Partitions 812
Synchronization and Failover Clusters 814
41 Resource Monitoring 815
DMVs and SchemaRowsets 816
Querying DMVs and SQL Semantics 817
Monitoring Connections, Sessions, and Commands 818
Monitoring Server State 820
Using Perfmon Counters 821
Index 823
Contents
xvii

Foreword
I am pleased to see this book being updated for a second edition, to cover the changes in
Analysis Services 2008, and also to clarify some of the more difficult material in the first
edition. This should make the book even more useful to its target users.
Now that Analysis Services is in its fourth major release, it has become a big, complex
product, far removed from the relatively simple first release of a mere decade earlier. To
make the most of it, model designers need much more knowledge than is available in the
online documentation, which makes books like this all the more necessary. And, of course,
now that the product is so widely used, sometimes for quite challenging applications, there
is much more experience of the best practices to follow. Some of these are now baked into
the product itself, but books like this can provide much more context for their use.
The authors are to be highly commended for putting in the effort to comprehensively

update a substantial work like this; I know from my own experience how much extra
motivation you need to update an existing publication after just two years, compared to
the excitement of creating the first edition. All too often, publications like this remain
frozen when new versions of the software they describe are released, leaving users to guess
which parts remain true, and which have been superseded. In this case, this second
edition actually follows more closely on the heels of Analysis Services 2008 than did the
first edition on Analysis Services 2005.
Microsoft is also to be commended for continuing to permit or even encourage the disclo-
sure of this level of detail about one of its major products; with the consolidation of the
BI industry, some of the other major vendors have become much less willing to provide
detailed information about the inner workings of their products. In any case, I have never
known any other OLAP server vendor to be so open.

Users of Analysis Services are fortunate in the range of books available to them: more
than for all the other OLAP servers combined. This is clearly the book for the most tech-
nical users who really need and want to understand exactly how Analysis Services works.
There are many other books for those just getting started with Analysis Services, or who
want a clear ‘how do I?’ guide. The many application developers who just want to
improve their Analysis Services skills will probably find this book overwhelming; there are
at least a dozen simpler books to choose from. And, needless to say, this book is definitely
not aimed at business users who want to understand what Analysis Services can do for
them.
Nigel Pendse
Editor of The OLAP Report
Author of The OLAP Survey

Contents
xviii
About the Authors
Irina Gorbach is a senior development lead at Microsoft. She joined the Analysis Services
team soon after its creation over 11 years ago. During her work at Microsoft, Irina has
designed and developed many features of the Analysis Services product, and was responsible
for client subsystem: OLEDB and ADOMD.Net. Irina was in the original group of architects
that designed XML for Analysis specification; she worked on the architecture and design of
calculation algorithms and currently is working on scalability of Analysis Services.
Alexander Berger was one of the first developers to work on OLAP systems at Panorama,
prior to their purchase by Microsoft. After the acquisition, Alexander led the development
of Microsoft OLAP Server through all of its major releases prior to SSAS 2008. Currently,

Alexander leads the Business Intelligence department for Microsoft adCenter. He is one of
the architects of OLEDB for the OLAP standard and MDX language, and holds more than
30 patents in the area of multidimensional databases.
Edward Melomed is one of the original members of the Microsoft SQL Server Analysis
Services team. He arrived in Redmond as part of Microsoft’s acquisition of Panorama
Software Systems, Inc., which led to the technology that gave rise to Analysis Services
2008. He works as a program manager at Microsoft and plays a major role in the infra-
structure design for the Analysis Services engine.
Acknowledgments
We are incredibly grateful to many people who have gone out of their way to help with
this book.
To Py Bateman, our co-author, for making this book possible.

To Mosha Pasumansky, MDX guru, for answering all our questions and providing us with
your expertise. Your mosha.com served as a terrific tool in our research.
To Marius Dimitru, formula engine expert, for helping us explain the details of the
formula engine architecture and exposing power of the latest improvements.
To Akshai Mirchandani, engine expert, for support and help with writeback, proactive
caching, and drillthrough.
To Michael Vovchik, storage engine expert, for support and help with DMVs.
To Oleg Lvovitch, expert in Visual Studio integration—thanks for help with the inner
workings of Analysis Services tools.
To Adrian Dumitrascu, AMO expert, for answering numerous questions.
Thanks to Bala Atur, Michael Entin, Jeffrey Wang, Ksenia Kosobutsky, and Vladimir
Chtepa, for your extensive reviews and feedback.

To Brook Farling, our talented and professional editor—thanks for your help to publish
this book and publish it on time.
We would like to give special thanks to the publishing team at Sams: Neil Rowe, Mark
Renfrow, Brook Farling, and Jennifer Gallant for all your support and patience for this project.
To Denis Kennedy, technical writing guru, for improving our writing skills and fixing all
the errors we made.
Dedication
Edward Melomed
To my beautiful wife, Julia, who supported me through late nights and odd working
hours. To our little sunshine, Anna. To my parents, Raisa and Lev, and to my sister Mila,
whose guidance helped shape my life.
Irina Gorbach

To my husband Eduard, who is my best friend and biggest supporter.
To my wonderful children Daniel and Ellen, who constantly give me joy and make every-
thing worthwhile. To my parents Eleonora and Vladimir, for their support and love:
without you, this book wouldn’t be possible. To my grandparents Bronya and Semen, for
their unconditional love.
Alexander Berger
To my family and friends in Russia, Israel, and America.
We Want to Hear from You!
As the reader of this book, you are our most important critic and commentator. We value
your opinion and want to know what we’re doing right, what we could do better, what
areas you’d like to see us publish in, and any other words of wisdom you’re willing to
pass our way.

You can email or write me directly to let me know what you did or didn’t like about this
book—as well as what we can do to make our books stronger.
Please note that I cannot help you with technical problems related to the topic of this book, and
that due to the high volume of mail I receive, I might not be able to reply to every message.
When you write, please be sure to include this book’s title and author as well as your
name and phone or email address. I will carefully review your comments and share them
with the author and editors who worked on the book.
Email:
Mail: Neil Rowe
Executive Editor
Sams Publishing
800 East 96th Street

Indianapolis, IN 46240 USA
Reader Services
Visit our website and register this book at www.informit.com/title/9780672330018 for
convenient access to any updates, downloads, or errata that might be available for this book.
Introduction
Analysis Services began as the project of a small Israeli firm named Panorama, which had
responded to a request from a British publishing company to develop an application that
would analyze the data stored in its relational database. By the end of 1994, Panorama
developers began work on a more general application that would make it possible for
business managers to analyze data with relative ease.
With its first release in 1995, Panorama deployed the application to several dozen
customers. As the next release moved the application more deeply into the Israeli market,

the Panorama team began to develop a new client/server analytical application. The
server would process the data and store it in a proprietary format, and the client would
also offer users an easy-to-use, rich graphical interface.
By 1996, the application had come to the attention of Microsoft, which acquired the
technology by the end of that same year. In early 1997, a small Panorama team comprised
of Alexander Berger, Amir and Ariel Netz, Edward Melomed, and Mosha Pasumansky
moved from Tel Aviv to Redmond to start work on the first version of Microsoft OLAP
Server. After the move to the United States, the team added new developers Irina Gorbach
and Py Bateman.
To make the application attractive to enterprise customers, the team took on the chal-
lenge of formalizing and standardizing data exchange protocols, and they eliminated the
client side of the application in favor of supporting a variety of third-party client applica-

tions. In early 1997, a small group including Alexander Berger retreated to a Puget Sound
island to brainstorm the foundation of what would become SQL Server Analysis Services.
That retreat produced a plan for developing a standard protocol for client applications to
access OLAP data: OLEDB for OLAP. More important, and more challenging, was the plan
for developing a new query language that could access multidimensional data stored in
the OLAP server—MDX (Multidimensional Expressions). MDX is a text language similar
to SQL. MDX makes it possible to work with a multidimensional dataset returned from a
multidimensional cube. From its inception, MDX has continued to change and improve,
and now it is the de facto standard for the industry.
The original release plan was to include the OLAP server in the 1997 release of SQL Server
6.5. However, instead of rushing to market, Microsoft decided to give the development
team more time to implement MDX and a new OLEDB for OLAP provider. Microsoft’s

first version of a multidimensional database was released in 1998 as part of SQL Server
7.0. That version was integrated with Microsoft Excel PivotTables, the first client for the
new server.
Under the slogan, “multidimensionality for the masses,” this new multidimensional data-
base from Microsoft opened the market for multidimensional applications to companies
of all sizes. The new language and interface were greeted favorably. The simplicity (and,
one could say, elegance) of the design made it possible for users to rapidly become profi-
cient with the new product, including users who weren’t database experts. Technology
that used to be available only to large corporations was now accessible to medium-sized
and small businesses. As a result, the market for new applications that use multidimen-
sional analysis has expanded and flourished in an environment rich with developers who
write those applications.

But, of course, we were not satisfied to rest on our laurels. We took on a new goal—turn
Analysis Services into a new platform for data warehousing. To achieve this, we intro-
duced new types of dimensions, increased the volume of data the server can process, and
extended the calculation model to be more robust and flexible. Even though no addi-
tional personnel joined the team for this effort, by the end of 1999 we brought the new
and improved Analysis Services 2000 to market.
For the next five years, more and more companies adopted Analysis Services until it
became a leader in the multidimensional database market, garnering a 27% market share.
Now, multidimensional databases running on OLAP servers are integral to the IT infra-
structures of companies of all sizes. In response to this wide adoption of multidimen-
sional database technology, Microsoft has increased the size of the team devoted to OLAP
technology in order to continue to develop the platform to meet the requirements of

enterprise customers.
For the 2005 release of SQL Server Analysis Services, we started from ground up, rewriting
the original (and now aging) code base. We built enterprise infrastructure into the core of
the server.
SQL Server 2008 release continues to improve architecture and functionality of Analysis
Services. While improving the performance of query execution, it also introduces query
language extensions and new management capabilities.
Who Is This Book’s Intended Audience?
In this book, we bring you the tools you need to fully exploit Analysis Services and
explain the architecture of the system. You’ll find all of the coverage of our previous book
(just in case you were wondering if you needed to go back and read that one first), includ-
ing the basic architecture established in Analysis Services 2005, as well as all the improve-

ments introduced in Analysis Services 2008. Analysis Services Unleashed gives you a full
understanding of multidimensional analysis and the MDX query language. It also exposes
all the aspects of designing multidimensional applications and management of the
system.
Microsoft SQL Server 2008 Analysis Service Unleashed
2
How This Book Is Organized
The book is divided into the following nine parts:
Parts I and II are devoted to a formalized description of the multidimensional model
implemented in the new version of the OLAP server. We give you the vocabulary and
concepts you’ll need to work with this model.
In Part III, we present a detailed discussion of MDX and explanation of the way we use it

to query multidimensional data. You’ll need a practical grasp of the data model and MDX
to take advantage of all the functionality of Analysis Services.
We devote the middle section of the book in Parts IV–VII to the practical aspects of
loading and storing data in Analysis Services, as well as methods of optimizing data
preparation and data access. In addition, we examine server architecture.
In the last section of the book, Parts VIII–IX, we discuss data access, the architecture of
client components, and data protection. In addition, we examine the practical aspects of
administering the server and monitoring its activities.
We wish you great success in your work with Analysis Services 2008, and we hope that
our humbly offered book is of service to you.
Conventions Used in This Book
Commands, scripts, and anything related to code are presented in a special monospace

computer typeface. Bold indicates key terms being defined, and italic is used to indicate
variables or for emphasis. Great care has been taken to be consistent in letter case,
naming, and structure, with the goal of making command and script examples more read-
able. In addition, you might find instances in which commands or scripts haven’t been
fully optimized. This lack of optimization is for your benefit, as it makes those code
samples more intelligible and follows the practice of writing code for others to read.
Other standards used throughout this book are as follows:
CAUTION
Cautions alert you to actions that should be avoided.
NOTE
Notes give you additional background information about a topic being discussed.
Introduction

3
This page intentionally left blank

×