Oracle指令碼(Oracle Scripts) – 檢視索引訪問次數及索引訪問型別

531968912發表於2016-06-21

該指令碼透過DBA_HIST_SQL_PLAN和DBA_HIST_SQLSTAT檢視檢視資料庫中訪問某個索引的次數以及索引訪問的型別。


[oracle@maa3 ~]$ cat showindex.sql 
column OBJECT_NAME for a30
column OPERATION for a25
column OPTIONS for a25 select d.object_name, d.operation, d.options, count(1) from dba_hist_sql_plan d, dba_hist_sqlstat h where d.object_owner <> 'SYS' and d.operation like '%INDEX%' and d.sql_id = h.sql_id group by d.object_name, d.operation, d.options
order by 1,2,3 /

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25462274/viewspace-2120565/,如需轉載,請註明出處,否則將追究法律責任。

相關文章