在现有表Oracle上创建索引

问题描述:

在oracle的现有表上创建索引是否安全?

Is it safe to create an index on an existing table in oracle?

像这样:

CREATE INDEX table_sample_ix03
      ON table_sample
(
  col4,
  col22
)
TABLESPACE data
STORAGE
(
  INITIAL        10M    NEXT          2M
  MINEXTENTS      1     MAXEXTENTS  100
  PCTINCREASE     0
)
;


在创建索引时建议使用ONLINE子句正在桌面上运行DML查询。请参见 http://docs.oracle.com/cd/B19306_01/ server.102 / b14200 / statements_5010.htm

The ONLINE clause is recommended when you create the index while DML queries are being run on the table. See http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_5010.htm

示例:

CREATE  INDEX "MYINDEX" ON "MYTABLE" ("MYCOLUMN")  ONLINE;