Create index with asynchronous population in Oracle

时间:2016-03-02 10:50:13

标签: java oracle indexing

My Java web-app that launches serveral sql scripts on startup, one of those scripts is a simple index creation on a foreign key.

CREATE INDEX "IDX_NAME" on "TABLE" ("IDFK") TABLESPACE "MYTBS"

Unfortunately my table has several million rows and the index creation holds the web-app in startup for a few hours (3 in this case).

Is there a way to create the index and populate it asynchronously?

1 个答案:

答案 0 :(得分:1)

use online feature:

CREATE INDEX "IDX_NAME" on "TABLE" ("IDFK") TABLESPACE "MYTBS" online;