Thursday, 11 August 2011

Types of Fact Tables



Types of Facts

There are three types of facts:
  • Additive: Additive facts are facts that can be summed up through all of the dimensions in the fact table.
  • Semi-Additive: Semi-additive facts are facts that can be summed up for some of the dimensions in the fact table, but not the others.
  • Non-Additive: Non-additive facts are facts that cannot be summed up for any of the dimensions present in the fact table.
Let us use examples to illustrate each of the three types of facts. The first example assumes that we are a retailer, and we have a fact table with the following columns:


Date
Store
Product
Sales_Amount
The purpose of this table is to record the sales amount for each product in each store on a daily basis. Sales_Amount is the fact. In this case, Sales_Amount is an additive fact, because you can sum up this fact along any of the three dimensions present in the fact table -- date, store, and product. For example, the sum ofSales_Amount for all 7 days in a week represent the total sales amount for that week.
Say we are a bank with the following fact table:

Date
Account
Current_Balance
Profit_Margin
The purpose of this table is to record the current balance for each account at the end of each day, as well as the profit margin for each account for each day. Current_Balance and Profit_Margin are the facts. Current_Balance is a semi-additive fact, as it makes sense to add them up for all accounts (what's the total current balance for all accounts in the bank?), but it does not make sense to add them up through time (adding up all current balances for a given account for each day of the month does not give us any useful information). Profit_Margin is a non-additive fact, for it does not make sense to add them up for the account level or the day level.


Types of Fact Tables

Based on the above classifications, there are two types of fact tables:
  • Cumulative: This type of fact table describes what has happened over a period of time. For example, this fact table may describe the total sales by product by store by day. The facts for this type of fact tables are mostly additive facts. The first example presented here is a cumulative fact table.
  • Snapshot: This type of fact table describes the state of things in a particular instance of time, and usually includes more semi-additive and non-additive facts. The second example presented here is a snapshot fact table. 

Spaninfotech Interview Questions&Answers(11-06-2011)

1.select max(sal),deptno from emp where max(sal)>2000 group by deptno this Query is right or wrong?
Ans:select max(sal),deptno from emp group by deptno having max(sal)>2000 it is the right one.


2. what is the diff b/w where and having clause?
Ans:where can restrict each row or record
having clause restrict group of records.


3.Can we use transaction control transformation on a flatfile target?
Ans:we can't use,Transaction Control transformations connected to any target other than relational, XML, or dynamic MQSeries targets are ineffective for those targets.


4.which one given better performnce static or dynamic lkp?
Ans:Performance wise static lookup is better than dynamic lkp,dynamic Lookup is that they are slow as the caches are updated frequently based on the transaction posted in the database.

5. when we use dynamic lookup?
Ans:if the table contains more no.of duplicate records then we use dynamc lkp to eliminate duplicates.

6.i have 10 records in my source table  i can take  filter transformation i can give the condition true then how many records loaded into the target tale ?
ANs :10 records,every active transaformation by default act as passive transformation.

Hp interview Questions and answers (11-06-2011)


1.what is meant by inlineview?
Ans: inline view is a SELECT statement in the FROM-clause of another SELECT statement.
In-line views are commonly used simplify complex queries by removing join operations 
and condensing several separate queries into a single query.


2.what is conformed dimension?
Ans:a dimension table can be shared by more than one facttable is known conformed dmension.
ex:date dimension.


3.what is factlessfact table?
Ans:factless fact table captures many to many relationship b/w dimensions,and it dosen't contain any numeric values.
ex:studance attandence tracking.
store that did not sell a product over aperiod of time.


4.i have 3 flatfiles with same stracture how to join without using joiner transformation?
Ans:by using file list concept with file type as indirect .


5.how to delete the duplicate records in unix?
Ans:sort filename.txt|uniq -u


6.what is surrogatedkey?
Ans:surrogatedkey is a systemgenarated sequence number to be used as a primary key.


7.what is diff b/w surrogatekey and primarykey?
Ans:   surrogatekey                             primarykey
    1.artificialkey                                   1.naturalkey
    2.generated by system sequance       2.generated by database 
       number


8.what is subqurey & corelated subquarey?
Ans:subquarey:-A query nested inside a SELECT statement is known as a subquery 
and is an alternative to complex join statements.
CorelatedsubQuarey:-It is a sub-query (a query nested inside another query) 
that uses values from the outer query in its WHERE clause. The sub-query 
is evaluated once for each row processed by the outer query.


9.how to eliminate duplicate records in informatica and in sql?
Ans:in informatica by using distinct property in sourcequalifier or by using sortet t/r.
in sql delete from emp where rowid not in(select max(rowid) from emp group by empno);

INSTALLING ORACLE 10G – STEP BY STEP GUIDE

Introduction:

This article is a step-by-step instruction for those who want to install Oracle 10g database on their computer. This document provides guidelines to install Oracle 10g database on Microsoft Windows environment. If you use other operating system other than Microsoft Windows, the process is not too much different from that of Microsoft Windows, since Oracle uses Oracle Universal Installer to install its software.
For more information about installing Oracle 10g under operating systems other than Microsoft Windows, please refer to this URL :

How to get Oracle 10g :

You can download Oracle 10g database from www.oracle.com. You must registered and create an account before you can download the software. The example in this document uses Oracle Database 10g Release 2 (10.2.0.1.0) for Microsoft Windows.

How to uninstall Oracle database software :

  1. Uninstall all Oracle components using the Oracle Universal Installer (OUI).
  2. Run regedit.exe and delete the HKEY_LOCAL_MACHINE/ SOFTWARE/ORACLE key. This contains registry entire for all Oracle products.
  3. Delete any references to Oracle services left behind in the following part of the registry: HKEY LOCAL MACHINE/ SYSTEM/ CurrentControlsSet/ Services/Ora*. It should be pretty obvious which ones relate to Oracle
  4. Reboot your machine.
  5. Delete the C: \Oracle directory, or whatever directory is your Oracle_Base.
  6. Delete the C:\Program Files \Oracle directory.
  7. Empty the contents of your c:\temp directory.
  8. Empty your recycle bin.

Installing Oracle 10g database software :

  1. Insert Oracle CD , the autorun window opens automatically. If you are installing from network or hard disk, click setup.exe in the installation folder.
  2. The Oracle Universal Installer (OUI) will run and display the Select Installation MethodWindow.
    oracle10g installation
  3. Choose Basic Installation:
    Select this option to quickly install Oracle Database 10g. This method requires minimal user input. It installs the software and optionally creates a general-purpose database based on the information you provide. 
    For basic installation, you specify the following:
    Oracle Home Location — Enter the directory in which to install the Oracle Database 10g software. You must specify a new Oracle home directory for each new installation of Oracle Database 10g. Use the default value, which is :
    c:\oracle\product\10.2.0\db_1

    Installation Type — Select Enterprise Edition :
    If you have limited space, select standard edition. Personal edition installs the same software as the Enterprise Edition, but supports only a single-user development and deployment environment.
    Create Starter Database — Check this box to create a database during installation. Oracle recommends that you create a starter database for first Create Starter Database — time installations. Choose a Global Database Name, like cs157b, or just use the default value.
    Type a password. Don’t lose this password, since you will need it to connect to the database server.
    Click next
  4. The Product-Specific Prerequisite Checks window appears: Click next 
    oracle10g installation
  5. A summary screen appears showing information such as your global settings, space requirements and the new products to be installed. Click Install to start the installation..
  6. The Install window appears showing installation progress.
    oracle10g_installation
  7. At the end of the installation phase, the Configuration Assistants window appears. This window lists the configuration assistants that are started automatically. 
    If you are creating a database, then the Database Configuration Assistant starts automatically in a separate window.
    oracle 10g installation
    oracle 10g installation
    At the end of database creation, you are prompted to unlock user accounts to make the accounts accessible. The SYS and SYSTEM accounts are already unlocked. Click OK to bypass password management.
    oracle 10g installation

    Note: Oracle 10g still keeps scott / tiger username and password (UID=scott, PWD=tiger) from the old version of oracle. In the old version of oracle, scott/tiger user ID is available by default, but not in oracle 10g. If you want to use scott /tiger account, you must unlock it by clicking “Password Management” at the last window. 
    Password Management window will appear like the one shown below. Find the user name “Scott” and uncheck the “Lock Account?” column for the user name.
  8. Your installation and database creation is now complete. The End of Installation window displays several important URLs, one of which is for Enterprise Manager.

    oracle 10g installation
  9. You can navigate to this URL in your browser and log in as the SYS user with the associated password, and connect as SYSDBA. You use Enterprise Manager to perform common database administration tasks 
    Note : you can access Oracle Enterprise Manager using browser by typing the URL shown above in your browser. Instead of typing the IP address, you can also access the Enterprise Manager by typing http://localhost:1158/em or “http://[yourComputerName]:1158/em” or by clicking “Start >> All Programs >> Oracle – [YourOracleHome_home1] >> Database Control – [yourOracleID]” in Windows menu.
    By default, use user ID “SYSTEM”, with the password that you have chosen at the beginning of installation, to connect to database, SQLPlus, etc. If you want to use other user ID, you may create a new user .

Monday, 8 August 2011

informatica scenarios

Informatica Scenario based Questions and Solutions (Part-1)

Scenario1:

We have a target source table containing 3 columns : Col1, Col2 and Col3. There is only 1 row in the table as follows:

Col1 Col2 Col3
-----------------
  a       b       c

There is target table contain only 1 column Col. Design a mapping so that the target table contains 3 rows as follows:

Col
-----
a
b
c

Solution: Not using a Normaliser transformation:

Create 3 expression transformations exp_1, exp_2 and exp_3 with 1 port each. Connect col1 from Source Qualifier to port in exp_1.Connect col2 from Source Qualifier to port in exp_2.Connect col3 from source qualifier to port in exp_3. Make 3 instances of the target. Connect port from exp_1 to target_1. Connect port from exp_2 to target_2 and connect port from exp_3 to target_3.

Scenario 2:

There is a source table that contains duplicate rows.Design a mapping to load all the unique rows in 1 target while all the duplicate rows (only 1 occurence) in another target.

Solution :

Bring all the columns from source qualifier to an Aggregator transformation. Check group by on the key column. Create a new output port count_col in aggregator transformation and write an expression count(key_column). Make a router transformation with 2 groups:Dup and Non-Dup. Check the router conditions count_col>1 in Dup group while count_col=1 in Non-dup group. Load these 2 groups in different targets.

Scenario 3:

There is a source table containing 2 columns Col1 and Col2 with data as follows:

Col1   Col2
 a          l
 b         p
 a         m
 a         n
 b         q
 x          y

Design a mapping to load a target table with following values from the above mentioned source:

Col1    Col2
  a        l,m,n
  b       p,q
  x        y

Solution:

Use a sorter transformation after the source qualifier to sort the values with col1 as key. Build an expression transformation with following ports(order of ports should also be the same):

1. Col1_prev : It will be a variable type port. Expression should contain a variable e.g val
2. Col1 : It will be Input/Output port from Sorter transformation
3. Col2 : It will be input port from sorter transformation
4. val : It will be a variable type port. Expression should contain Col1
5. Concatenated_value: It will be a variable type port. Expression should be decode(Col1,Col1_prev,Concatenated_value||','||Col2,Col1)
6. Concatenated_Final : It will be an outpur port conating the value of Concatenated_value

After expression, build a Aggregator Transformation. Bring ports Col1 and Concatenated_Final into aggregator. Group by Col1. Don't give any expression. This effectively will return the last row from each group.

Connect the ports Col1 and Concatenated_Final from aggregator to the target table.

Scenario 4:

Design an Informatica mapping to load first half records to 1 target while other half records to a separate target.

Solution:

You will have to assign a row number with each record. To achieve this, either use Oracle's psudo column rownum in Source Qualifier query or use NEXTVAL port of a Sequence generator. Lets name this column as rownumber.

From Source Qualifier, create 2 pipelines:

First Pipeline:
Carry first port Col1 from SQ transformation into an aggregator transformation. Create a new output port "tot_rec" and give the expression as COUNT(Col1). Do not group by any port. This will give us the total number of records in Source Table. Carry this port tot_rec to an Expression Transformation. Add another port DUMMY in expression transformation with default value 1.

Second Pipeline:
from SQ transformation, carry all the ports(including an additional port rownumber generated by rownum or sequence generator) to an Expression Transformation. Add another port DUMMY in expression transformation with default value 1.

Join these 2 pipelines with a Joiner Transformation on common port DUMMY. carry all the source table ports and 2 additional ports tot_rec and rownumber to a router transformation. Add 2 groups in Router : FIRST_HALF and SECOND_HALF. Give condition rownumber<=tot_rec/2 in FIRST_HALF. Give condition rownumber>tot_rec/2 in SECOND_HALF.
Connect the 2 groups to 2 different targets.


Informatica Scenario - 5

Previous Scenarios
Scenario: A source table contains emp_name and salary columns. Develop an Informatica mapping to load all  records with 5th highest salary into the target table.
Solution:
The mapping will contain following transformations after the Source Qualifier Transformation:
1. Sorter : It will contain 2 ports - emp_name and salary. The property 'Direction' will be selected as 'Descending' on key 'Salary'
2. Expression transformation: It will 6 ports as follows -
     a> emp_name : It will be an I/O port directly connected from previous sorter transformation
     b> salary_prev : It will be a variable type port. Give any vriable name e.g val in its Expression column
     c> salary : It will be an I/O port directly connected from previous transformation
     d> val : It will be a variable port. The expression column of this port will contain 'salary'
     e> rank: It will be a variable type port. The expression column will contain decode          
                   (salary,salary_prev,rank,rank+1)
     f> rank_o : It will be an output port containg the value of 'rank'.
3. Filter Transformation : It will have 2 I/O ports emp_name and salary with a filter condition rank_o = 5
The ports emp_name and salary from Filter Transformation will be connected to target


Router Scenario:6
Lets say  i have more then have record in source table  and i have 3 destination table A,B,C. I have to insert first 1 to 10 record in A then 11 to 20 in B and 21 to 30 in C.
Then again from 31 to 40 in A, 41 to 50 in B and 51 to 60 in C……So on upto last record.
Solution:
Generate sequence number using informatica, add filter or router transformations and define the conditions accordingly…
Define group condition as follows under router groups….
Group1 = mod(seq_number,30) >= 1 and mod(seq_number,30) <= 10
Group2 = mod(seq_number,30) >= 11 and mod(seq_number,30) <= 20
Group3 = (mod(seq_number,30) >=21 and mod(seq_number,30) <= 29 ) or mod(seq_number,30) = 0
Connect Group1 to A, Group2 to B and Group3 to C




Scenario:7
How to load first and last from source
SRC QF -> SEQ -> EXP -> AGR -> RTR -> TGT
create a port in expression t/r and generate a value for 
each row using SEQ genrator, then in Agr take count of all 
th record.create 2 condition in in router one with SEQ = 1 
and another with SEQ = count of rows (this will give last 
row).connect both to target.dont forget to give reset 
option in SEQ generator

scd initial data load

PROCESSING SLOWLY CHANGING DIMENSIONS DURING INITIAL
DATA LOAD: A PRAGMATIC COMPROMISE

Last month's tip clearly defined the type 2 slowly changing dimension technique and the proper use of surrogate keys. This month we tackle the vexing issue of handling slowly changing dimensions during the initial load of a new subject area within a data warehouse. This would occur when you have brought a new measurement (fact) source into an existing data warehouse. Dimensions like product, customer, and time are probably already defined and have a rich history reflecting many "slow changes".

First I'll describe the regular ETL (extract-transform-load) processing that would happen each night:

Dimensions are processed first, any new records from the production source are inserted into the dimension tables and are assigned the next surrogate key in sequence. Existing dimension records that have changed since the last load of the warehouse are detected and the nature of their change examined. An established slowly changing dimension policy will decide, based on which fields have changed, whether the current dimension record should be destructively updated and the old values lost (type 1) or that a new dimension record possessing the same natural ID should be created using the next surrogate key in sequence (type 2).

Following all these intricate comparisons and decisions on each dimension, it is time to face the bulk load of the facts. Here speed is of the essence. The natural IDs must be stripped off the fact records and replaced with the correct surrogate keys as rapidly as possible. Ideally we want to take advantage of the in-memory lookup processing offered by the majority of modern ETL tools. Small lookup tables for each dimension that translate natural IDs to surrogate keys are built from the dimension tables in the warehouse RDBMS using statements similar to the ones below:

Select customer_ID, max(customer_key) from customer
group by customer_ID

or

Select customer_ID, customer_key from customer
Where current = 'Y'

By doing so, the lookup tables will contain the surrogate keys that match the new facts and will support rapid hash lookups.

However, this simple and efficient lookup technique will not be sufficient if we are loading a significant span of historical facts in this first load. For example, imagine the situation where we are initially loading two years worth of transactions and we are 'blessed' with having the same two years of customer master file history. The two may never have met on a report before but we wish to match them precisely in this new data mart and perfectly partition history.

The dimension lookup would have to contain the historic surrogate keys for each customer detail change during the two year time period. The simple hash lookup comparable to the SQL:

Select customer_key from customer_lookup CL
where CL.customer_ID = factfile.customer_id

must be replaced with:

Select customer_key from customer_lookup CL
where customer_ID = factfile.customer_id and factfile.transaction_date
between CL.effective_date and CL.end_date

The 'between date logic' required here will slow the processing of a several hundred million row fact load with ten such dimensions to a crawl. Added to this, you now have two very different fact load applications. If you ever get this initial load to run to completion, you have to throw it away and then build, test and maintain the simpler version that will incrementally load the fact table from now on.

While being something of a compromise, the answer to this problem has an appealing simplicity. Don't build the complex bulk job, only build the incremental job! This technique provides a far truer version of the past than simply attaching all historic facts to the current dimension records and vowing to slowly change from now on, which is often the strategy adopted when faced with the initial bulk load. Here's what I suggest you do:

Take the two-year load and break it into one hundred and four jobs each representing one week's worth of transactions and run them sequentially in rapid succession. Begin each job by loading only the dimensional history relevant for that week, i.e., where the dimension detail effective_dates are less than or equal to the minimum transaction date. While this means a little additional logic in the dimension maintenance stages, the fact load can run unaltered. It can do so because the simple lookup tables contain the maximum surrogate keys applicable for the load period. You have just run 104 incremental loads. The compromise is that some fact records will be attached to dimension records that are up to a week out of date. In most cases this is a small margin of error because the dimensions are changing slowly.

The techniques for maintaining dimensions and building lookup tables are described in more detail in Ralph's June 1998 Data Warehouse Architect article "Pipelining Your Surrogates"

informatica interview q&a

Data Warehouse FAQ’s

What is a Data Warehouse?

A Data Warehouse is the "corporate memory". Academics will say it is a subject oriented, point-in-time, inquiry only collection of operational data.
Typical relational databases are designed for on-line transactional processing (OLTP) and do not meet the requirements for effective on-line analytical processing (OLAP). As a result, data warehouses are designed differently than traditional relational databases.

What is ETL/ How does Oracle support the ETL process?

ETL is the Data Warehouse acquisition processes of Extracting, Transforming (or Transporting) and Loading (ETL) data from source systems into the data warehouse.
Oracle supports the ETL process with their "Oracle Warehouse Builder" product. Many new features in the Oracle9i database will also make ETL processing easier. For example:
  • New MERGE command (also called UPSERT, Insert and update information in one step);
  • External Tables allows users to run SELECT statements on external data files (with pipelining support).

What is the difference between a data warehouse and a data mart?

This is a heavily debated issue. There are inherent similarities between the basic constructs used to design a data warehouse and a data mart. In general a Data Warehouse is used on an enterprise level, while Data Marts is used on a business division/department level. A data mart only contains the required subject specific data for local analysis.

What is the difference between a W/H and an OLTP application?

Typical relational databases are designed for on-line transactional processing (OLTP) and do not meet the requirements for effective on-line analytical processing (OLAP). As a result, data warehouses are designed differently than traditional relational databases.
Warehouses are Time Referenced, Subject-Oriented, Non-volatile (read only) and Integrated.
OLTP databases are designed to maintain atomicity, consistency and integrity (the "ACID" tests). Since a data warehouse is not updated, these constraints are relaxed.

What is the difference between OLAP, ROLAP, MOLAP and HOLAP?

ROLAP, MOLAP and HOLAP are specialized OLAP (Online Analytical Analysis) applications.
ROLAP stands for Relational OLAP. Users see their data organized in cubes with dimensions, but the data is really stored in a Relational Database (RDBMS) like Oracle. The RDBMS will store data at a fine grain level, response times are usually slow.
MOLAP stands for Multidimensional OLAP. Users see their data organized in cubes with dimensions, but the data is store in a Multi-dimensional database (MDBMS) like Oracle Express Server. In a MOLAP system lot of queries have a finite answer and performance is usually critical and fast.
HOLAP stands for Hybrid OLAP, it is a combination of both worlds. Seagate Software's Holos is an example HOLAP environment. In a HOLAP system one will find queries on aggregated data as well as on detailed data.

What is the difference between an ODS and a W/H?

An ODS (Operational Data Store) is an integrated database of operational data. Its sources include legacy systems and it contains current or near term data. An ODS may contain 30 to 90 days of information.
A warehouse typically contains years of data (Time Referenced). Data warehouses group data by subject rather than by activity (subject-oriented). Other properties are: Non-volatile (read only) and Integrated.

What Oracle tools can be used to design and build a W/H?

Data Warehouse Builder (or Oracle Data Mart builder), Oracle Designer, Oracle Express, Express Objects, etc.

When should one use an MD-database (multi-dimensional database) and not a relational one?

Data in a multi-dimensional database is stored as business people views it, allowing them to slice and dice the data to answer business questions. When designed correctly, an OLAP database will provide must faster response times for analytical queries.
Normal relational databases store data in two-dimensional tables and analytical queries against them are normally very slow.

  What is a star schema? Why does one design this way?

A single "fact table" containing a compound primary key, with one segment for each "dimension," and additional columns of additive, numeric facts.
Why?
  It allows for the highest level of flexibility of metadata
  Low maintenance as the data warehouse matures
  Best possible performance


When should you use a STAR and when a SNOW-FLAKE schema?

The star schema is the simplest data warehouse schema. Snow flake schema is similar to the star schema. It normalizes dimension table to save data storage space. It can be used to represent hierarchies of information.

What is the difference between Oracle Express and Oracle Discoverer?

Express is an MD database and development environment. Discoverer is an ad-hoc end-user query tool.

How can Oracle Materialized Views be used to speed up data warehouse queries?

With "Query Rewrite" (QUERY_REWRITE_ENABLED=TRUE in INIT.ORA) Oracle can direct queries to use pre-aggregated tables instead of scanning large tables to answer complex queries.
Materialized views in a W/H environments is typically referred to as summaries, because they store summarized data.

What Oracle features can be used to optimize my Warehouse system?

The following Oracle features can be used to compliment your Warehouse system/database:
  • From Oracle8i One can transport tablespaces between Oracle databases. Using this feature one can easily "detach" a tablespace for archiving purposes. One can also use this feature to quickly move data from an OLTP database to a Warehouse database.
  • Data partitioning allows one to split big tables into smaller more manageable sub-tables (partitions). Data is automatically directed to the correct partition based on data ranges or hash values.
  • Oracle Materialized Views can be used to pre-aggregate data. The Query Optimizer can direct queries to summary/ roll-up tables instead of the detail data tables (query rewrite). This will dramatically speed-up warehouse queries and saves valuable machine resources.
  • Oracle Parallel Query can be used to speed up data retrieval by using multiple processes (and CPUs) to process a single task.

1. Q: What is a Star Schema?
A: This is widely used approach for physically modeling a data warehouse. On an Entity Relationship Diagram (ERD) a Star Schema has a single fact table in the center surrounded by multiple dimension reference tables. Together they form the shape of a multi-pointed star.

2. Q: What is a Snowflake Schema?
A: A lot like a Star Schema a Snowflake Entity Relationship Diagram keeps the fact table in the middle but normalizes the dimensional reference tables.  An example would be to break down the Time dimension and create tables for each level; years, quarters, months; weeks, days…  These additional branches on the ERD create more of a Snowflake shape then Star. 

3. Q: Which is better, Star or Snowflake?
A: Strict data warehousing rules would have you use a Star schema but in reality most designs tend to become Snowflakes. They each have their pros and cons but both are far better then trying to use a transactional system third-normal form design.

4. Q: Why can’t I use a copy of my transactional system for my data warehouse? 
A: This is one of the absolute worst things you can do. A lot of people initially go down this road because a tool vendor will support the idea when making their sales pitch.  Many of these attempts will even experience success for a short period of time.  It’s not until your data sets grow and your business questions begin to be complex that this design mistake will really come out to bite you.

5. Q: What is OLAP?
A: OLAP or Online Analytical Processing is a special breed of software tools designed to report and analyze your data. 

6. Q: What is a cube? 
A: Cubes are proprietary data file structures used to hold the data which is been analyzed. With tools such as Cognos the cubes reside on a special cube server. Business Objects actually builds a local cube structure on the client machine when a report is run.

7. Q Why do some OLAP tools (Cognos, Business Objects) use cubes?
A: The primary advantages offered by cubes are;

    • Cubes make it a lot easier to use a bad data model.  Problems and challenges in your model can be essentially ‘hidden’ and corrected within the code that generates the cube and since tools like Cognos build their cubes on server typically off-business hours the performance issues these data models present can be also be hidden from your users.
    • Server-side cubes provide extremely good report performance. You’ve essentially built all the various report permutations a user might ask for and little to know processing has to take place when a request for one is initiated.
  The disadvantages of a cube are;
    • Server-side cubes (Cognos) add an additional layer of complexity, administration, maintenance and point of failure for your Business Intelligence system.  And because your essentially creating one more redundant place your data must be stored the size of your data-sets is limited.
    • Client-side cubes (Business Objects) severely limit the size of data that can be accessed and analyzed in a single report.  For each report a developer must identify the ‘scope of analysis’ and include the entire data-set within the client-side cube.  This means if a user wants to run a quarterly report and then possibly drill-down into the weeks or even days of detail, an entire quarter of daily level data must be replicated down onto the clients machine into a cube file. 
    • Allows for bad data model design.  This is really as much of a disadvantage as it is an advantage.  Bad data modeling will eventually catch-up to you and create performance problems, analysis limitations and ultimately failure.
8. Q: What does MicroStrategy do instead of using cubes and why is it better?
A: MicroStrategy’s approach called ROLAP (relational online analytical processing) skips the entire cube layer and generates highly optimized and database specific SQL for each user request. This means if a user asks for Q4 2001 sales data the tool will create the SQL and return those requested results and nothing more. If the user then decides to drill-down and investigate a specific week or day of interesting activity the tool will generate the appropriate optimized SQL to satisfy the new request.  There is no need to create and maintain an additional redundant layer of cube data, nor is there any requirement to pre-determine the reports full ‘scope-of-analysis’ and fetch a large amount of useless detail data.