oracle索引操作

imOne發表於2018-01-31
select * from all_indexes where table_name='表名' and owner='使用者名稱';  --查詢某使用者下某張表的所有索引   

create index 索引名 on 表名 (欄位名) --建立索引

CREATE INDEX 索引名 ON 表名 (欄位名) NOLOGGING PARALLEL 4; --建立索引(不列印日誌,並行改為4。適用與同時建立大量索引) alter index 舊索引名 rename to 新索引名; --修改索引名稱 ALTER INDEX 索引名 COALESCE; --合併索引 ALTER INDEX 索引名 REBUILD; --重建索引 DROP INDEX 索引名; --刪索引 --查詢表註釋 select * from user_tab_comments where table_name='表名'; --user_tab_comments:table_name,table_type,comments --相應的還有dba_tab_comments,all_tab_comments,這兩個比user_tab_comments多了ower列。 --獲取欄位註釋: select * from user_col_comments where table_name='表名'; --user_col_comments:table_name,column_name,comments --查詢表約束 select constraint_name from dba_constraints where table_name='表名'

 

相關文章