I got ” ORA-01502 index or partition of such index is in unusable state ” error in Oracle database.
ORA-01502 index or partition of such index is in usable state
Details of error are as follows.
ORA-01502: index "string.string" or partition of such index is in unusable state Cause: An attempt has been made to access an index or index partition that has been marked unusable by a direct load or by a DDL operation Action: DROP the specified index, or REBUILD the specified index, or REBUILD the unusable index partition
The ORA-01438 error is related with the unusable state of Index.
If the related index(es) are unusable, then you can drop these indexes as follows.
You can drop the unusable index as follows.
DROP INDEX SCHEMA_NAME.INDEX_NAME;
To solve The ORA-01502 error, You should rebuild index as follows.
ALTER INDEX SCHEMA_NAME.INDEX_NAME REBUILD;
If you want to rebuild all unusable indexes, you can use the following script.
SELECT 'ALTER INDEX '||OWNER||'.'||INDEX_NAME||' REBUILD;' FROM DBA_INDEXES WHERE STATUS = 'UNUSABLE';
Do you want to learn Oracle SQL, then read the following articles.
4,084 views last month, 1 views today