view counter

Materialized View Refresh ON COMMIT

Thanks to Hemant Chitale for this story
view counter
A quick demonstration of a Materialized View that is refreshed ON COMMIT.
SQL> create table source_table
2 as select rownum as source_pk, dbms_random.string('X',15) as col_2, sysdate-1000+rownum as col_3
3 from dual connect by level < 1001
4 /

Table created.

SQL>
SQL> alter table source_table add constraint source_pk primary key (source_pk);

Table altered.

SQL>
SQL> create materialized view my_mv refresh on commit
2 as select source_pk as key_col, col_3 as data_col from source_table
3 /

Materialized view created.

SQL>
SQL> select count(*) from source_table;

COUNT(*)
----------
1000

SQL> select count(*) from my_mv;

COUNT(*)
----------
1000

Read the entire article at its source

view counter