当前位置:Gxlcms > 数据库问题 > oracle中重建索引

oracle中重建索引

时间:2021-07-01 10:21:17 帮助过:8人阅读

  
  
    数据库的索引如果有比较频繁的 Delete 操作, 将可能导致索引产生很多碎片,
所以,在有的时候,需要对所有的索引重新 REBUILD,以便合并索引块,减少碎
片,提高查询速度。
SQL> set heading off
SQL> set feedback off
SQL> spool d:index.sql
SQL> SELECT ‘alter index ‘ || index_name || ‘ rebuild ‘
||‘tablespace INDEXES storage(initial 256K next 256K pctincrease 0);‘
FROM all_indexes
WHERE ( tablespace_name != ‘INDEXES‘
OR next_extent != ( 256 * 1024 )
)
AND owner = USER
SQL>spool off


本文出自 “elanjie” 博客,请务必保留此出处http://elanjie.blog.51cto.com/11847332/1912364

oracle中重建索引

标签:oracle中重建索引

人气教程排行