oracle学习小结3之索引

今天归纳索引的常用操作
1) 索引分为B树索引和位图索引
   创建
    create index scott.event_index
  on scott.event(name)
   pctfree 25
storage(initial 500k)
tablespace system;
   如果是位图索引,则create bitmap index .........
2) 查找某个用户的索引的好似用情况,
   select index_name,index_type,tablespace_name,uniqueness,status from dba_indexes where owner='SCOTT';
  查找scott用户基于表和列的信息
    select index_name,table_name,column_name,index_owner,table_owner from dba_ind_columns where table_owner='SCOTT';
3)
重建立和维护索引
   alter index scott.emp_ename_index rebuild
......
  回收索引空间
   alter index scott.emp_ename_idx deallocate unused;
  合拼索引碎片
    alter index scott.emp_ename_idx coalesce;

4) 查看索引使用情况
    alter index emp_ename_idx monitoring usage;
    这里可以打开监督索引的开关
   然后做一些查询后,可以用
    select * from v$object_usage;
 来查看索引使用情况
    再次执行 alter index emp_ename_idx monitoring usage;
则关闭开关.
5) 删除索引
   drop index scott.emp_ename_idx;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值