Purpose
You can use the ALTER INDEX statement to rename an existing index, modify the degree of parallelism (DOP) of queries on an index, or modify the index storage tablespace.
Required privileges
To execute the ALTER INDEX statement, you must have the ALTER ANY INDEX system privilege. For more information about privileges in OceanBase Database, see Privilege types in Oracle mode.
Syntax
ALTER INDEX [ schema.]index_name
{ RENAME TO new_name
| parallel_option
| TABLESPACE tablespace_name
};
parallel_option:
PARALLEL [COMP_EQ] integer
| NOPARALLEL
Parameters
| Parameter | Description |
|---|---|
| schema. | The schema where the index is located. If schema. is omitted, the index is in your own schema by default. |
| index_name | The name of the index to be modified. |
| new_name | The new name of the index. |
| parallel_option | The DOP of queries on the index.
|
| tablespace_name | The index storage tablespace. |
Examples
The following example renames
index1in the database asindex2.obclient> ALTER INDEX index1 RENAME TO index2;The following example changes the DOP of
index3from 3 to 1.obclient> ALTER INDEX index3 NOPARALLEL;