A Materialized View is effectively a database table that contains the results of a query. The power of materialized views comes from the fact that, once created, Oracle can automatically synchronize a materialized view's data with its source information as required with little or no programming effort.
Materialized views can be used for many purposes, including:
- Data Warehousing
This tutorial explores materialized view basics. After completing it you should have enough information to use materialized views effectively in simple applications. For more complex applications links at the end of the tutorial will point to information on advanced features not covered here, e.g. partitioning, refresh groups, updatable materialized views.
With relational views the FROM clause objects a view is based on are called "base tables". With materialized views, on the other hand, these objects are either called "detail tables" (in data warehousing documentation) or "master tables" (in replication documentation and the Oracle Database SQL Reference guide). Since SQL Snippets is concerned mainly with relational uses of materialized views we will avoid the contradictory terms "master" and "detail" all together and instead use the term "base tables", thus remaining consistent with relational view terminology.
Materialized Views were originally known as "Snapshots" in early releases of Oracle. This keyword is supported for backward compatibility, but should not be used in new code. You may still see this term in some Oracle 11g materialized view error messages.
Depending on your requirements Oracle's Change Data Capture feature may meet your needs better than Materialized Views.