ORA-20000: index "ZXDBM_890"."IDX_STAT_FACT_ORDER_USERID" or partition of such index is in unusable state
XXX项目是XXX的决策系统,OLAP,传说中的数据仓库,运用了很多oracle高级技术:分区、并行执行等。
粗率分析应该是分区索引失效导致的,由于现网工程还无法联系上,还无法定位。网络上有类似的解决方案,如下
ALTER INDEX "BUSINESS"."IDX_IC_JSDB_PART"
REBUILD
PARTITION "P2010_2"
TABLESPACE "INDEX01"
导致如下错误
Fri Feb 19 22:04:03 2010
Errors in file /u01/oracle/admin/bxrac/bdump/bxrac4_j002_29756.trc:
ORA-20000: index "BUSINESS"."IDX_IC_JSDB_PART" or partition of such index is in unusable state
检查index的状态
SQL> select status from dba_indexes where index_name='IDX_IC_JSDB_PART';
STATUS
------------------------
N/A
手工执行分析脚本;
SQL> exec dbms_stats.gather_table_stats('business','IC_JSDB');
BEGIN dbms_stats.gather_table_stats('business','IC_JSDB'); END;
*
ERROR at line 1:
ORA-20000: index "BUSINESS"."IDX_IC_JSDB_PART" or partition of such index is
in unusable state
ORA-06512: at "SYS.DBMS_STATS", line 13437
ORA-06512: at "SYS.DBMS_STATS", line 13457
ORA-06512: at line 1
解决办法:
重新建立
SQL> alter index IDX_IC_JSDB_PART rebuild online;
Index altered.
测试分析脚本是否可用
SQL> exec dbms_stats.gather_table_stats('business','IC_JSDB');
处理问题参考:
--------------------------------------------------------------------------------------------------------------
ORA-20000 - index "SCOTT"."SSMTEST _U0" or partition of such index is in unusable state. During generating
gather statistics on table.
ORA-20000: index "SCOTT"."SSMTEST_U0" or partition of such
index is in unusable state
ORA-06512: at "SYS.DBMS_STATS", line 13189
ORA-06512: at "SYS.DBMS_STATS", line 13209
ORA-06512: at line 1
The general for this error I came across is having duplicate rows in table.
Use following steps to reslove this error.
1) Find out dpulicate rows from table.
2) drop index
3) delete duplicate rows from table.
4) Re-Create Index.
5) Generate statistic on table.