ITPub博客

首页 > 数据库 > Oracle > Oracle维护索引、表

Oracle维护索引、表

原创 Oracle 作者:wzgchen 时间:2016-04-05 09:22:26 0 删除 编辑
 Oracle维护索引


1.重建索引


alter index index_name1 rebuild;


2.重建索引并转移到别的表空间


alter index index_name1 rebuild tablespace other_tablespace;  --这个表空间要首先创建


3.修改索引的一些参数设置


alter index index_name rebuild pctfree 30 storage(next 100k);


4.自动为索引分配空间


alter index index_name allocate extent;


5.整合索引碎片


alter index index_name coalesce;


6.删除一个索引


drop index index_name;


7.开启对索引的监控,然后分析索引


--首先开启对索引的监控


alter index index_name  monitoring usage;


--然后执行一个与索引有关的查询


--接着关闭对索引的监控


alter index index_name  nomonitoring usage;


--然后查询v$object_usage视图


select index_name,start_monitoring,end_monitoring
from  v$object_usage
where index_name = '........'

修改分区表的pctfree:
 alter TABLE ORDER_PAR   pctfree 30;
 SELECT a.table_name,a.partition_name,ini_trans,a.pct_free,a.ini_trans FROM user_tab_partitions a where table_name = 'ORDER_PAR';


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/91975/viewspace-2075290/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-05-01

  • 博文量
    383
  • 访问量
    213569