ORA-01502 index is in unusable state
SQL> show parameter skip
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
skip_unusable_indexes boolean TRUE
預設情況下skip_unusable_indexes=true
SQL> create table tt (id int,name varchar2(100))
2 ;
Table created.
SQL> create table tt1 (id int,name varchar2(100))
2 ;
Table created.
SQL> create unique index tt_index on tt (id);
Index created.
建立 unique index
SQL> alter table tt add primary key (id) using index;
Table altered.
SQL> create index tt1_index on tt1(id);
Index created.
建立 normal index
SQL> select index_name,status from user_indexes;
INDEX_NAME STATUS
------------------------------ --------
TT1_INDEX VALID
TT_INDEX VALID
期間有向tt,tt1表insert 了一筆資料。
SQL> alter table tt move tablespace test;
Table altered.
SQL> alter table tt1 move tablespace test;
Table altered.
SQL> select index_name,status from user_indexes;
INDEX_NAME STATUS
------------------------------ --------
TT1_INDEX UNUSABLE
TT_INDEX UNUSABLE
SQL> insert into tt values(1,'a');
insert into tt values(1,'a')
*
ERROR at line 1:
ORA-01502: index 'TEST.TT_INDEX' or partition of such index is in unusable
state
unique index出現了此錯誤
SQL> insert into tt1 values(1,'a');
1 row created.
SQL> commit;
normal index沒有出現錯誤
Commit complete.
SQL> select * from tt;
ID NAME
---------- ----------
1 b
SQL> select * from tt1;
ID NAME
---------- ----------
1 b
1 a
SQL> alter index tt1_index rebuild;
Index altered.
SQL> alter index tt_index rebuild;
Index altered.
SQL> select index_name,status from user_indexes;
INDEX_NAME STATUS
------------------------------ --------
TT1_INDEX VALID
TT_INDEX VALID
SQL> insert into tt values(1,'a');
insert into tt values(1,'a')
*
ERROR at line 1:
ORA-00001: unique constraint (TEST.SYS_C003773) violated
如果index為valid的話,insert相同的資料,會報ora-00001的錯誤。
當把index變為unusable,truncate table之後,index會變為valid
SQL> alter index tt_index unusable;
Index altered.
SQL> select index_name,status from user_indexes;
INDEX_NAME STATUS
------------------------------ --------
TT1_INDEX VALID
TT_INDEX UNUSABLE
SQL> truncate table tt;
Table truncated.
SQL> select index_name,status from user_indexes;
INDEX_NAME STATUS
------------------------------ --------
TT1_INDEX VALID
TT_INDEX VALID
[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1059226/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-01502 index state unusable錯誤成因和解決方法Index
- ORA-01502 state unusable錯誤成因和解決方法
- ORA-20000: index "xxxx" or partition of such index is in unusable stateIndex
- oracle index unusableOracleIndex
- skip_unusable_index parameterIndex
- oracle invisible index與unusable index的區別OracleIndex
- unusable index對DML/QUERY的影響Index
- 【INDEX】索引失效或者不可用 UNUSABLEIndex索引
- ORA-20000:index is in unusableIndex
- Some indexes or index partitions of table have been marked unusableIndex
- 10g可以通過命令使index unusable!Index
- alter index unusable無法起作用的情況Index
- alter index unusable 無法起作用的情況 ztIndex
- ORA-01502: index 'SYS.WRH$_ROWCACHE_SUMMARY_PK'Index
- skip_unusable_indexesIndex
- SKIP_UNUSABLE_INDEXES InitializationIndex
- NBU detected IBM drives as unusableIBM
- ORA-01502錯誤成因和解決方法
- Vuex之stateVue
- Working with State
- KEEP INDEX | DROP INDEXIndex
- ReactState(狀態):React通過this.state來訪問state,通過this.setState()方法來更新stateReact
- ddl 導致分割槽表全域性索引unusable索引
- 元件、Prop 和 State元件
- react 之 state 物件React物件
- 狀態模式(State)模式
- State Server 設定Server
- mysql show processlist stateMySql
- Monitoring WebSite StateWeb
- Simple state transition 3
- demoValue: state => state.demoValue是什麼語法呢?
- rowid,index,INDEX FULL SCAN,INDEX FAST FULL SCAN|IndexAST
- 引數SKIP_UNUSABLE_INDEXES的一點測試!Index
- INDEX UNIQUE SCAN,INDEX FULL SCAN和INDEX FAST FULL SCANIndexAST
- Clustered Index Scan and Clustered Index SeekIndex
- oracle hint之full,index,index_asc,index_desc,index_combile示例OracleIndex
- [譯] 元件、Prop 和 State元件
- DRIVER_POWER_STATE_FAILUREAI