oracle索引的创建与删除,学习笔记:Oracle索引管理 DBA常用创建、删除、管理各种index索引命令汇总...

天萃荷净

汇总运维DBA日常工作对普通index索引以及唯一index索引的管理命令,创建、更改、删除普通index索引以及唯一index索引案例

--查看用户对象

SELECT OBJECT_NAME,OBJECT_TYPE FROM USER_OBJECTS;

--创建普通索引(指定pctfree,表空间,nologging模式)

create index fei_idx3 on fei(pwd,name) pctfree 20 tablespace users nologging;

--创建唯一索引

create unique index fei_idx1 on fei(id) pctfree 20 tablespace users nologging;

--创建bitmap index

create bitmap index fei_idx1 on fei(id) pctfree 20 tablespace users nologging;

--修改索引空间大小(增大)

alter index fei_idx1 allocate extent(size 2000k

datafile 'C:\oracle\product\10.2.0\oradata\orcl\users01.dbf');

--释放索引未空间

alter index fei_idx1 deallocate unused;

--rebuild索引(在线索引重建)

alter index fei_idx1 rebuild online;

--删除索引

drop index fei_idx1;

--coalescing 索引(索引融合 相当于windows的磁盘整理功能)

alter index fei_idx1 coalesce;

--对索引分析(判断该索引是否要rebuild,主要参数是lf_rows,del_lf_rows的比例)

analyze index fei_idx1 validate structure offline;

select * from index_stats;

--监控索引使用情况

alter index fei_idx1 monitoring usage;--开启监控

select * from v$object_usage;--监控的结果

alter index fei_idx1 nomonitoring usage;--关闭监控

--查看执行计划

set autot on exp;--开启

set autot off;--关闭

--相关视图查询

select * from dba_ind_columns WHERE INDEX_OWNER='CHF';

select * from dba_indexes where owner='CHF';

SELECT * FROM DBA_IND_STATISTICS WHERE owner='CHF';

--------------------------------------ORACLE-DBA----------------------------------------

最权威、专业的Oracle案例资源汇总之学习笔记:Oracle索引管理 DBA常用创建、删除、管理各种index索引命令汇总

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值