查询某个用户下的所有索引创建语句
SQL> select 'select dbms_metadata.get_ddl('||chr(39)||object_type||chr(39)||','||chr(39)||object_name||chr(39)||','||chr(39)||owner||chr(39)||') from dual;' from dba_objects where object_type='INDEX' and owner='DBMON'; 'SELECTDBMS_METADATA.GET_DDL('||CHR(39)||OBJECT_TYPE||CHR(39)||','||CHR(39)||OBJECT_NAME||CHR(39)||','||CHR(39)||OWNER||CHR(39)||')FROMDUAL;' -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- select dbms_metadata.get_ddl('INDEX','SYS_IL0000088465C00026$$','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','STAT_EMP_TEXT','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','T_ID','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','IDX_ID','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','T4_PRI_NAME_UQ','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','T5_ID','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','SYS_IL0000088808C00002$$','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','T1_1','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','T2_1','DBMON') from dual; select dbms_metadata.get_ddl('INDEX','T2_2','DBMON') from dual;