grant query rewrite to <user_creating_mv>
alter session set query_rewrite_enabled =true;
alter session set query_rewrite_integrity=enforced;
Say your base table is table_a with a primary key.
You create a materialized view log on table_a
create materialized view log on table_a;
Now to create a materialized view that will refresh when ever the table is changed
you execute the following statement
CREATE MATERIALIZED VIEW MY_MATERIALIZED_VIEW
REFRESH ON COMMIT
ENABLE QUERY REWRITE
SELECT <what ever you want to select>
FROM <the single base table?
GROUP BY <IF APPLICABLE>