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很多,说明数据库出现了显而易见的性能问题

因为等待时间过多。

 参考: http://blog.csdn.net/robinson1988/article/details/6077944
 

What is DB time in AWR?的更多相关文章

  1. ocp 1Z0-042 121-178题解析

    121. You want to create a new optimized database for your transactional production environment to be ...

  2. ocp 1Z0-043 61-130题解析

    61. You are working in an online transaction processing (OLTP) environment. You realize that the sal ...

  3. [转帖]AWR报告参数:DB TIME和DB CPU

    AWR报告参数:DB TIME和DB CPU http://blog.itpub.net/12679300/viewspace-1182396/ 一.前言:AWR报告是了解ORACLE运行的一个重要报 ...

  4. Oracle AWR报告提取方法

    本文旨在用来指导项目人员自行提取Oracle数据库的AWR报告. 1.当前连接实例的AWR报告提取:@?/rdbms/admin/awrrpt 2.RAC的其他实例AWR报告提取:@?/rdbms/a ...

  5. ORACLE AWR结合ASH诊断分析enq: TX - row lock contention

    公司用户反馈一系统在14:00~15:00(2016-08-16)这个时间段反应比较慢,于是生成了这个时间段的AWR报告, 如上所示,通过Elapsed Time和DB Time对比分析,可以看出在这 ...

  6. oracle rac自动生成awr

    cat awr.sql ######EXEC P_AWR_REPORT('201604251000', '201604251100', 'D_OUTPUT', '', FALSE); FALSE为ra ...

  7. Oracle的AWR报告分析

    * 定义:awr报告是oracle 10g下提供的一种性能收集和分析工具,它能提供一个时间段内整个系统资源使用情况的报告,通过这个报告,我们就可以了解一个系统的整个运行情况,这就像一个人全面的体检报告 ...

  8. ORACLE AWR报告数据的导入导出实践

    关于AWR的快照数据可以导出.导入,一直没有亲手实践过.今天动手测试了一下如何导出.导入AWR数据,将AWR的数据从一测试服务器,导入到另外一台测试服务器. SQL> @?/rdbms/admi ...

  9. ORACLE AWR报告生成过程出现多个实例记录分析

    在一次生成AWR报告中,发现在"Instances in this Workload Repository schema"部分,出现了多个实例记录信息(host敏感信息被用host ...

随机推荐

  1. poj1679次小生成树入门题

    次小生成树求法:例如求最小生成树用到了 1.2.4这三条边,总共5条边,那循环3次的时候,每次分别不用1.2.4求得最小生成树的MST,最小的MST即为次小生成树 如下代码maxx即求最小生成树时求得 ...

  2. 13.LockSupport工具

    1. LockSupport简介 在之前介绍AQS的底层实现,已经在介绍java中的Lock时,比如ReentrantLock,ReentReadWriteLocks,已经在介绍线程间等待/通知机制使 ...

  3. Highcharts 基本条形图;Highcharts 堆叠条形图;Highcharts 反向条形图

    Highcharts 基本条形图 配置 chart 配置 设置 chart 的 type 属性 为 bar ,chart.type 描述了图表类型.默认值为 "line". var ...

  4. [转载]java实现word转pdf

    最近遇到一个项目需要把word 转成pdf,百度了一下网上的方案有很多,比如虚拟打印.给word 装扩展插件等,这些方案都依赖于ms word 程序,在java代码中也得使用诸如jacob或jcom这 ...

  5. [sqlite] 数据库遇到的问题 “该字符串未被识别为有效的 DateTime”

    异常详细信息: System.FormatException: 该字符串未被识别为有效的 DateTime. 解决方案: 在日期保存到Sqlite数据库时转换一个类型,比如:string _now = ...

  6. Python基础学习----元组

    # 元组和列表的区别: # 相同点: # 1.表示多个元素的序列 # 2.数据之间用 , 分开 # 3.索引都是[0]开始 # # 不同点: # 1.列表创建是[],元组是()表示 # 2.元组元素一 ...

  7. C++面向对象高级编程(三)基础篇

    技术在于交流.沟通,转载请注明出处并保持作品的完整性. 概要 一.拷贝构造 二.拷贝赋值 三.重写操作符 四.生命周期 本节主要介绍 Big Three 即析构函数,拷贝构造函数,赋值拷贝函数,前面主 ...

  8. 字符串-----KMP竟然是18禁

    今天学了一下午字符串,讲到结束也没讲KMP.有人问老师为什么不讲,老师来一句:字符串noip不考,而且还是18禁,自然不讲.[手动滑稽] 所以我也不讲.[微笑] 1.表达式树 表示3+5*8 最后计算 ...

  9. 在servlet中的中文乱码,相对路径和绝对路径

    默认情况下在servlet中的中文是显示不出来的,解决问题就是加resp.setContentType("text/html;charset=gbk"); 而且这句加的话必须写在P ...

  10. TF随笔-10

    #!/usr/bin/env python# -*- coding: utf-8 -*-import tensorflow as tf x = tf.constant(2)y = tf.constan ...