Purpose
You can use the AlTER INDEX statement to rename an existing index, modify the degree of parallelism (DOP) of queries on the 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
Assume that there is an index named
index1in the database. The following example shows how to rename it toindex2:obclient> ALTER INDEX index1 RENAME TO index2;Assume that there is an index named
index3in the database with a DOP of 3 for queries. The following example shows how to modify the DOP to 1:obclient> ALTER INDEX index3 NOPARALLEL;