码迷,mamicode.com
首页 > 其他好文 > 详细

一个11G 抓没有绑定变量的语句.非常好!非常精确,非常快.

时间:2015-06-11 16:53:37      阅读:117      评论:0      收藏:0      [点我收藏+]

标签:

--追踪共享池没有绑定变量的SQL
SELECT FORCE_MATCHING_SIGNATURE,to_char(FORCE_MATCHING_SIGNATURE ) as sing,
       COUNT(1) AS REPLACE_NUM,
       ROUND(SUM(SHARABLE_MEM) / 1024 / 1024) AS SHARED_MB,
       ROUND(SUM(PERSISTENT_MEM) / 1024 / 1024) AS SHARED_MB,
       ROUND(SUM(RUNTIME_MEM) / 1024 / 1024) AS SHARED_MB,
       ROUND(SUM(CPU_TIME) / SUM(EXECUTIONS) / 1000, 3) AS CPU_TIME_AS_HAO,
       ROUND(SUM(ELAPSED_TIME) / SUM(EXECUTIONS) / 1000, 3) AS ELAPSED_TIME_AS_HAO
  FROM V$SQL
 WHERE FORCE_MATCHING_SIGNATURE > 0
   AND EXECUTIONS > 0
   AND FORCE_MATCHING_SIGNATURE != EXACT_MATCHING_SIGNATURE
 GROUP BY FORCE_MATCHING_SIGNATURE
HAVING COUNT(1) > 1
 ORDER BY 2 DESC;




 SELECT X.*
  FROM V$SQL X
 WHERE FORCE_MATCHING_SIGNATURE IN (‘&FORCE_MATCHING_SIGNATURE‘) ;

一个11G 抓没有绑定变量的语句.非常好!非常精确,非常快.

标签:

原文地址:http://blog.csdn.net/zengmuansha/article/details/46458813

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!