I have been trying to understand Materialized Views concept from a long time but was unable to get the exact functioning of it except that it is a physical table(replica) for the tables in different server.
I have tried the following
CREATE MATERIALIZED VIEW TEMP_MV
BUILD DEFERRED
REFRESH COMPLETE
ON DEMAND
AS
SELECT C1,C2,C3 FROM TAB;
Here i have used BUILD DEFERRED
so that i will get only the structure of the base table
later i can get the records using REFRESH but how do i perform REFRESH
I have even tried BUILD IMMEDIATE
so that it will show the records but then if i have inserted new records in base table i cannot get those new records in MV.
CREATE MATERIALIZED VIEW TEMP_MV
BUILD IMMEDIATE
REFRESH COMPLETE
ON DEMAND
FOR UPDATE
AS
SELECT C1,C2,C3 FROM TAB;
I am using ORACLE 10G. Please help me in understanding MV better .
Thanks