Get a list of materialized view log in oracle'

user1860447 picture user1860447 · Nov 19, 2015 · Viewed 18.2k times · Source

I want to get a list of materialized view logs in Oracle. How can I do that? I thought that this will give me a list:

 select * from USER_BASE_TABLE_MVIEWS;

When a materialized view log was dropped and recreated by using the script similar to this :

 CREATE MATERIALIZED VIEW LOG ON "XXX"."STATUSES_AUD"
 PCTFREE 10 PCTUSED 30 INITRANS 1 MAXTRANS 255 LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 ....

It does not show up when this query is run :

select * from USER_BASE_TABLE_MVIEWS;

Any ideas ?

Answer

Justin Cave picture Justin Cave · Nov 19, 2015

Use [dba_|all_|user_]mview_logs. dba_mview_logs will show all the materialized view logs in the database but not everyone will have access to the dba_ views. You probably need create any dictionary. all_mview_logs will show you all the materialized view logs that you have access to. user_mview_logs will show you all the materialized view logs that you own.