博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle怎样查询索引的使用情况
阅读量:7032 次
发布时间:2019-06-28

本文共 1119 字,大约阅读时间需要 3 分钟。

查询用户的索引

select index_name,table_name,tablespace_name,
index_type,uniqueness , status
from dba_indexes where owner='SCOTT';
查询用户的索引列
select index_name,table_name,column_name,
index_owner,table_owner
from dba_ind_columns
where table_owner='SCOTT';
查看索引的各种初始化因子
select index_name,table_name,tablespace_name,
pct_free,pct_increase,initial_extent,
next_extent, status
from dba_indexes where owner='SCOTT';

重建和维护索引

alter index scott.emp_ename_idx rebuild

pctfree 40
storage (next 300k);

查看索引segment

select segment_name,segment_type,tablespace_name,extents
from dba_segments
where owner='SCOTT'
and segment_type='INDEX';

给索引添加相应的extent

alter index scott.emp_ename_idx allocate extent;

回收索引端

alter index scott.emp_ename_idx deallocate unused;
合并索引碎片
alter index scott.emp_ename_idx coalesce;

联机重建索引:

alter index scott.emp_ename_idx rebuild online;

标识索引的使用情况

1.启用索引监控
alter index emp_ename_idx monitoring usage;
2.执行相关查询
select ename,job ,sal from scott.emp
where ename like 'C%';
3.查看索引是否使用
select * from v$object_usage;
4.禁用索引监控
alter index emp_ename_idx nomonitoring usage;

转载于:https://www.cnblogs.com/Look_Sun/p/4434765.html

你可能感兴趣的文章
解决SSH会话连接超时
查看>>
运维监控工具之 Nagios (一)
查看>>
JQuery自定义插件开发(二)
查看>>
select函数
查看>>
理解二叉搜索树
查看>>
Centos 配置iptables防火墙
查看>>
多态在 Java 和 C++ 编程语言中的实现比较
查看>>
数字签名
查看>>
在Linux 双机下自己手动实现浮动ip技术
查看>>
Spring 和 Hibernate 遇到问题
查看>>
一个页面的倒计时代码
查看>>
Node.js笔记(一)项目的建立
查看>>
PullToRefreshScrollView 滑动监听 actionbar渐变
查看>>
nginx错误解决方法个人总结
查看>>
利用Solid Converter PDF与Office优化处理文档信息
查看>>
spring boot 1.3.5 PUT方法接收参数
查看>>
Java 并发之 CountDownLatch、CyclicBarrier 和 Semaphore
查看>>
./ source 以及 exec的区别
查看>>
vsftpd虚拟配置增加用户脚本
查看>>
linux下安装DNS服务器
查看>>