oracle创建索引的语法格式

时间:2023-02-05 21:59:13

CREATE [UNIQUE|BITMAP]  INDEX[schema.] index_name  ---UNIQUE:说明该索引是唯一索引  BITMAP:创建位图索引

ON [schema.] table_name

(column_name[DESC|ASC][, column_name[DESC|ASC]]...) ---DESC|ASC:说明创建的索引

                                                                                                                  为降序或者升序排列的

[REVERSE]                                                                       --REVERSE:说明创建反向键索引

[TABLESPACE  tablespace_name]             ----  TABLESPACE:说明要创建

                                                                                         的索引所存储的表空间

[PCTFREE n]                                     ----PCTFREE:索引块中预留的空间比例         

[INITRANS n]                                     ---INITRANS:每一个索引块中分配的事务数

[MAXTRANS n]                               ---MAXTRANS:每一个索引块中分配的最多事务数

[instorage state]                             --instorage state:说明索引中区段extent如何分配

[LOGGING|NOLOGGING]        ----LOGGING|NOLOGGING:说明要记录(不记录)索引

                                                                    相关的操作,并保存在联机重做日志中

[NOSORT]                ---NOSORT:不需要在创建索引时按键值进行排序