DB time、DB CPU

V$SYS_TIME_MODEL
V$SESS_TIME_MODEL

DB Time

Amount of elapsed time (in microseconds) spent performing Database user-level calls. This does not include the elapsed time spent on instance background processes such as PMON.

所有 foreground session 花费在 database 调用上的总和时间

包括 CPU时间( DB CPU)、IO Time、和其他一系列非空闲等待时间,别忘了cpu on queue time

公式:DB TIME= DB CPU + Non-Idle Wait + Wait on CPU queue

DB CPU

Amount of CPU time (in microseconds) spent on database user-level calls. This does not include the CPU time spent on instance background processes such as PMON.

数据库在运行时消耗的CPU的情况,不包含数据库进程在等待CPU的时间。

1) background elapsed time
    2) background cpu time
          3) RMAN cpu time (backup/restore)
1) DB time
    2) DB CPU
    2) connection management call elapsed time
    2) sequence load elapsed time
    2) sql execute elapsed time
    2) parse time elapsed
          3) hard parse elapsed time
                4) hard parse (sharing criteria) elapsed time
                    5) hard parse (bind mismatch) elapsed time
          3) failed parse elapsed time
                4) failed parse (out of shared memory) elapsed time
    2) PL/SQL execution elapsed time
    2) inbound PL/SQL rpc elapsed time
    2) PL/SQL compilation elapsed time
    2) Java execution elapsed time
    2) repeated bind elapsed time
    

如果 DB Time 和 DB CPU 相差不大,说明等待事件较少或不太严重,或者SQL执行较慢。
如果 DB Time 远远大于 DB CPU,通常情况下表明等待比较严重,即使SQL执行很快,但是大部分处于等待状态。

参考:
https://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_3088.htm#REFRN30346
https://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_3015.htm#REFRN30340

发布了710 篇原创文章 · 获赞 70 · 访问量 49万+

猜你喜欢

转载自blog.csdn.net/ctypyb2002/article/details/103804969
DB