天使羊波波闪耀光芒 软件及互联网爱好者

177月/170

oracle 创建索引 create index online

普通创建索引的命令create index会先锁表,然后再创建索引,如果表中数据量很大,会造成阻塞DML语句。

加了online后,可以以非独占的方式创建和删除索引。

但是加online字段有一些限制:
ONLINE
Specify ONLINE to indicate that DML operations on the table will be allowed during creation of the index.

Restrictions on Online Index Building
Parallel DML is not supported during online index building. If you specify ONLINE and then issue parallel DML statements, Oracle returns an error.
You cannot specify ONLINE for a bitmap index or a cluster index.
You cannot specify ONLINE for a conventional index on a UROWID column.
For a unique index on an index-organized table, the number of index key columns plus the number of primary key columns in the index-organized table cannot exceed 32.

参考资料:
http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_5012.htm