In the Oracle database server use, another user (called MIMIC2DEVEL) created a materialized view and made it public. How to view the original script that was used to built it?

Here are the grants on the materialized view:

enter image description here

I am aware of How to view the original script of a materialized view? but the two solutions proposed there do not seem to work for materialized views that was created by another user.

I use Oracle SQL Developer and the database server runs:

enter image description here

1 Answer 1


Specify the owner in GET_DDL, or use ALL_MVIEWS instead of USER_MVIEWS:

select dbms_metadata.get_ddl('MATERIALIZED_VIEW', 'MVIEW_NAME', 'OWNER') from dual;

select query from all_mviews
  where mview_name = 'your materialized view';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.