Top wait events--突出的等待事件等等
SQL order by--主要 SQL 资源占用
3)告警日志
Alert log 文件和 Trace files 文件
4)Enterprise Manager Pages--OEM
5)诊断包和调优包
二、DB Time model
1、什么是 DB Time model
"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 is measured cumulatively from the time that the instance was started."
数据库消耗的总时间包括 DB time+background elapsed time
DB time 反应的是所有 user 使用的数据库资源的总和, 即:DB time=DB CPU+ DB Wait time(no-idle time)。
background elapsed time 指数据库后台进程消耗的时间,比如 PMON 进程本身,或 RMAN 备份恢复。
idle time 比如处于连接状态的空闲 session 不包括在 DB Wait time。
在一个正常的系统中一般来说 DB time 要远远大于 background elapsed time。
2、调优时,很重要的是把 DB Wait time(不包括 idle wait)和 DB CPU time 对比,看看谁占的比例大,这决定了多少时间是花
在有用的工作上,多少时间消耗在等待其他进程释放占用的资源。作为一般规则,调整 DB Wait time 比调整 DB CPU time 更为
迫切,然而,较高的 CPU time 也可能表明 SQL 本身写的很差。
而 Wait time 的急剧增加又可能反映了一个资源争用的迹象。
注意,资源争用通过增加更多的处理器,或集群节点,其作用往往是非常有限的,有时甚至可能适得其反。
在 DB time 的统计信息中,sql execute elapsed time 和 parse time elapsed 以及 DB CPU,这三项常常会占据 90%以上的 DB time,
而其中 sql execute elapsed time 又应该会在 95%以上,值得注意的是 DB CPU 和 sql execute elapsed time 是有交集的,因此你会
看到在一份 AWR 报告中有出现 DB CPU + sql execute elapsed time 超过 DB time 的情况。
评论