There're two schema in db, I create a materialized view -- 'MV1' and grant it successfully,selecting from it in other schema is ok.
GRANT select ON schemaA.MV_CA_REVENU_MS_GEO TO read;
/
GRANT select ON schemaA.MV_CA_REVENU_MS_GEO TO write;
/
GRANT update ON schemaA.MV_CA_REVENU_MS_GEO TO write;
/
But while compiling the procedure, there's error message says 'table or view does not exist' for 'MV1'. The procedure code is:
create or replace
PROCEDURE SP_NAME (args ... ) is
.
.
begin
INSERT INTO tableName(
.
.
) SELECT ...
FROM (SELECT ...
FROM MV1 -- **schemaA.MV1 doesn't work either**
WHERE
end SP_NAME;
/
GRANT EXECUTE ON schemaB.SP_NAME TO read;
GRANT DEBUG ON schemaB.SP_NAME TO read;
GRANT EXECUTE ON schemaB.SP_NAME TO write;
GRANT DEBUG ON schemaB.SP_NAME TO write;
/
CREATE or replace PUBLIC SYNONYM SP_NAME FOR schemaB.SP_NAME;
/
I try to add schemaA in front of MV1, it doesn't work. Is there any other step should I take a check?