oracle v$system_event,v$session_event , v$system_event , v$session_wait

v$session_event , v$session_wait

(1)-V$SESSION_WAIT

这是一个寻找性能瓶颈的关键视图。它提供了任何情况下session在数据库中当前正在等待什么(如果session当前什么也没在做,则显示它最后的等待事件)。当系统存在性能问题时,本视图可以做为一个起点指明探寻问题的方向。

V$SESSION_WAIT中,每一个连接到实例的session都对应一条记录。

v$system_event :

v$system_event shows the total number of waits and timeouts, and the total

waiting time recorded for each type of event, accumulated for all processes over

the life of the instance. it is normal to order the events waited for in descending

order of the total time waited, as an indicator of the potential severity of each

type of wait.

however, the total time waited is really only meaningful for those that indicate

waiting for resources. if processes have been waiting because they have no work

to do, then the time waited is immaterial. if they have been waiting for routine

operations, such as disk i/o, then the total time waited will depend on the

workload. in such cases, the average time waited is much more interesting than

the total time waited.

this classification of wait types into idle waits, routine waits, and resource waits

is vital to a correct understanding of the wait statistics. accordingly, apt has

separate scripts for resource waits and routine waits, and ignores idle waits

altogether. the routine_waits.sql script shows only the average time waited for

each type of routine wait. the resource_waits.sql script (see example 2.1) shows

the types of resources waited for in descending order of the total time waited, but

also shows the average time waited.

resources_wait.sql:-------------------------------------------------------------------------------

--

-- script:resource_waits.sql

-- purpose:to show the total waiting time for resource types

--

-- copyright:(c) 1998 ixora pty ltd

-- author:steve adams

--

-------------------------------------------------------------------------------

@reset_sqlplus

column average_wait format 9999990.00

select

substr(e.event, 1, 40) event,

e.time_waited,

e.time_waited / (

e.total_waits - decode(e.event, 'latch free', 0, e.total_timeouts)

) average_wait

from

sys.v_$system_event e,

sys.v_$instance i

where

e.event = 'buffer busy waits' or

e.event = 'enqueue' or

e.event = 'free buffer waits' or

e.event = 'global cache freelist wait' or

e.event = 'latch free' or

e.event = 'log buffer space' or

e.event = 'parallel query qref latch' or

e.event = 'pipe put' or

e.event = 'write complete waits' or

e.event like 'library cache%' or

e.event like 'log file switch%' or

( e.event = 'row cache lock' and

i.parallel = 'no'

)

union all

select

'non-routine log file syncs',

round(e.average_wait * greatest(e.total_waits - s.value, 0)),

e.average_wait

from

sys.v_$system_event e,

sys.v_$sysstat s

where

e.event = 'log file sync' and

s.name = 'user commits'

order by

2 desc

/

@reset_sqlplus

其中和reset_sqlplus是:

-------------------------------------------------------------------------------

--

-- script:reset_sqlplus.sql

-- purpose:to reset sqlplus settings

--

-- copyright:(c) 1998 ixora pty ltd

-- author:steve adams

--

-------------------------------------------------------------------------------

clear breaks

clear columns

clear computes

set feedback off

set verify off资料来源:oracle8i internal services[@more@]v

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值