Oracle 索引学习

创建索引

标准语法

create index 索引名 on 表名(列名) tablespace 表空间名

唯一索引

create unique index 索引名 on 表名(列名) tablespace 表空间名

组合索引

create index 索引名 on 表名(列名1,列名2) tablespace 表空间名

反向键索引

create index 索引名 on 表名(列名) reverse tablespace 表空间名

示例

create index EXP_REPORT_HEADERS_N3 on EXP_REPORT_HEADERS (EXP_REPORT_TYPE_ID);

create unique index EXP_REPORT_HEADERS_U1 on EXP_REPORT_HEADERS (COMPANY_ID, EXP_REPORT_NUMBER);

删除索引

drop index [schema.]indexname

修改索引

重建索引

alter index [schema.]indexname rebuild

联机重建索引

alter index [schema.]indexname rebuild online

合并索引

alter index [schema.]indexname coalesce;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容