Sql Developer导出DDL脚本

1.导出索引脚本

SELECT    DBMS_METADATA.GET_DDL('INDEX', index_name) FROM USER_INDEXES 

2.导出表脚本

SELECT    DBMS_METADATA.GET_DDL('TABLE', table_name) FROM USER_TABLES

3.导出

SELECT    DBMS_METADATA.GET_DDL(VIEW, view_name) || ';' FROM USER_VIEWS

 4.导出存储过程,包,函数

select case
         when line = 1 then
          'CREATE OR REPLACE  ' || text
         else
          text
       end
  from user_source
 where type = 'PROCEDURE' and name in ('ACS004_A','ACS_CANCELEDWAYBILL') ;
 

 

select DISTINCT NAME from user_source where type = 'PROCEDURE'
select * from user_source where type = 'PACKAGE';
select * from user_source where type = 'FUNCTION';
select * from user_source where type = 'TYPE';

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17066567/viewspace-631793/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/17066567/viewspace-631793/

你可能感兴趣的:(Sql Developer导出DDL脚本)