The Information Source model for IFS Business Reporting & Analysis describes a star schema model consisting of Facts (transactions) and Dimensions (basic data). If an Information Source is supposed to support a Data Mart solution, then the necessary storage containers, representing the Facts and the Dimensions, have to be created in the Data Mart.
This section deals with the case when the Data Mart implementation is based on Materialized Views. Data Mart access can also be implemented as ordinary tables based on the Incremental Load framework. For more information, please refer to Incremental Load of Information Sources.
Some words about the Data Mart:
A Materialized View is an Oracle feature that means creating a snapshot table.
This since the collection of data is made through definition of several Materialized Views and the information in these Materialized Views is joined together in one way or another to create the final Dimension and Fact definition.
- Data can be collected in different ways but always according to the needs of the dimensions and facts to be created. This might lead to restructuring of existing data, but without modifying existing core tables.
- The Materialized Views contain calculated/evaluated data which means that during retrieval of information the calculations are made, thus enhancing the performance when querying the data.
- Since Materialized Views are tables it is possible to create indexes that are customer/installation specific without having to change indexes in core
tables. The latter is always risky business since a rather big analysis has to be done each time a core table is modified with respect to indexes.
- Since Materialized Views are snapshot tables this actually means that it will be possible to freeze the information in the Data Mart, leading to consistent analysis handling. It will be up to the administrator of an installation to define the refresh method for the Materialized Views.
- The Materialized Views can be created with grouped data, also leading to better performance when retrieving information.
- It might be the case that it is not necessary to transfer all data to from the source tables/views to the target Materialized View, meaning that the transaction volume can be reduced,
The above picture shows the basic principle for defining of a Materialized View:
Note: Function calls should be avoided as much as possible since the thay may affect performance in a nagative way.
- UNUSABLE
The Materialized View is empty and must first be activated, i.e. creating the first snapshot.- STALE
The Materialized View is not up-to-date and must be refreshed to be up-to-date.- UNKNOWN
The Materialized View contains non-deterministic functions and the state is unknown. It does not matter if the Materialized View is refreshed, it will still be considered as being in an unknown state.
More information can be found in the documentation about Materialized View Management.- FRESH
The Materialized View is up-to-date.
A typical definition of a Materialized View looks as follows:
CREATE MATERIALIZED VIEW &MV TABLESPACE &IFSAPP_DATA BUILD DEFERRED USING NO INDEX REFRESH COMPLETE ON DEMAND AS SELECT <columns> FROM <table(s)> WHERE <conditions>
When a Materialized View is created a refresh option is specified. The general options are:
The REFRESH FAST options means incremental update of the Materialized View.
The REFRESH COMPLETE options means that the Materialized View is completely
recreated from the current state of the involved source tables.
It is possible to define that the refresh should be performed on COMMIT, i.e. as soon as changes in the involved source tables are made permanent or on DEMAND, i.e. either manually ordered or according to a scheduled task.
IFS only supports completely refreshable
Materialized Views. Even if Oracle support refresh on COMMIT this option should
NEVER BE USED.
This means that refresh of a MV is defined as:
REFRESH COMPLETE ON DEMAND
It is up to the administrator to define how often Materialized Views should be refreshed and this is preferable done by scheduling of a refresh category.
There are different build options available when creating a Materialized View.
IFS recommends using the option BUILD DEFERRED, which means that the
Materialized View is
defined in the Oracle dictionary when installed/deployed BUT it will be created
empty.
The first snapshot is created by activating the Materialized View.
There are several areas to consider when creating a Materialized View.
- Key columns
- Parent columns/values
- Unique identities
- Dimension identities
- Information to be published, single columns as well as columns needed for function calls.
- Consistency aspects; adding columns that initially are there only to be consistent with the Online views, since Data Mart and Online support means one Star Schema model but different sources (Materialized Views, views).
- Information that is dependent of the time of execution, the current user, language etc should never be calculated and stored in a Materialized View. This has to be done at a later stage; when retrieving the data from the Materialized View.
- Function calls can affect the refresh performance. It is important to find out how the refresh is affected by added functions if a lot of data is processed and if the refresh time is believed to be acceptable in a real customer scenario.