In this chapter, we will cover:
Installing SQL Server 2012 Express LocalDB
Installing SQL Server Native Client 11.0
Installing SQL Server 2012 Command Line Utilities
Setting up the AdventureWorks DW sample database
Installing the .NET Framework 4.0 and the 4.0.2 update
Checking whether IIS is enabled and working
Installing MicroStrategy Suite
Registering the MicroStrategy License
Metadata and data warehouse
Creating ODBC DSN for metadata and data warehouse
Modifying the logon account for the Intelligence Server
Creating the metadata, and configuring the Intelligence Server
Opening the MicroStrategy Desktop application
This book is intended for Business Intelligence (BI) developers who want to expand their knowledge in a technology that is in huge demand at the moment, and for advanced data analysts who are evaluating different technologies. In this first chapter, we will start by downloading and installing the software and a well-known sample SQL Server database. You do not need to be a SQL rock star to read this book, yet some concepts, such as foreign keys or many-to-many relationships, are taken for granted.
Having previous basic knowledge about dimensional modeling (fact tables and dimensions) will also help the comprehension.
The chapters are ordered by increasing difficulties, and each one builds on the top of the preceding, so the learning is progressive; you'll get the most out of it, if you follow the recipes one after the other.
You may already have a working MicroStrategy environment; if so, you can just install the example database and skip the rest of this chapter. However, I suggest using a dedicated installation to follow the recipes; it would be easier and cleaner.
These initial recipes may seem too easy for the more experienced BI specialists, I apologize for that; I only want to be sure that starting from Chapter 2, The First Steps in a MicroStrategy Project, everyone has a common setup.
Note
The operating system installation is outside the scope of this book; nevertheless, it is of vital importance that the machine where you will be doing the exercises is correctly configured and loaded with everything we will need. Throughout the course of this book, I will use Windows 2008 Web Server SP2; I have a VMware virtual machine with 2 GB RAM and two cores. The operating system is 32 bits. You may follow the whole book with a 64-bit software, but the examples and the instructions are written and tested on a 32-bit system. While this is a very small setup for a BI machine, it is enough to start.
We will use Microsoft SQL Server for our practice; there are several versions out there both free and commercial. I selected the LocalDB because it's the one with less memory footprint and yet, has a complete set of features.
You will need to download some software prior to installation:
Microsoft .NET Framework 4.0 available at http://at5.us/Ch1U3
Update 4.0.2 for Microsoft .NET Framework 4.0 (as in Microsoft article KB2544514) available at http://at5.us/Ch1U4
SQL Server 2012 Express LocalDB available at http://at5.us/Ch1U5
SQL Server Native Client 11.0 available at http://at5.us/Ch1U6
SQL Server 2012 Command Line Utilities available at http://at5.us/Ch1U7
AdventureWorks DW Database creation scripts available at http://at5.us/Ch1U8
Download all these files and put them in a folder, for example, C:\install\
.
The setup is very straightforward, in a command prompt window do the following:
Install the SQL Server 2012 Express LocalDB engine by running:
C:\install\SqlLocaLDB.MSI
Accept the agreement and click your way out through the Next button; no special attention other than clicking on Continue to allow the user account control permission to install. The setup will take one minute, if not seconds, and it's very simple.
We are using a stripped down version of Microsoft SQL Server 2012 database. This LocalDB engine features almost everything from the full-fledged product but runs as a user application, not as a service like its major siblings do. It is important to remember this detail because only the currently logged on user will be able to connect to the database instance.
LocalDB has very low memory requirements and guarantees quick data access on small machines.
Check the successful outcome by issuing in a command prompt:
sqllocaldb info
The system will answer with the version number:
v11.0
which is also the name of the default instance.
After installing the SQL engine, we need to load the last version of the client in order to access the local instance.
Here's how to run the installation, in a command prompt window:
Install SQL Server Native Client 11.0 by running:
C:\install\sqlncli.msi
Leave the default components selected for installation and click on Next until the end. As before, give the user account control permission to continue.
We are forced to install this version of the client, as previous native clients are not able to connect to the LocalDB engine.
Check successful outcome by clicking on Start | Administrative Tools | Data Sources (ODBC). Click on Continue if prompted, and in the ODBC Data Source Administrator window, select the Drivers tab. You should find among the last rows in this list both SQL Server and SQL Server Native Client 11.0.
The command-line utilities are needed to run SQL sentences and scripts onto the database instance. You may feel more comfortable with the full SQL Server Management Studio Express, which is also free to download and use. For simplicity, and not to overload the machine, I will be using only the command line during the recipes.
As in the previous recipes, execute the following steps in a command prompt window:
Install SQL Server 2012 Command Line Utilities by running:
C:\install\SqlCmdLnUtils.msi
Accept the agreement, allow permission if prompted, and click on Next until the end.
Check successful outcome with the following command:
sqlcmd -S (localdb)\v11.0
This should connect to the default instance of SQL Server. It may take a while as the SQL Server instance is loaded on demand, so when you issue this command for the first time, Windows actually has to run the sqlservr.exe
executable. From the second time, the instance will be loaded faster.
Now that the instance is up and running, we can load the data into it. First, we'll create a database that will be populated with sample data.
You need to have completed the previous recipe to continue, and then unzip the AdventureWorks 2008R2 Data Warehouse.zip
file into the folder C:\install\
, so that you will end up with a folder named AdventureWorks 2008R2 Data Warehouse
containing a series of SQL script files; the main being named instawdwdb.sql
.
Before running this script we need to modify it, in order to specify the name of the source folder containing the CSV files and the name of the destination folder that will store the resulting database:
Create a directory named
C:\datawarehouse
; this will be the location of our database.Open in Notepad the file
instawdwdb.sql
and modify lines 36 and 37 so that they look like::setvar SqlSamplesDatabasePath "C:\datawarehouse\" :setvar SqlSamplesSourceDataPath "C:\install\AdventureWorks 2008R2 Data Warehouse\"
Save the file and close Notepad.
Open a command prompt and enter the following command:
sqlcmd -S (localdb)\v11.0 –i "C:\install\AdventureWorks 2008R2 Data Warehouse\instawdwdb.sql"
The script will create the database and all the needed tables. Then will import the CSV data files into the tables to populate them with data. The script will lastly exit the sqlcmd
command interface.
In order to check if everything was installed correctly, we will perform a couple of very simple SQL queries on the database:
Open the
sqlcmd
utility again:sqlcmd -S (localdb)\v11.0
At the
1>
prompt, write the following instructions each on its own line, followed by the Enter key:use AdventureWorksDW2008R2 go select count(1) from FactInternetSales go select count(1) from DimCustomer go exit
The database will respond with the number of rows in the main fact table and the customer dimension table, 60398
and 18484
respectively.
Congratulations, you correctly installed the data warehouse source database!
One main software requirement for the setup of MicroStrategy suite is the .NET Framework 4.0, and the update 4.0.2 as in the Microsoft article KB2544514.
In a command prompt window, complete the following steps:
Run the command:
C:\install\dotNetFx40_Full_x86_x64.exe
Accept the license agreement and watch the blue progress bars filling up slowly. This can take a while; you may have a coffee if you need. When it's finished, run:
C:\install\NDP40-KB2544514-x86-x64.exe
One accept button (the license agreement) and two more blue progress bars to go. If you're prompted to reboot, please do so.
Since we're using Windows 2008 Web Server, we speak about roles; so we need to be sure that the web role is enabled with all the required features for the platform setup to run smoothly.
Use the following steps to check if the required features are enabled:
Open the Server Manager (Start | Administrative Tools | Server Manager) and scroll to the Roles Summary pane.
Click on the Add roles link, you will see the Add Roles Wizard window; click on Next.
Select Web Server (IIS) and click on Add Required Features in the pop-up message box; now click on Next and then on Next again.
In the Select Role Services page, carefully check the following if not selected already:
In the Application Development group:
ASP.NET (add required role services if prompted)
ASP
In the Security group:
Basic Authentication
Windows Authentication
Click on Next, then on Install, and when finished click on Close.
These role features enable MicroStrategy Web ASP.NET pages and the ability to use Windows authentication when connecting to the Intelligence Server through the Web.
Check the successful outcome by opening Internet Explorer and typing http://localhost/
in the address bar. You should see the IIS7 welcome logo.
Now that the prerequisites are in place, we can go on with the platform setup.
You need to have completed all the previous recipes to continue.
When you download the MicroStrategy Suite, it can be installed in two different versions: the full-featured 30 days evaluation or the free reporting suite.
The difference between the two is that with the former you have the complete suite with administration tools, unlimited users, the option to use more than one processor, and more; while the second is a free version with limited users, no administrator tools, and one CPU limit.
We will be using the latter, throughout this book, and only cover the features available in the free one.
Prior to downloading and installing the software we need to register on the MicroStrategy website. Please provide a real company e-mail address as the registration process won't allow you to use @hotmail
or @gmail
addresses or any other well-known free e-mail service. Once you're registered, you will receive a message in your inbox with a license number.
MicroStrategy installation archive can be found at:
Free Reporting Suite at http://at5.us/Ch1U1
Evaluation version at http://at5.us/Ch1U2
You only need to download one of the two and unzip the archive into a folder, for example, C:\install\
.
You need to have administrator rights to install the suite:
You should have extracted the contents of the MSTR_93_GA_WindowsFullzip archive into
C:\install\
, so run the executable:C:\install\MICROSTRATEGY.exe
In the welcome window, click on Install Software and then on Begin MicroStrategy Platform Installation. If a User Account Control dialog pops up, click on Allow.
The MicroStrategy-InstallShield Wizard appears asking you to choose a language for the setup, accept the default English and click on OK.
You will find yourself in front of yet another welcome page; politely click on Next and agree to the following warning message saying that the print spooler and remote registry service will be shut down during the setup (they will restart when you reboot the machine).
Now accept the license agreement and click on Next.
In the Customer Information window, fill your username, company, and paste the license number you received via e-mail.
Click on Next, which will bring you to the Choose Destination Location page, accept the defaults and click on Next again.
Here you have the features selection list; depending if you used the free license or the evaluation key you will be presented with more or less choices. Simply accept the defaults and click on Next (if you receive a warning about a missing PDF reader disregard it, for now we do not need this feature).
Click on Yes, the web server will be stopped and restarted.
Then click on Yes again, the setup will enable the web service extensions in IIS for us.
On the MicroStrategy Health Center Setting page, accept the defaults and click on Next.
On the Server Activation page, click on Next; fill in the Name, Location, and Use fields. Then click on Next.
On the following page you must select the first option: I am an employee of the licensed company., otherwise you won't be allowed to continue. All the fields in the Installer Information group are mandatory except State, so be patient and fill in them all.
Lastly, you may choose to request an activation code, which will be sent to your e-mail. Please do so unless you're behind a corporate firewall which in some cases may prevent the operation to complete.
The full install may last anywhere between 5 and 40 minutes depending on the hard drive speed—time for a break.
At the end of the progress bar, read the
Readme
file if you want, and click on Yes, reboot the machine when prompted.
Check the successful outcome—after the server reboots, the Configuration Wizard window will appear. We will use it in a while but not just yet; you can click on Exit now or simply leave it in the background while going on to the next recipe.
Also, look at the Windows taskbar. You may see a warning balloon message popping and saying that the operating system has blocked some startup programs; click on the Blocked Startup Programs icon and let it run the executable MASvcMgr
, now you will see the server manager icon with a green check mark meaning the Intelligence Server is running. Good job!
If you chose not to request an activation code, you may use the software for seven days before it stops working.
The license needs to be activated for the software to continue working after the seven days grace period. There is a tool in the suite to help with the registration process, named License Manager
.
We will be now registering the MicroStrategy License:
Click on Start | All Programs | MicroStrategy | License Manager.
In the main window, select the tab named License Administration; the first option Activate Server Installation should be already selected. Click on Next.
In the following page, ensure that the radio button Generate Activation File and Request Activation Code is selected and click on Next and then on Next again, until you come to the page where you should enter all the details about your company and contacts.
The e-mail address is important to receive the activation code. Click on Next.
Select Yes, I want to request an Activation Code now and hit Next. You will shortly receive an e-mail message.
Click on Done to return to the beginning of the license administration process and start again with the Activate Server Installation radio button selected.
Click on Next, and this time select the option Server Activation using Activation Code.
In the textbox underneath, paste the code you received by e-mail and click on Next, and then click on OK, then on Done, and then on the Exit button.
Congratulations, you have registered the MicroStrategy License. Reboot the machine or restart the following services: MicroStrategy Intelligence Server
and World Wide Web Publishing Service
.
The free license allows you to use the software with up to 10 named users, with the only limitation that some utilities are missing. With this edition you can build a complete BI solution for a small to mid-size company on a very low budget.
The Evaluation version has no user limitation, and all the utilities, but will expire after 30 days.
These are two key concepts in every BI project with MicroStrategy so we'd better have them clear since the beginning.
Metadata is data about data (what?). Ok, let's say that in the metadata you won't find any customer names or sales figures or any other fact, you'll just find information about the columns where this data come from, the datatype, and several other details about how to create the customer entity, for example, how does it relate to other elements in the project and where it is stored, plus the definition of all the reports.
While the data warehouse is the real source of the facts and dimensions that you will analyze. So, in principle, metadata and data warehouse are different databases and/or different instances; they may even reside in different hardware (and usually are, for example, in cluster production environments).
It is easy to deduce that the metadata is relatively small compared to the data warehouse, which is usually a huge, daily refreshed, historical storage with lots of records.
So AdventureWorksDW2008R2
, which we just created, will be our "huge" 78 MB data warehouse; while we still do not have a storage for the metadata. Given that we are in a single-user training environment, we can use the same SQL Server instance for the metadata, but we'll create a new database to hold it.
In a command prompt window:
The create database metadata
instruction will generate the metadata.mdf
file. Both databases will be accessible from the same instance named v11.0
.
Now that we have two databases, we need to tell MicroStrategy how to find and how to connect to them. Being in a Windows world, all the connections are done through ODBC, 32-bit ODBC to be correct.
Tip
You should be aware of this if you happen to install MicroStrategy on 64-bit Windows—the connectivity tier runs on 32 bits, the ODBC drivers are 32-bit drivers, and you won't find them in the default 64-bit ODBC Administrator (hint: look in the SysWOW64
folder).
We will create the two DSN:
Click on Start | Administrative Tools | Data Sources (ODBC) and select the System DSN tab.
You will find some DSNs already created for you by the setup; we need to create two more (yes, you're right: one for the metadata and one for the data warehouse).
Click on the Add… button, scroll down the list to select SQL Server Native Client 11.0 and click on Finish.
In the Create a New Data Source to SQL Server window, type these values:
Name:
metadata
Server:
(localdb)\v11.0
Click on Next and then on Next again.
Click the checkbox labeled Change the default database to and in the drop-down list underneath, select metadata. Leave all the remaining default values and click on Next and on Finish.
Click on Test Data Source… and look at the message: if it says TESTS COMPLETED SUCCESSFULLY!, you're good to go. Click on OK and then on OK again.
Repeat all the steps to create another DSN to the data warehouse, this time with the following values:
Name:
datawarehouse
Server:
(localdb)\v11.0
Change the default database to: AdventureWorksDW2008R2
Every interaction with the relational DBMS is done through ODBC. MicroStrategy ships with a list of out-of-the-box drivers for the most common databases. Nevertheless, you may use other ODBC drivers if so you wish, provided that they work in 32 bits.
In our recipes, we will connect to a SQL Server instance, so we need to use the Microsoft provided Native ODBC. If, for example, you use Oracle in your BI environment, you will find the provided Oracle Wire driver being very convenient and light-weight. The company behind the shipped drivers is DataDirect.
As said before, the SQL Server LocalDB engine runs as a user application, hence it is only accessible from the currently logged on user. We will now modify the credentials of the MicroStrategy Intelligence Server so that it can connect to the database instance that is running in the user context.
I'm hearing the screams of the security-wise system administrators: of course, you wouldn't want to do this in a production environment as it can pose serious security risks, but here we are in a training environment.
Follow these steps to modify the startup account for the Intelligence Server:
In Start | Run dialog, type
services.msc
.This will open the Services console; scroll down to find MicroStrategy Intelligence Server, it is now executing with Local System credentials, double-click on the service.
Select the Log On tab and click on the This account radio button.
Then type your current username and password in the corresponding text fields below.
Now click on OK to close the dialog box.
A message will warn you that the user has been granted the right to log on as a service. Click on OK and then on OK again at the second warning telling you that you should restart the service. We'll do it in a moment.
Right-click on the MicroStrategy Intelligence Server service and select Restart from the context menu that appears.
Most of the services in Windows run with a special account called Local System. In our case, the Intelligence Server service must be able to connect to a SQL Server instance that is running under the currently connected user context. This is why we need to run the Intelligence Server as "ourselves", so that it can see the database instance.
The metadata consists of a series of tables that MicroStrategy uses to store information about projects and the objects that build up those projects. In one of the previous recipes, we created the empty metadata database and now we will start populating it.
To create the metadata, do the following:
You should already have the configuration wizard open in the background; if you closed it, you can find it in Start | All Programs | MicroStrategy. Click on Configuration Wizard to run it.
In the first page of the wizard, the first option should already be selected, so click on Next.
In this phase of the project, we're not interested in the history list or statistics, so we uncheck the corresponding checkboxes and leave just the first one checked. Then click on Next.
Now we are telling the wizard where to look for the metadata database, you should have a list of all the system DSNs present in the machine, select the metadata DSN that we created before, click on Next and on Finish.
The wizard starts creating and populating metadata tables. When the process is completed, click on Close to go back to the starting page of the wizard.
The second option Configure Intelligent Server should be automatically selected, click on Next and again select the metadata DSN from the drop-down list and click on Next.
When you're prompted for the username and password leave everything as default, the Administrator user still has no password, and click on Next.
Watch the wizard as it tries to connect to the recently created metadata and when the Server Definitions page appears just hit Next and Next again, as we will use all the default settings.
In the SSL Configuration page, leave the checkbox unchecked; click on Next and on Finish.
The Intelligence Server is stopping and restarting with the new configuration. Once the process terminates, click on Close and then on Exit.
The Intelligence Server definition is stored in the metadata. The wizard populates the tables with default values such as the server port and the administrator password. The Intelligence Server service then, reads the metadata when starting up, to retrieve all this information. There can be only one active metadata at a time. You may have different versions of it, but only one in use. To switch from one metadata to another, you need to run the configuration wizard again.
Needless to say, the backup of the metadata is very important. If you lose this database, you lose every project in it.
You could also create a metadata in an MS Access database, if you want. For small projects or demos, this helps moving it around just by copying the MDB file.
The platform is all set. We now have a brand new MicroStrategy Server up and running, but we don't have any projects yet.
This may be a good time to save your work and store a backup of the Windows machine, just in case. If you are running a virtual environment, a snapshot of the VM would be perfect.
The MicroStrategy Desktop application is the development tool to generate projects, objects, reports, and so on. It is also used to explore and manage the objects that reside in the metadata. From now on, we'll spend the major part of our time in this IDE.
It's not difficult to get used to the interface as it is fairly simple, much like the Windows Explorer you have folders on the left and details on the right.
Let's open the Desktop application:
Go to Start | All Programs | MicroStrategy | Desktop and click on the Desktop icon.
Double-click on the line named MicroStrategy Analytics Modules, which was created by the setup and you'll be prompted for the metadata credentials; remember? The user is Administrator with no password.
The first time you connect, a message will remind you that no project is there, click on OK. We'll create one in a moment.
When you enter the MicroStrategy Analytics Modules (we call this a project source) for the first time, you'll be watching a window like the one in the following screen capture:
Unfold the
Administration
folder and click on User Manger on the left pane. Then double-click on Everyone on the right pane. You will see there is only a user in this group.Double-click on the Administrator user icon to open the User Editor.
Here, you can manage all the details of a user such as full name, login, password, or permission to see projects and which features the user has access to. There are two text fields for password with asterisks, type a new password here and confirm. Then close the editor by clicking on OK.
Exit the Desktop application and open it again. This time you will be prompted for credentials to enter the MicroStrategy Analytics Modules, type
Administrator
and the password you just created.
At the top-most level of the folder tree in MicroStrategy Desktop application there are the project sources, think of them as a shortcut to the Metadata. A project source is just a way for MicroStrategy to know where the Intelligence Server is running and how to connect to it.
The Administration
folder is where all the administrative tasks are performed in the Desktop application, and you can see this because you've entered the application with an admin account.
There are two types of project source, two-tiers (Direct) and three-tiers (Intelligence Server). Two-tiered project sources connect directly to the metadata database, while three-tiered first connect to an Intelligence Server, which in turn connects to the metadata.
Now that the administrative account is secured, if you forget this password, all of your work will be lost. Ouch! Really? Yes, exactly, please remember: there is no way known to humans to recover a metadata lost password. Only MicroStrategy Support can do this: I never dared to ask them to, so please take my work and be sure not to forget it.
The Creating an empty project recipe in Chapter 2, The First Steps in a MicroStrategy Project