Jag har demonstrerat i steg där en materialiserad vy uppdateras efter varje one minute
,för att ha en mv som uppdateras efter 5 minuter använd next(sysdate+5/1440)
Steg 1:
Create table temp (A int);
Steg 2:
Create Materialized view temp_mv
refresh complete start with (sysdate) next (sysdate+1/1440) with rowid
as select * from temp;
Steg 3:
select count(*) from temp;
COUNT(*)
----------
0
Steg 4:
select count(*) from temp_mv;
COUNT(*)
----------
0
Steg 5:
begin
for i in 1..10 loop
insert into temp values (i+1);
end loop;
end;
/
Steg 6:
commit;
Steg 7:
select count(*) from temp;
COUNT(*)
----------
10
Steg 8:
select count(*) from temp_mv;
COUNT(*)
----------
0
Steg 9:
select to_char(sysdate,'hh:mi') from dual;
TO_CH
-----
04:28
Steg 10:
select to_char(sysdate,'hh:mi') from dual;
TO_CH
-----
04:29
Steg 11:
select count(*) from temp;
COUNT(*)
----------
10
Steg 12:
select count(*) from temp_mv;
COUNT(*)
----------
10