Get VIEW ddl using query

后端 未结 2 1126
挽巷
挽巷 2021-01-02 10:39

For database re-architecture I need to get DDL of each table and view in the database(Oracle). I don\'t want to go to property of each table/view and get SQL out of it in SQ

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-02 10:58

    For materialized views use:

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

    See all supported object types here: DBMS_METADATA: Object Types

提交回复
热议问题