当前位置:操作系统 > Unix/Linux >>

不用index monitor usage获得索引使用情况的脚本

不用index monitor usage获得索引使用情况的脚本
 
[sql] 
col c1 heading 'Object|Name' format a30  
col c2 heading 'Operation' format a15  
col c3 heading 'Option' format a15  
col c4 heading 'Index|Usage|Count' format 999,999  
break on c1 skip 2  
break on c2 skip 2  
  
select p.object_name c1, p.operation c2, p.options c3,count(1) c4  
from dba_hist_sql_plan p, dba_hist_sqlstat s  
where p.object_owner <> 'SYS'  
and p.operation like '%INDEX%'  
and p.sql_id = s.sql_id  
group by p.object_name,p.operation, p.options order by 1,2,3;  

 


CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,