How to view the original script of a materialized view? How to view the original script of a materialized view? oracle oracle

How to view the original script of a materialized view?


You can use the function dbms_metadata.get_ddl:

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


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


I ended up running:

select * from all_mviews where mview_name = ‘YOUR_MV_NAME’;