10/2/13

ORA-01502 Oracle

Error Message :

The OCI function OCIStmtExecute returned status 1. Error code: 1502, Error message: ORA-01502: index 'INDEX_NAME' or partition of such index is in unusable state.

You will get above error messages in Datastage job or toad/sql developer when you are trying insert duplicate records into a table.

Solution :

1) check the index status in table by going to Index tab.
2) If it is in "UNUSABLE" state then you need to rebuild the index using below alter statement :

ALTER INDEX INDEX_NAME REBUILD;

Then run your job or insert sql.