Ukázal jsem na krocích, kdy se materializovaný pohled obnovuje po každé one minute
,pro mv, které se obnoví po 5 minutách, použijte next(sysdate+5/1440)
Krok 1:
Create table temp (A int);
Krok 2:
Create Materialized view temp_mv
refresh complete start with (sysdate) next (sysdate+1/1440) with rowid
as select * from temp;
Krok 3:
select count(*) from temp;
COUNT(*)
----------
0
Krok 4:
select count(*) from temp_mv;
COUNT(*)
----------
0
Krok 5:
begin
for i in 1..10 loop
insert into temp values (i+1);
end loop;
end;
/
Krok 6:
commit;
Krok 7:
select count(*) from temp;
COUNT(*)
----------
10
Krok 8:
select count(*) from temp_mv;
COUNT(*)
----------
0
Krok 9:
select to_char(sysdate,'hh:mi') from dual;
TO_CH
-----
04:28
Krok 10:
select to_char(sysdate,'hh:mi') from dual;
TO_CH
-----
04:29
Krok 11:
select count(*) from temp;
COUNT(*)
----------
10
Krok 12:
select count(*) from temp_mv;
COUNT(*)
----------
10