注册
监控二级索引
专栏/Database Thinking/ 文章详情 /

监控二级索引

胡li 2026/03/25 378 1 0
摘要 1.MONITORING USAGE 对指定索引进行监控; 2.NOMONITORING USAGE 对指定索引取消监控。索引监控(MONITORING USAGE)仅支持对用户创建的二级索引进行监控,且不支持监控虚索引、系统索引、聚集索引、数组索引; 3.相关监控信息可查看动态视图V$OBJECT_USAGE;

1、创建数据,模拟场景

create table test_pln(c1 int PRIMARY key ,c2 int ,c3 varchar(100));

create index ix_test_pln_001 on test_pln(c2);

insert into test_pln select level,level,'aaaaa' from dual CONNECT by level<=300;

insert into test_pln select level+300,99999,'aaaaa' from dual CONNECT by level<=100000;
commit;

2、添加索引监控

alter index ix_test_pln_001 monitoring usage;   --监控索引是否使用

备注:开启后,使用一段时间再去查看索引使用情况

3、执行SQL,使用索引

select * from test_pln where c2=1

4、查看索引使用情况

select * from SYS."V$OBJECT_USAGE" ;

image.png

5、取消索引监控

alter index ix_test_pln_001 nomonitoring usage; 
评论
后发表回复

作者

文章

阅读量

获赞

扫一扫
联系客服