檢視錶、檢視、索引、儲存過程和觸發器的定義的方法

還不算暈發表於2013-10-27
檢視錶的定義:
      set long 999999
      select dbms_metadata.get_ddl('TABLE',upper('&table_name') from dual ;
檢視檢視的定義:
     select text from user_views where view_name=upper('&view_name') ;
檢視index的定義:

      select dbms_metadata.get_ddl('INDEX',upper('&index_name') from dual ;

select index_name,index_type,table_owner,table_name from user_indexes where table_name='TEMP3';

select index_owner,index_name,table_owner,table_name,column_name from all_ind_columns where index_owner='BYS';

檢視procedure的定義:
      select text from user_source where name='&PROCEDURE_NAME' ;
檢視trigger的定義:
      select trigger_body from user_triggers where trigger_name='&trigger_name' ;

相關文章