1. run the querry to generate SQL TO make index unusable
select 'alter index ' || owner|| '.' || index_name || ' unusabble;'
from all_indexes
where owner= 'DBMON'
and table_name=upper('pt')
;
'ALTERINDEX'||OWNER||'.'||INDEX_NAME||'UNUSABBLE;'
--------------------------------------------------------------------------------
alter index DBMON.IDX_PT_3 unusabble;
2. run the sql
alter index DBMON.IDX_PT_3 unusabble;
3. run your insert, update, delete statement
if your insert, update, delete statement fail.
run "alter session set skip_unusable_indexes = true;"
4. run the querry to generate SQL TO make index rebuild
select 'alter index ' || owner|| '.' || index_name || ' rebuild;'
from all_indexes
where owner= 'DBMON'
and table_name=upper('pt')
;
'ALTERINDEX'||OWNER||'.'||INDEX_NAME||'REBUILD;'
--------------------------------------------------------------------------------
alter index DBMON.IDX_PT_3 rebuild;
5. run the reduild sql
alter index DBMON.IDX_PT_3 rebuild;
this will make your insert, update, delete statement fast.
No comments:
Post a Comment