Search notes:

Oracle: Materialized views

A materialized view stores the result of a select statement.
There are three options that specify how the result of the select statement is refreshed:
Default
Refresh Mode on commit, on demand or on statement on demand
Refresh Option complete, fast, force or never force
Trust constraints trusted constraints or enforced constraints enforced

Master tables

The tables, views and materialized view that provide the data for a materialized view (that is: the objects that the materialized view selects from) are referred to as master tables (sometimes also as detail tables).

Relation to snapshots

Materialized views were previously referred to as snapshots. Therefore, for backward compatibility, it is possible to use the term snapshot instead of materialized view.
The apparent package name dbms_mview is in fact a synonym for dbms_snapshot.

Materialized View Logs

Used for fast refreshable materialized views

In order for a materialized view to be fast refreshable, materialized log views are typically required (exceptions being «partition change tracking» (PCT) refresh).
When using materialized view logs for fast refershing materialized views, they should include the rowid clause.
If they're used for aggregate materialized views, they must also include every column that is referenced in the materialized view.

Requirements / MOS note 101705.1

MOS note 101705.1 lists a few requirements/restrictions for ON COMMIT and fast refresh materialized views
ON COMMIT:
Fast refresh:
Further stipulations for fast refreshability seem to be:
In addition, nested materialized views must have a join or aggregate function.

See also

The init parameters query_rewrite_enabled and query_rewrite_integrity.
DBA_MVIEWS lists all materialized views in a database.
DBA_BASE_TABLE_MVIEWS lists magterialized views with logs.
Errors that occur when materialized views are automatically refreshed are recored in the alert log.
The rewrite hint
dbms_advisor.tune_mview optimizes materialized view creation statements to achieve refresh fast and enable query rewrite goals
Prebuilt tables
fast refresh
The query rewriting query transformation
Compare with the materialize hint.
The error messages

Index