You may see the error
ORA-23401: materialized view OWNER.MVIEW does not existwhen you execute a procedure like:
Clearly there can be a variety of reasons, with the most trivial one being that you mistyped the materialized view name. Please note that if the object was created with a case sensitive name, you must take care of writing the name using the proper casing:
Suppose that you create a materialized view with a name like this:
create materialized view "Ugly_Name"If you execute:
refresh complete on demand
select * from dual;
beginbacause you need to surround the name with double quotes:
ORA-23401: materialized view "USER"."UGLY_NAME" does not exist
beginNote that if you are trying to do this on a materialized view residing in a different schema, you may get ORA-23401 if you omit entirely or use an improper letter casing for the schema name:
beginor even if the user name is case sensitive and you mistype it...
dbms_mview.refresh('OTHER_USER."Ugly_Name"','C'); -- it should be "Other_User"
beginBut, this is not enough, in order to succeed you must hold the ALTER ANY MATERIALIZED VIEW system privilege, otherwise you'll get ORA-01031 eventually.
dbms_mview.refresh('"Other_user"."Ugly_Name"','C'); -- it should be "Other_User"
See message translations for ORA-23401 and search additional resources