Home >Database >Oracle >How to close index in oracle

How to close index in oracle

WBOY
WBOYOriginal
2022-06-13 14:58:304957browse

In Oracle, you can use the "alter index" statement to close the index. This statement can change the status of the index. The syntax is "alter index index_name unusable;"; this statement means to disable the specified index, and unusable means the current index. The status is invalid.

How to close index in oracle

The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.

oracle closes the index

Disable the index

ORACLE makes the index unavailable

The syntax is as follows:

alter index index_name unusable;

After successful execution, if the index needs to be used again, it must be rebuilt. It will automatically become usable after reconstruction.

Examples are as follows:

How to close index in oracle

The index status is as follows:

  • valid: The current index is valid

  • N/A : The partition index is valid

  • unusable: The index is invalid

Extended knowledge:

--Restore index

ALTER INDEX UK_T_AUTH_USER_EMP_CODE REBUILD;

--View index status

select status  from user_indexes where index_name=‘UK_T_AUTH_USER_EMP_CODE‘;

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to close index in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn