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.
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
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:
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!