Developer: Business Intelligence

Using Oracle Business Intelligence Discoverer with the OLAP Option
by Mark Rittman

Learn the benefits of adding the OLAP Option to your OracleBI Discoverer reporting and analysis and the steps required to make OLAP reporting available to users.

Downloads for this article
Oracle Database 10g Release 1
Oracle Database 10g 10.1.0.4 Patchset
Analytic Workspace Manager 10g (10.1.0.4.0 or later)
Global Sample Schema (10.1.0.4.0 or later)
Oracle Business Intelligence 10g (10.1.2 or later)
Oracle Spreadsheet Add-in (10.1.2 or later)

Oracle Business Intelligence Discoverer (OracleBI Discoverer) is a suite of business intelligence tools that enables users to query and analyze data stored in Oracle and other databases. Included as part of Oracle Business Intelligence 10g, OracleBI Discoverer complements the OLAP Option to Oracle Database 10g Enterprise Edition, which extends the analytic capabilities of the Oracle database to include a logical dimensional model and specialized multidimensional datatypes.

This article explains the benefits of adding the OLAP Option to your OracleBI Discoverer reporting and analysis, describes the Analytic Workspace Manager 10g tool, and describes the steps OracleBI Discoverer administrators can take to make OLAP reporting available to their users.

A Dimensional View of the Organization

When the performance of an organization is analyzed, there are many aspects to consider. Take, for example, sales managers with responsibility for their region's profit—the results for the region are likely to be influenced by the sales team performance, the mix of products sold, the customers, and the profile of sales over time. Another example is school administrators who are looking to measure the grade point average for their school. The factors influencing grade point average include the pupil's background, the type of course, the teacher of a course, and the subjects taken, and administrators might well be interested in seeing how the average varied over a school year.

Situations such as these can be thought of as problems with many dimensions. In the case of school administrators, the problem is figuring out how to improve the grade point average and the dimensions of the problem are the different teachers, students, courses, and departments over the years. For sales managers, the problem is to improve the sales performance of the region; the dimensions of the problem are sales staff, territories, product mix, distribution channels, and time. In each of these situations, the person concerned is working on a problem that is multidimensional, and to come up with an answer, that person has to bear in mind all these aspects of the problem.

figure 1
Figure 1: The multidimensional nature of problems

OracleBI Discoverer for OLAP, together with the OLAP Option for Oracle Database 10g Enterprise Edition, gives you the ability to create multidimensional models of your data within Oracle Database and then query and analyze these models natively, using the familiar OracleBI Discoverer suite of tools. In addition, you can access these multidimensional models by using Microsoft Excel, combining the powerful analytic capabilities of Oracle with standard Excel functionality.

The Logical Dimensional Model

Users and administrators of OracleBI Discoverer will be familiar with the concepts of end user layers, business areas, folders, items, joins, hierarchies, and item classes. OracleBI Discoverer allows administrators to define business areas and folders that map to tables and columns within a database schema. Administrators define join paths between folders and can create complex folders that incorporate items from joined tables. End user layers and business areas allow administrators to remove the complexity from relational databases and present data items to users by using familiar business terms.

With its OLAP support, OracleBI Discoverer presents OLAP data to administrators and users by using a dimensional model created in the Oracle database. This dimensional model reflects the way users picture their business.

Looking back for a moment at our sales managers, the sales figures and trends they are attempting to understand are generated by multiple interactions between products, customers, and channels over time. Sales managers need to think multidimensionally, because of how these factors interact, and OracleBI Discoverer presents data to users in a way that mirrors this multidimensional way of thinking.

Within a logical dimensional model, data is organized by one or more dimensions—such as products, customers, territories, and time—and measures—such as units sold and average price. Dimensions may have one or more members (individual customers, product categories, sales territories), and they are organized into one or more hierarchies. Hierarchies define how data at the bottom level rolls up and might include levels (product, product group, product category), and attributes can be used to describe characteristics of a dimension member, such as the size, color, or product code. A logical model can consist of many dimensions, cubes, measures, hierarchies, levels, and attributes and often brings together data from across the organization.

figure 2
Figure 2: Viewing an OLAP logical model, using OracleBI Discoverer

When you think of your data dimensionally, you can formulate dimensional queries with terms familiar to businesspeople. For example,

"What was the percent change in revenue for a grouping of the top 20 percent of our products during a year-ago rolling three-month time period, compared to the current period this year for each region worldwide?"

or

"Who are my top 10 customers?"

without worrying about how the data is stored in the database.

The Oracle OLAP Multidimensional Engine

The OLAP Option to Oracle Database 10g provides a logical dimensional model and the ability to store data in both relational and multidimensional datatypes. When holding OLAP data relationally, the OLAP Option layers dimensional metadata over relational tables and columns and provides a dimensional Java OLAP API for data access. When OLAP data is stored multidimensionally, it is held in multidimensional datatypes held in analytic workspaces, a technology derived from the Oracle Express Server product family but now embedded in the Oracle RDBMS, and access is provided through the same Java OLAP API or SQL.

The multidimensional engine provided with the OLAP Option offers several advantages over a relational implementation for performing OLAP analysis. Multidimensional databases are uniquely suited to ad hoc analysis, place no restrictions on what data users can analyze, and can define any sort of calculation at any time. Multidimensional datatypes store data in specialized array-based data structures that offer performance benefits in an ad hoc query environment, and because measures are pre-joined to dimensions, the process of applying conditions to queries is extremely efficient. The OLAP Option multidimensional engine contains optimizations for handling large, sparse data sets and automatically handles navigation between base-level data and stored aggregates.

In addition, the multidimensional engine provides access to a range of complex calculations common to dedicated OLAP servers, such as allocations, forecasts, systems of equations within a dimension, and time-series calculations. In short, if you are considering using the OLAP Option and would like to provide fast, flexible reporting using a range of analytic and statistical calculations, your OLAP data should be stored in dedicated multidimensional analytic workspaces rather than in relational datatypes, which cannot provide this level of flexibility or functionality. But how do you go about using this feature?

Analytic Workspace Manager 10g

Although all this talk of analytic workspaces and multidimensional datatypes might sound unfamiliar to OracleBI Discoverer administrators, Oracle has provided two tools that make the creation and maintenance of multidimensional data simple and straightforward. Oracle Warehouse Builder, Oracle's complete extraction, transformation, and load (ETL) tool, provides a facility for loading data into multidimensional analytic workspaces and is typically used by data warehouse developers and DBAs. Typically, though, administrators of OracleBI Discoverer systems do not need all the features of a tool such as Oracle Warehouse Builder, because their data has already been extracted and prepared, and instead prefer tools that are concerned specifically with the maintenance of their OracleBI Discoverer metadata and workbooks. Analytic Workspace Manager 10g, a free download from OTN, is for OracleBI Discoverer administrators and departmental power users who want to take advantage of the OLAP Option and use analytic workspaces to hold their OLAP data.

Using Analytic Workspace Manager 10g, you can build a logical dimensional model that represents your OLAP data, defining dimensions, levels, hierarchies, attributes and measures to organize your data.

figure 3
Figure 3: Analytic Workspace Manager 10g model view

Once the logical model is complete, you can use Analytic Workspace Manager 10g to map datasources to this logical model and then use the tool to populate and maintain your analytic workspace. Analytic Workspace Manager has an intuitive, simple interface that follows the logical workflow in creating a multidimensional OLAP cube, and creates OLAP cubes and dimensions that are immediately usable with OracleBI Discoverer for OLAP.

Let's walk through the process of creating a multidimensional OLAP cube for use with OracleBI Discoverer for OLAP. This example uses the GLOBAL Sample Schema, which you can download today from OTN.

Building the Analytic Workspace

Before you start using Analytic Workspace Manager 10g, first ensure that Oracle Database 10g Enterprise Edition has the OLAP Option installed and has Patch Set 2 (10.1.0.4) applied. Then set the database parameters to values appropriate for analytic workspace data loads:

PARALLEL_MAX_SERVERS 	= number of processors, less one
PGA_AGGREGATE_TARGET 	= 40% of available memory
UTL_FILE_DIR 		= all directories that OLAP will need to write to
UNDO_MANAGEMENT 		= AUTO
UNDO_TABLESPACE 		= as defined earlier
              

Now, create tablespaces and datafiles to hold your data:

CREATE TABLESPACE "GLOBAL"
    DATAFILE 'GLOBAL.DBF' SIZE 90M AUTOEXTEND ON NEXT 5M;

CREATE TEMPORARY TABLESPACE "GLOBAL_TEMP"
    TEMPFILE 'GLOBAL_TEMP.DBF' SIZE 90M AUTOEXTEND ON NEXT 5M
    UNIFORM SIZE 256K;
              

Then create the schema that will hold your source data and analytic workspace.


CREATE USER "GLOBAL"
    IDENTIFIED BY "GLOBAL" DEFAULT TABLESPACE "GLOBAL"
       TEMPORARY TABLESPACE "GLOBAL_TEMP"
    QUOTA UNLIMITED ON "GLOBAL"
    QUOTA UNLIMITED ON "GLOBAL_TEMP";

GRANT "OLAP_USER" TO "GLOBAL";
              

Then, using the Import utility, import the sample source data into the GLOBAL schema. For example,


IMP GLOBAL/GLOBAL
Import file: EXPDAT.DMP > GLOBAL_TABLES.DMP
Enter insert buffer size (minimum is 8192) 30720> 30720
List contents of import file only (yes/no): no > no
Ignore create error due to object existence (yes/no): no > no
Import grants (yes/no): yes > yes
Import table data (yes/no): yes > yes
Import entire export file (yes/no): no > yes
              

Start up Analytic Workspace Manager 10g, register your database, and log on as the GLOBAL user. Right-click on the GLOBAL schema, select Create New Analytic Workspace, and name it GLOBAL.

figure 4
Figure 4: Creating an analytic workspace

Creating your first dimension. You now create the first dimension, CUSTOMER. Click on the GLOBAL analytic workspace, right-click on the dimension node, and select Create Dimension.

The CUSTOMER dimension has two hierarchies, SHIPMENTS and MARKET SEGMENT. The first step, however, is to define all the levels used by the two hierarchies; then you'll organize them into separate hierarchies.

Expand the CUSTOMER dimension, right-click on levels, and create the following levels:

  • TOTAL_CUSTOMER
  • TOTAL_MARKET
  • REGION
  • WAREHOUSE
  • SHIP TO
  • MARKET_SEGMENT
  • ACCOUNT

Right-click on the hierarchies node, and create the SHIPMENTS hierarchy. Include in it (in order, from top to bottom) the levels TOTAL CUSTOMER, REGION, WAREHOUSE, and SHIP TO.

figure 5
Figure 5: Creating the SHIPMENTS hierarchy

Then right-click on the hierarchies node again; create another hierarchy, MARKET SEGMENT; and include the levels (from top to bottom) TOTAL_MARKET, MARKET_SEGMENT, ACCOUNT, and SHIP TO. Once you've done so, your screen should look like this:

figure 6
Figure 6: Viewing your two hierarchies

The data that will be used to populate this dimension is in a table called CUSTOMER_DIM in the GLOBAL schema, one of several dimension tables that will provide some of the data required for your analytic workspace. Click on the Mappings node in the Model View, and drill down to the GLOBAL schema. Click on and drag the CUSTOMER_DIM table onto the mapping pane, and select Star Schema from the Type of Dimension Table(s) drop-down list.

Because your source data for this dimension is held in a table in a star schema, you can take advantage of the Auto Map Star Schema button on the mapping toolbar to automatically map your source fields to the logical dimension model. When the data is mapped, your screen should look like this:

figure 7
Figure 7: Mapping your dimension to source data

Importing templates. Next you create the PRODUCT dimension, but you don't do it manually. Rather, you bring the definition in by using a template file provided with the GLOBAL Sample Schema. Analytic Workspace Manager 10g allows you to save definitions for dimensions and cubes as an XML template, so you can, for example, save them in a version-control system or use them to deploy your logical model in a different location.

To import the definition, right-click on the dimensions node and then select Create dimension from template. Navigate to the directory where you unzipped the GLOBAL Sample Schema, and select the Product Other.XML file.

This file contains the definition for the PRODUCT dimension. Import the definitions, and then expand the dimension entry. Note that it has a single hierarchy with four levels, plus three additional attributes that belong to the ITEM level.

Within the mapping pane, note that source data has already been mapped to the PRODUCT dimension. In this instance, the source data is held in several normalized tables and the Type of Dimension Table(s) drop-down list is set to Other. With Analytic Workspace Manager 10g, your source data no longer has to be in a star schema, and tables arranged in a snowflake schema, or even regular normalized tables, are just as easy to use for datasources.

figure 8
Figure 8: Mapping data from normalized tables

To complete the set of dimensions for the logical model, import the definitions for the TIME and CHANNEL dimensions, by importing the Time Star.XML and Channel Star.XML template files.

Designing your cubes. The next step is to design your cubes. Cubes are the part of your logical dimensional model that bring together measures and their dimensions; they are containers for measures directly loaded from your source data, along with any additional calculated measures, with each of the measures in the cube sharing the same set of dimensions. A logical model can have many cubes, but all of the dimensions in a cube must come from the same analytic workspace.

In this example, you will create a single cube that will contain measures for UNITS_SOLD and SALES. To create it, click on the Cubes node, right-click, and select Create Cube. Give the cube the name UNITS_CUBE, and select all four dimensions.

figure 9
Figure 9: Defining the units cube

The Implementation Details tab enables you to specify how Analytic Workspace Manager 10g orders dimensions within the cube and whether it uses features such as compression and partitioning to improve the performance of data loading and aggregation.

The order in which you list the dimensions within a cube is important, due to the way the values for a measure are stored on disk. Measures within analytic workspaces are stored as a linear stream of data in which the values of what is termed the "fastest varying" dimension are clustered close together and the values of the "slowest varying" dimension are spread far apart. The fastest varying dimension should therefore be the dimension with the largest number of dimension members and needs to be listed as the first dimension in the cube, with the remaining dimensions being listed in size order, so that the last dimension, the slowest varying, is the last one.

The Implementation Details tab also lets you designate dimensions as being sparse or dense. Sparsity refers to the extent to which cells contain NA, or null, values, and your UNITS_CUBE is likely to be sparse along the PRODUCT, CHANNEL, and CUSTOMER dimensions, because not every product will have been sold to every customer through every channel. When you specify that two or more dimensions are sparse, Analytic Workspace Manager 10g generates a composite specification that implements these logical dimensions as a single composite and dimensions the measure by this composite instead of the separate dimensions. Storing data in this manner reduces the amount of disk space required for the analytic workspace when it is aggregated and improves the response time for user queries. See Oracle OLAP DML Reference 10g Release 1 (10.1.0.3) for more details on composites.

If you are aware that your cube is extremely sparse, you can check the Compression box and implement your cube by using a new feature, introduced with Oracle Database 10g, known as compressed composites. Compressed composites reduce redundant data within the measure and the composite, using a patented algorithm, and produce the smallest-possible measure, composite, and composite index and can dramatically reduce the amount of time required to aggregate a cube. The first release of this new feature has some limitations on when compressed composites can be used and some restrictions on aggregation, which are due to be relaxed with the release of Oracle Database 10g Release 2. If your cube is extremely sparse, however, you may get significant performance improvements by using this option. For more-detailed information on compressed composites, refer to the Analytic Workspace Manager 10g online help.

In your instance, your cube is only moderately sparse, so you should leave this option unchecked.

Two other tabs in the Create Cube dialog box allow you to specify how your measures are aggregated and to what extent summaries are precalculated and stored within the cube. As mentioned earlier, analytic workspaces, unlike relational OLAP implementations, embed summaries within the measure itself, aggregate navigation is performed automaticall, and you can decide how this aggregation is performed by using these two tabs.

On the Rules tab, you can choose either the default SUM aggregation for each logical dimension or one of a range of alternative aggregation methods possible with an analytic workspace, such as weighted first, weighted average, or nonadditive.

figure 10
Figure 10: Setting aggregation rules

For this cube, though, only a simple SUM aggregation is required for each dimension, so you should leave the methods as the default settings.

Using the Summarize To tab, you can select the levels at which data in each dimension is presummarized. By default, Analytic Workspace Manager 10g preselects every other level in each dimension, which would normally represent an acceptable balance between the query response time and the time required to prepare a cube for query.

Now that the UNITS cube has been defined, expand the cube within the model view and right-click on the Measures node. Select Create Measure, and name it UNITS. Do the same again, and create another measure called SALES. You can choose to override the aggregation specification you previously defined for our cube, but for this example, you should accept the default value and inherit the specification for the parent cube.

The data that will be used to populate your UNITS and SALES measures is also in a table in the GLOBAL schema. Click on the Mappings node, and drop the GLOBAL.UNITS_HISTORY_FACT table onto the mapping pane next to the UNITS cube. Because the UNITS fact table is part of a star schema, click on the Auto Map Star Schema button to map the fact source columns onto your cube.

figure 11
Figure 11: Mapping source data to the units cube

Note that instead of automatically mapping the fact table columns onto our UNITS cube, you could manually map each source field to the relevant measure or dimension level, using a technique familiar to users of Oracle Warehouse Builder.

As well as the UNITS and SALES measures that are sourced from tables in our source data, you will now create a calculated measure that will contain the amount by which sales have increased or decreased since the same time last year. To implement this calculated measure, right-click on the Calculated Measures node in the model view for our UNITS cube, name the calculated measure PCT_CHANGE_SINCE_LAST_YEAR, and select the Percent Difference from Prior Period calculation type from the Prior/Future Comparison folder.

figure 12
Figure 12: Creating a calculated measure

On the next page of the wizard, select SALES as the measure for which you want the percent difference calculated, CALENDAR YEAR as the time hierarchy, and YEAR AGO as the date range.

figure 13
Figure 13: Defining a time-series calculation

Click on Finish. The ease with which "time series" calculations can be created is one of the key benefits of using an analytic workspace, and Analytic Workspace Manager 10g allows you to create them without any need to know OLAP DML, the language used to program and interrogate analytic workspaces.

Loading the cube. Now that the OLAP dimensions, cubes, and measures are built and the source data is specified, you can load the cube. Right-click on the GLOBAL analytic workspace, and then select Maintain Analytic Workspace GLOBAL. Highlight and bring across all of the objects in the analytic workspace.

figure 14
Figure 14: Selecting cubes and dimensions for building

On the next page, accept the default options, click on Next, and then ensure that the Run Maintenance Task Immediately In This Session checkbox is selected. Click on Finish, and Analytic Workspace Manager 10g loads source data into your objects.

At the end of the load, Analytic Workspace Manager 10g reports on the progress and results of each stage, and you should check at the end of the report to ensure that there have not been any errors in your load process.

figure 15
Figure 15: Monitoring the progress of the cube build

You can now use Analytic Workspace Manager 10g to preview the data in your measures and dimensions. Right-click on the CUSTOMER dimension, and select View Data Customer. You can then view the dimension members in this logical dimension and navigate up and down the hierarchies and levels to check your data.

figure 16
Figure 16: Viewing the customer dimension

Do the same with your UNITS measure. Note that values exist at all levels of the dimension hierarchies, some of which are precalculated as per your specification, with the rest being calculated "on the fly."

figure 17
Figure 17: Viewing the units cube

Enabling your cube for OracleBI Discoverer for OLAP. Finally, OracleBI Discoverer for OLAP, instead of holding its metadata in an end user layer, stores its workbook definitions and permissions in the Discoverer Catalog. If you have not done so already, you'll now need to enable the GLOBAL user for access to the Discoverer Catalog, using Oracle Application Server Control.

figure 18
Figure 18: Enabling the schema for the Discoverer catalog

Log on to Application Server Control, navigate to the Discoverer Catalog, and authorize the GLOBAL schema.

Analyzing Your Cube, Using OracleBI Discoverer for OLAP

You can now analyze your OLAP cube, using OracleBI Discoverer for OLAP. In a Web browser, start OracleBI Discoverer Plus, select OracleBI Discoverer for OLAP from the drop-down menu, wait for the page to refresh, and enter your connection details.

figure 19
Figure 19: Connecting to OracleBI Discoverer for OLAP

Using the Workbook Wizard, create a new cross-tab and graph and select the measures you want in your worksheet. Note how dimensions are automatically added to your selection. Later you can choose which levels and attributes you want to display from each logical dimension.

figure 20
Figure 20: The OracleBI Discoverer Workbook Wizard

Moving on through the Workbook Wizard, after you have chosen the graph you want to include in your worksheet, you can specify for each dimension which hierarchy and dimension members you want to include in the worksheet.

Once you have manually added dimension members to your selection, you can use the Conditions tab to conditionally add dimension members to or remove them from your selection. For example, first add all the WAREHOUSE-level dimension members to your selection, like this:

figure 21
Figure 21: Selecting dimension members

Then, using the Conditions tab, keep the five warehouses with the top sales . Note how the wizard allows you to build up queries step by step and how the most-common condition types are already predefined for you—there's no need to learn complicated analytic SQL or a separate OLAP query language.

figure 22
Figure 22: Adding a condition to the dimension selection

Now that you have refined your dimension member selection, complete the process by using the wizard to define your remaining dimension member selections.

figure 23
Figure 23: Viewing the dimension member selection

Your OracleBI Discoverer workbook appears.

figure 24
Figure 24: The completed OracleBI Discoverer for OLAP workbook

Using this combination of a dimensional model, an easy-to-use query builder, and the power of the analytic workspace, you can now build OracleBI Discoverer for OLAP workbooks that mirror the multidimensional way your business users think.

Using the Oracle Spreadsheet Add-in to Analyze Your Cube

Besides being able to display your OLAP data by using OracleBI Discoverer, you can also use the new Oracle Spreadsheet Add-in to import your data into Microsoft Excel. You can either download the Oracle Spreadsheet Add-in directly from OTN or install it as part of the Oracle Business Intelligence Tools bundle.

Once the Oracle Spreadsheet Add-in has been installed and Microsoft Excel has been loaded, navigate to the Oracle menu item and create a new query. Using the Connection Editor, create a connection to the database that holds your OLAP data. Then, in the OLAP Connection dialog box, connect to the global schema.

You will then be presented with the Query Wizard, which enables you to create an OLAP query much as you created your OracleBI Discoverer for OLAP query. Using the Query Wizard, select the SALES measure and apply the same conditions to the dimensions as before.

figure 25
Figure 25: The Oracle Spreadsheet Add-in Query Wizard

When you have completed your query definition, your OLAP data appears in your spreadsheet, can be refreshed when required, and can be treated just like any other data in your spreadsheet.

figure 26
Figure 26: Viewing OLAP data in Microsoft Excel

Summary

Adding the OLAP Option to OracleBI Discoverer gives you the ability to query and report against your data, using a logical dimensional model. The advantage of using a logical dimensional model is that it mirrors the way people picture their organizations.

By implementing your logical dimensional model with multidimensional analytic workspaces, you can take advantage of the query and aggregation optimizations in the OLAP engine that is now embedded in Oracle Database 10g. Analytic Workspace Manager 10g, now available as a free download from OTN, helps you quickly build analytic workspaces that enable you to use the OLAP capabilities of OracleBI Discoverer. Coupled with the Oracle Spreadsheet Add-in, OracleBI Discoverer, Oracle Database 10g, and the OLAP Option let you provide sophisticated, easy-to-use business intelligence for a whole range of users.
Next Steps

Now that you have built your first OLAP cube and analyzed it by using OracleBI Discoverer for OLAP, here are some other strategies you might like to try:

  • Adding further calculated measures to your OLAP cube, using Analytic Workspace Manager 10g, including ones using time-series comparison or ranking against other members in the current dimension or other dimensions
  • Displaying your worksheets over the Web, using OracleBI Discoverer Viewer
  • Building a Web "performance dashboard," using Oracle Portal
  • Applying new OracleBI Discoverer for OLAP features, such as stoplighting, to your workbooks
  • Building more-complex workbooks and calculations, using the OracleBI Discoverer for OLAP Query and Calculation Wizards


Mark Rittman is a Certified Oracle Professional DBA and works as a technical account manager at SolStonePlus, specializing in developing business intelligence and data warehousing applications by using Oracle Database, Oracle Application Server, OracleBI Discoverer, Oracle Warehouse Builder, and Oracle OLAP. Outside of SolStonePlus, Mark chairs the UKOUG BI and Reporting Tools SIG and runs a Weblog dedicated to Oracle BI and data warehousing technology. Rittman is an Oracle ACE and a regular speaker at Oracle user events in the UK, Europe, and the United States.



Please rate this document:

Excellent Good Average Below Average Poor


Send us your comments


 

 
 


E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy