One of the most useful replication and data warehousing features in Oracle is materialized views. The data in a materialized view is updated by either a complete or incremental refresh. An incremental or fast refresh uses a log table to keep track of changes on the master table.
Create a Materialized View:
---------------------------
CREATE MATERIALIZED VIEW "SCHEMA_NAME"."MV_NAME" ("Column_1", "Column_2", "Column_3", "Column_4", "Column_5", "Column_6") ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING TABLESPACE "USERS" BUILD IMMEDIATE USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT sysdate+2/24 USING DEFAULT LOCAL ROLLBACK SEGMENT USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE
AS
SELECT Column_1 ,
Column_2 ,
Column_3 ,
Column_4 ,
Column_5 ,
Column_6
FROM Table_name
Query Metadata for MV's:
------------------------
SELECT mview_name, refresh_mode, refresh_method,
last_refresh_type, last_refresh_date
FROM user_mviews;
More Information: http://www.dba-oracle.com/t_materialized_view_fast_refresh_performance.htm
No comments:
Post a Comment