Home  >  Article  >  Database  >  查询每秒平均事务数

查询每秒平均事务数

WBOY
WBOYOriginal
2016-06-07 15:59:521817browse

1.直接查询视图 select * from DBA_HIST_SYSMETRIC_SUMMARY where metric_unit = Transactions Per Second METRIC_NAME 监控指标 METRIC_UNIT 监控单位 INTSIZE 采样长度(厘秒),一般是360000 NUM_INTERVAL 观察间隔(分钟),一般是60 AVERAGE 监控时间段内的

1.直接查询视图 select * from DBA_HIST_SYSMETRIC_SUMMARY where metric_unit = 'Transactions Per Second'

METRIC_NAME 监控指标 METRIC_UNIT 监控单位 INTSIZE 采样长度(厘秒),一般是360000 NUM_INTERVAL 观察间隔(分钟),一般是60 AVERAGE 监控时间段内的平均值

--查询一段时间内的平均每秒事务数 select instance_number, metric_unit, trunc(begin_time) time, round(avg(average), 2) average from DBA_HIST_SYSMETRIC_SUMMARY where metric_unit = 'Transactions Per Second' and begin_time >= to_date('2014-08-04 08:00:00', 'yyyy-mm-dd hh24:mi:ss') and end_time

查询一段时间内的平均每天事务数,只要将平均每秒事务数*60^60*24即可。

2.查询AWR报告也可以。

3.--下面脚本,分别在两个时间点执行,相减可以得到某个用户commit的次数,即事务数 select s.USERNAME,sum(se.VALUE) "session transaction number",sum(sy.VALUE) " database transaction number" from v$session s,v$sesstat se,v$sysstat sy where s.sid=se.SID and se.STATISTIC#=sy.STATISTIC# and sy.NAME='user commits' and s.USERNAME=upper('&username') group by s.USERNAME;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn