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

查询软解析,硬解析百分比

时间:2017-11-02 18:09:08      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:statistic   总数   success   nbsp   where   --   div   lap   c#   

--查询Oracle数据库的软解析硬解析视图
SQL> select * from v$sysstat where name like ‘%parse%‘;
STATISTIC# NAME                                CLASS      VALUE    STAT_ID
---------- ------------------------------ ---------- ---------- ----------
       264 ADG parselock X get attempts            1          0  564381705
       265 ADG parselock X get successes           1          0 3808229129
       622 parse time cpu                         64        229  206905303
       623 parse time elapsed                     64       1376 1431595225
       624 parse count (total)                    64       8758   63887964
       625 parse count (hard)                     64       1457  143509059
       626 parse count (failures)                 64          7 1118776443
       627 parse count (describe)                 64         12  469016317
 
parse count hard 解析统计硬解析
parse count total 解析总数,包括硬解析、软解析
parse time cou  总CPU解析时间,单位10Ms,包括硬解析软解析
parse time elapsed完成解析调用总时间;
 
--查询,硬解析百分比:
select substr(a.value/b.value,1,4)*100||‘%‘ as "hard%" from (select value,class from v$sysstat where name like ‘%parse count (hard)%‘) a,(select value,class from v$sysstat where name like ‘%parse count (total)%‘) b where a.class=b.class;
 
--查询软解析百分比:
select substr((b.value-a.value)/b.value,1,4)*100||‘%‘ as "soft%" from (select value,class from v$sysstat where name like ‘%parse count (hard)%‘) a,(select value,class from v$sysstat where name like ‘%parse count (total)%‘) b where a.class=b.class;
 
--软解析:
with t as (select * from v$sysstat where name=‘parse count (total)‘),h as (select * from v$sysstat where name=‘parse count (hard)‘) select substr((t.value-h.value)/t.value,1,4)*100||‘%‘ as "soft%" from t,h;

查询软解析,硬解析百分比

标签:statistic   总数   success   nbsp   where   --   div   lap   c#   

原文地址:http://www.cnblogs.com/lvcha001/p/7773230.html

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