Mondrian
Mondrian is an open source OLAP server and is one of the main components of the Pentaho Business Intelligence platform.
Mondrian is a connector usually between a java-based OLAP frontend and a relational database (it works as a JDBC connector for OLAP, generates SQL queries to the database and processes the result data).
Basic installation and configuration of Mondrian
There are a few steps to follow in order to install the Mondrian server with standard configuration and attachments provided with the application:
- Install Java SDK - It can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Download and unpack the latest binary version of Mondrian server (http://community.pentaho.com/projects/mondrian/). The filename is Mondrian-version.zip. The following tutorial is based on the following version: Mondrian 2.3.2.8944
Mondrian can be run from an application server supporting Java (which can be Apache Tomcat for example). The application itself is compiled and packed into the mondrian.jar java archive
-
Setting up and configuring the data source
Configuring and setting up a database connection is a crucial task to perform in order to make Mondrian work correctly.
A good starting point may be to use a test database which is provided with the Pentaho installation package. It's easy to install and configure and ready to use and may be a good source of information on how to develop latter OLAP projects with Pentaho.
The test database name is MondrianFoodMart.mdb and it can be found in the Demo folder of the Mondrian-version.zip file.
In order to start exploring the data from Mondrian it's necessary to create a system ODBC data source, name it MondrianFoodMart and indicate path to the MondrianFoodMart.mdb database
After adding the ODBC data source it would be possible to invoke it from Mondrian by the following JDBC connection string: "jdbc:odbc:MondrianFoodMart".
The FoodMartCreateData.sql file (can be found in the Demo folder of the Mondrian-version.zip), is a ready to run set of SQL statements used to fill in the foodmartdata in any relational database. However the database structure needs to be created manually
Other way of loading an example data to a database is to use the MondrianFoodMartLoader application. It's described in more detail in the next tutorial lesson.
- Running Mondrian on a Web server
Steps to follow and things to have in mind:- Install a Web server - the Apache Tomcat 5.5.12 was used in the etl-tools.info tutorial
- Undeploy the mondrian.war file to the folder where our mondrian application will be installed (for example TOMCAT_HOME/webapps/mondrian). The archive can be undeployed with any zip program or from the Tomcat administration panel.
The mondrian.war file has all needed libraries to run the application. Those are: jPivot application used to create crosstabs, jFreeChart charting tool, XML, XSL, TLD, DTD configuration files and JSP pages
- Edit the mondrian.properties and web.xml files (they are in the WEB_INF folder) and set up the correct DB connection parameters.
Also, make sure that the database source and connection paramteres are correctly set up in the .jsp files from the WEB-INF/queries folder.
Please refer to the examples in next Pentaho tutorial lessons to see how to configure other data sources.
If configred correctly the mondrian examples homepage should appear under http://127.0.0.1:8080/mondrian
Mondrian mainpage:MDX query which feeds the data for the jPivot crosstab above:
select {[Measures].[Unit Sales], [Measures].[Store Cost], [Measures].[Store Sales]} ON COLUMNS, Order( Union( Union(Crossjoin({[Promotion Media].[All Media]}, {[Product].[All Products]}), Crossjoin({[Promotion Media].[All Media]}, [Product].[All Products].Children)), Union( Crossjoin([Promotion Media].[All Media].Children, {[Product].[All Products]}), Crossjoin([Promotion Media].[All Media].Children, [Product].[All Products].Children) ) ), [Measures].[Unit Sales], DESC) ON ROWS from [Sales] where [Time].[1997]
- Install a Web server - the Apache Tomcat 5.5.12 was used in the etl-tools.info tutorial