"ORA-01502: 索引''或这类索引的分区处于不可用状态"

在做项目时,通过程序向数据库中添加一条记录,但是报出如下错误:

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [72000]; error code [1502];   

--- The error occurred in com/persistence/dao/ibatis/wa/T_JBXX_SqlMap.xml.  

--- The error occurred while applying a parameter map.  

--- Check the T_JBXX.insert-InlineParameterMap.  

--- Check the statement (update failed).  

--- Cause: java.sql.SQLException: ORA-01502: 索引 'DB.T_JBXX_PRIMARYKEY' 或这类索引的分区处于不可用状态

;

通过一条语句查询数据库:

select index_name,status from t_user_indexes where Status='UNUSABLE'

 查询出当前的那个索引不可用,原来是因为索引不可用所以才导致插入数据时报错。后来重新在对的表空间建立索引就ok了。

猜你喜欢

转载自lilixu.iteye.com/blog/2084678