ORA-01502: index ‘xxx‘ or partition of such index is in unusable state

在用imp导入dmp文件时候报错:

imp 用户名/密码@orcl file=/home/dmp/xxxxx.dmp full=y ignore=y
IMP-00058: ORACLE error 1502 encountered
ORA-01502: index 'XXXXXX' or partition of such index is in unusable state
Import terminated successfully with warnings.

查找出失效索引,然后重建

SELECT 'alter index ' ||INDEX_NAME || ' REBUILD;' INDEX_NAME,
INDEX_TYPE,
TABLESPACE_NAME,
TABLE_TYPE,
STATUS
FROM DBA_INDEXES
WHERE STATUS = 'UNUSABLE'

再次imp导入成功

你可能感兴趣的:(数据库,oracle)