转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 数据库 >> Sql Server >> 正文
V$system_event中Wait事件的一段话和resources_wait.sql         

V$system_event中Wait事件的一段话和resources_wait.sql

作者:闵涛 文章来源:闵涛的学习笔记 点击数:1065 更新时间:2007/11/14 12:53:50
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













[ORACLE]Oracle9i中一个特殊等待事件--null event  [Sql Server]V$system_event中Wait事件的一段话和resources_wa…
[求职简历]英文简历(人力资源总监)DIRECTOR OF HUMAN RESO…  
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Sql Server  · MySql
    · Access  · ORACLE
    · SyBase  · 其他
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台