How to view the source script of a materialized view?

I am interested in moving a materialized view from one db to another, regardless of whether I also need to change one of the columns. How to view the source script that MV creates? I am running TOAD but cannot find the original script.

Thanks in advance!

+4
source share
4 answers

You can use the dbms_metadata.get_ddl function:

 select dbms_metadata.get_ddl('MATERIALIZED_VIEW', 'MVIEW_NAME') from dual; 
+11
source
 select query from user_mviews where mview_name = 'your materialized view'; 
+4
source

I have finished work:

 select * from all_mviews where mview_name = 'YOUR_MV_NAME'; 
+2
source

If you are using Oracle SQL Developer , you just need to go to the "view" or "materialized view" node of the navigation tree

0
source

Source: https://habr.com/ru/post/1487808/


All Articles