jacktang

目的:监控oracle索引的有效性,看索引有没有被使用。然后根据监控结果删除或者调整索引。

步骤:

1.监控指定索引

   命令: alter index  索引名 monitoring usage;  如:alter index User_IDX1 monitoring usage;

2.查看索引监控是否生效

  命令:select * from V$OBJECT_USAGE t where t.monitoring = \'YES\';

3.执行索引相关SQL

4.查看索引是否被使用

  命令:select * from V$OBJECT_USAGE t where t.monitoring = \'YES\';

5.取消索引监控

  命令: alter index 索引名 nomonitoring usage;  如:alter index User_IDX1 nomonitoring usage;

 

相关工具

  生成指定表所有索引监控命令的SQL:

    select \'alter index \'||index_name||\' monitoring usage;\' from user_indexes where table_name=upper(\'表名\');

    如:select \'alter index \'||index_name||\' monitoring usage;\' from user_indexes where table_name=upper(\'User\');

 

分类:

技术点:

相关文章:

  • 2021-08-26
  • 2021-11-02
  • 2021-08-20
  • 2022-03-15
  • 2022-01-19
  • 2022-01-07
猜你喜欢
  • 2022-01-09
  • 2021-07-03
  • 2021-07-15
  • 2021-06-30
  • 2022-01-31
  • 2021-11-21
  • 2021-10-23
相关资源
相似解决方案