alter session set skip_unusable_indexes=true
1.
alter session set skip_unusable_indexes=true;
2. 请问如何恢复unusable的索引
2.1
SQL> create table test as select * from all_objects;
Table created.
SQL> create index t_owner_ind on test(owner);
Index created.
SQL> alter index t_owner_ind unusable;
Index altered.
SQL> drop index t_owner_ind;
Index dropped.
SQL>
2.2
SQL> create table test as select * from sys.dba_objects;
Table created.
SQL> alter table test add constraint unique_id unique(object_id);
Table altered.
SQL> select index_name from user_indexes where lowercase(table_name)='test';
select index_name from user_indexes where lowercase(table_name)='test'
*
ERROR at line 1:
ORA-00904: "LOWERCASE": invalid identifier
SQL> select index_name from user_indexes where lower(table_name)='test';
INDEX_NAME
------------------------------
UNIQUE_ID
SQL> select segment_name from user_segments;
SEGMENT_NAME
--------------------------------------------------------------------------------
UNIQUE_ID
TEST_CON
TEST
SALGRADE
BONUS
PK_EMP
EMP
PK_DEPT
DEPT
9 rows selected.
SQL> alter table test drop constraint unique_id;
Table altered.
SQL> select index_name from user_indexes where lower(table_name)='test';
no rows selected
SQL> select segment_name from user_segments;
SEGMENT_NAME
--------------------------------------------------------------------------------
TEST_CON
TEST
SALGRADE
BONUS
PK_EMP
EMP
PK_DEPT
DEPT
8 rows selected.
SQL>
不存在unique_id segment.
3. skip_unusable_indexes使用的几点补充- -4. ORA-01502 state unusable错误成因和解决方法(二)
5. SKIP_UNUSABLE_INDEXES的使用与索引实效解决方法
本文出自 51CTO.COM技术博客 |


liwei1
博客统计信息
热门文章
最新评论
友情链接