什么是 db time
AWR中有 DB time这个术语,那么什么是DB time呢?
Oracle10gR2 官方文档 给出了详细解释(Oracle10gPerformance Tuning Guide 5.1.1.2 Time Model Statistics)
The most important of the time model statistics is DB time. This statistics represents the total time spent in
database calls and is a indicator of the total instance workload. It is calculated by aggregating the CPU and
wait times of all sessions not waiting on idle wait events (non-idle user sessions).
根据官方文档的解释,DB time=DB CPU+ DB waiting time(no-idle time)
那么下面我挑一个session来验证一下
SQL> select sid,stat_id,stat_name,value/1000000/60 from V$sess_TIME_MODEL where sid=194;
SID STAT_ID STAT_NAME VALUE/1000000/60
---------- ---------- -------------------------------------------------- ----------------
194 3649082374 DB time 33.5681982
194 2748282437 DB CPU 32.9633455
194 4157170894 background elapsed time 0
194 2451517896 background cpu time 0
194 4127043053 sequence load elapsed time 0
194 1431595225 parse time elapsed .0005325
194 372226525 hard parse elapsed time .000498433
194 2821698184 sql execute elapsed time 33.5674656
194 1990024365 connection management call elapsed time .000047933
194 1824284809 failed parse elapsed time 0
194 4125607023 failed parse (out of shared memory) elapsed time 0
194 3138706091 hard parse (sharing criteria) elapsed time 0
194 268357648 hard parse (bind mismatch) elapsed time 0
194 2643905994 PL/SQL execution elapsed time .0000051
194 290749718 inbound PL/SQL rpc elapsed time 0
194 1311180441 PL/SQL compilation elapsed time 0
194 751169994 Java execution elapsed time 0
194 1159091985 repeated bind elapsed time .0000001
194 2411117902 RMAN cpu time (backup/restore) 0
19 rows selected.
Elapsed: 00:00:01.61
SQL> select (sysdate-logon_time)*24*60 minutes, username,machine,sid,serial#,event,p1,p2,p3
2 from v$session where sid=194;
MINUTES USERNAME MACHINE SID SERIAL# EVENT P1 P2 P3
---------- -------------------- -------------------- ---------- ---------- -------------------- ---------- ---------- ----------
34.4833333 WHSUSRGL NA/BDC-KALIDO001 194 28391 direct path read tem 202 89709 1
p
Elapsed: 00:00:01.15
Session 194连接到数据库已经34.4833333分钟,DB time=33.5681982 , CPU time=32.9633455
现在来查询一下ASH,我们知道ASH是每隔1秒钟采样一次
SQL> select count(*)
2 from v$active_session_history ash, v$event_name enm
3 where ash.event#=enm.event#
4 and SESSION_ID=194;
COUNT(*)
----------
47
那么194这个session大概等待了47秒,也就是等待了大约。78333333分钟
SQL> select 47/60 from dual;
47/60
----------
.783333333
SQL> select 32.9633455+.783333333 from dual;
32.9633455+.783333333
---------------------
33.7466788
DB CPU + 等待时间=33.7466788 ,而 DB time=33.5681982 他们相差不大,基本上可以说明
DB time=DB CPU+ DB waiting time(no-idle time)
注意:AWR中的DB time等于所有session DB time之和(除去后台进程)
SQL> select SESSION_ID,NAME,P1,P2,P3
2 from v$active_session_history ash, v$event_name enm
3 where ash.event#=enm.event#
4 and SESSION_ID=194;
SESSION_ID NAME P1 P2 P3
---------- ----------------------------------- ---------- ---------- ----------
194 db file sequential read 202 106634 1
194 db file sequential read 202 53541 1
194 db file sequential read 202 204387 1
194 db file sequential read 202 242316 1
194 db file sequential read 202 251848 1
194 db file sequential read 202 201689 1
194 db file scattered read 45 480505 16
194 db file scattered read 44 169145 16
194 db file scattered read 45 32489 16
194 db file scattered read 44 316585 16
194 db file scattered read 46 255817 16
194 db file scattered read 47 204105 16
194 db file scattered read 44 236633 16
194 db file scattered read 46 222761 16
194 db file scattered read 44 232969 16
194 db file scattered read 44 230489 16
194 db file scattered read 44 227673 16
194 db file scattered read 45 177785 16
194 db file scattered read 44 292121 16
194 db file scattered read 45 136041 16
194 db file scattered read 28 17177 16
194 db file scattered read 47 233513 16
194 db file scattered read 44 222233 16
194 db file scattered read 46 211289 16
194 db file scattered read 47 152889 16
194 db file scattered read 45 164921 16
194 db file scattered read 47 149609 16
194 db file scattered read 44 312873 16
194 db file scattered read 45 157289 16
194 db file scattered read 45 155225 16
194 db file sequential read 50 30400 1
194 db file sequential read 43 8763 1
194 db file scattered read 36 518441 16
194 db file scattered read 37 504992 4
194 db file scattered read 38 195257 16
194 db file scattered read 37 209776 9
194 db file scattered read 41 119561 16
194 db file scattered read 39 62041 16
194 db file scattered read 41 4765 2
194 db file scattered read 38 438857 16
194 read by other session 38 335097 1
194 latch: cache buffers chains 1.3835E+19 122 0
194 db file sequential read 27 52122 1
194 db file sequential read 41 140105 1
194 read by other session 36 97230 1
194 db file scattered read 38 17369 16
194 db file sequential read 37 1889 1
47 rows selected.
看AWR的时候,可以拿DB time和采样时间间隔做比较,如果DB time高出采样时间间隔很多,说明数据库负载很大
同样,可以拿DB time和DB CPU比较,如果 DB time高出DB CPU很多,说明数据库出现了显而易见的性能问题
因为等待时间过多。
什么是 db time的更多相关文章
- Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级
Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...
- VS15 preview 5打开文件夹自动生成slnx.VC.db SQLite库疑惑?求解答
用VS15 preview 5打开文件夹(详情查看博客http://www.cnblogs.com/zsy/p/5962242.html中配置),文件夹下多一个slnx.VC.db文件,如下图: 本文 ...
- ODBC、OLE DB、 ADO的区别
转自:http://blog.csdn.net/yinjingjing198808/article/details/7665577 一.ODBC ODBC的由来 1992年Microsoft和Syba ...
- Linux平台 Oracle 11gR2 RAC安装Part3:DB安装
四.DB(Database)安装 4.1 解压DB的安装包 4.2 DB软件安装 4.3 ASMCA创建磁盘组 4.4 DBCA建库 4.5 验证crsctl的状态 Linux平台 Oracle 11 ...
- SSRS ----环境配置,没有 ReportServer DB 怎么办?
今天项目进入报表开发阶段,按照习惯,打开报表管理器,发现提示下面的错误: 错误:报表服务器无法打开与报表服务器数据库的连接.所有请求和处理都要求与数据库建立连接. 这是怎么回事儿呢,经过排查,发现数据 ...
- mongo DB for C#
(1)Download the MongoDB C#驱动. http://www.nuget.org/packages/mongocsharpdriver/. (2) Add Reference to ...
- jBPM4.4 no jBPM DB schema: no JBPM4_EXECUTION table. Run the create.jbpm.schema target first in the install tool.
jBPM4.4 no jBPM DB schema: no JBPM4_EXECUTION table. Run the create.jbpm.schema target first in the ...
- oracle db link的查看创建与删除
1.查看dblink select owner,object_name from dba_objects where object_type='DATABASE LINK'; 或者 select * ...
- Gc.Db之循序渐进
距离上次写Gc.Db框架已经有一段时间了,最近默默对框架代码已经做了不少优化和功能,且已经提交至nuget,大家如果想使用此框架,可以通过nuget搜索:Gc.Db进行下载和安装包. 本篇文章主要是介 ...
- oracle Entity db.Database.SqlQuery ORA-01843: 无效的月份
原因是oracle的日期格式化格式和本地语言环境的日期格式不一致导致的. 一般情景为oralce格式为英文格式 本地服务器或者开发机的环境为中文环境. 使用Dbcontext 实例一般不会有问题. 但 ...
随机推荐
- win7 64 + Ubuntu 14.04.1 64双系统安装,详解UEFI ~ GPT和legacy ~ MBR区别
win7 64 + Ubuntu 14.04.1 64双系统安装 背景:我的笔记本之前的系统是window 7 64 + Ubuntu 14.04.1,用UEFI引导系统.安装过程是先装的win7,再 ...
- C#DataGridView 美化
private void dataGridView(DataGridView dataGridView) { System.Windows.Forms.DataGridViewCellStyle da ...
- hdu 1536 S-Nim
题意:首先输入K 表示一个集合的大小 之后输入集合 表示对于这对石子只能去除这个集合中的元素的 个数 之后输入一个m表示接下来对于这个集合要进行m次询问 之后m行 每行输入一个n 表示有 n个堆 ...
- Sqoop详细介绍包括:sqoop命令,原理,流程
一简介 Sqoop是一个用来将Hadoop和关系型数据库中的数据相互转移的工具,可以将一个关系型数据库(例如 : MySQL ,Oracle ,Postgres等)中的数据导进到Hadoop的HDFS ...
- IntelliJ IDEA:Getting Started with Spring MVC, Hibernate and JSON实践
原文:IntelliJ IDEA:Getting Started with Spring MVC, Hibernate and JSON实践 最近把编辑器换成IntelliJ IDEA,主要是Ecli ...
- DB2行转列、列转行等操作
DB2 行转列 ----start 在网上看到这样一个问题:(问题地址:http://www.mydb2.cn/bbs/read.php?tid=1297&page=e&#a) 班级 ...
- CentOS系统启动过程1-10 详细叙述
昨日有个前辈问我,liunx系统是如果启动的,我只是说了个大概,但具体的过程没有理解透彻,今天特意在网上找到下面的流程图,并根据图,进行了详细叙述,如有问题,请指出. 启动第一步--加载BIOS 设 ...
- chrome开发配置(三)安装开发工具
1.安装 VisualStudio2010,设置环境变量 GYP_MSVS_VERSION=2010 2.安装 VisualStudio2010 SP1 3.安装 windows 8.0 sdk(不要 ...
- struts使用html:file上传文件的时候文件名乱码解决
<body> <html:form action="/jwid/struts1x/15.3/form/upload.do?action=upload" encty ...
- [JWFD开源工作流]JWFD开源工作流官方下载内容更新
在更新版的JWFD二次开发包中,我正在实现单线程的时钟控制器,动了下引擎的源代码,这个更新包主要是升级界面,内核代码,大家就不用升级了.. 代码提示: 请修改代码包中(org.jwfd.workflo ...