为了更有效的保留Session信息,Oracle10g新增加了一个v$session_wait_history视图该视图用以记录活动Session的最近10次等待事件。
目的:不要死记硬背script,深入理解view的含义,,才能自如运用它们。
包括:v$system_event/ v$session_event/ v$session_wait / v$waitstat
#17389
V$SYSTEM_EVENT(统计)
自从instance启动以后,所有产生的(若没有等待则不显示)等待事件event 总的等待wait的统计信息。
SQL> desc v$system_event
Name
------------------------
EVENT
TOTAL_WAITS --总等待次数
TOTAL_TIMEOUTS --等待超时次数
TIME_WAITED --总的等待时间,单位是百分之一秒 (最重要考虑)
AVERAGE_WAIT -- 平均等待时间,总的等待时间/总等待次数
TIME_WAITED_MICRO --总的等待时间的微秒形式 1/1000000
常见的等待现象:
latch free
enqueue
free buffer waits
buffer busy waits: 查看V$WAITSTAT
db file sequential read
db file scattered read
Script:
select * from
(select EVENT, TOTAL_WAITS ,TOTAL_TIMEOUTS ,TIME_WAITED , AVERAGE_WAIT
from v$system_event order by TIME_WAITED desc )
where rownum
发现瓶颈
1.Statspack lists idle events at the end.
2.Examine the time spent waiting for different events.
3.Examine the average time for each wait also, because some waits (like log file switch completion) might happen only periodically, but cause a big performance hit when they happen.
V$SESSION_EVENT (统计)
字段比V$SYSTEM_EVENT多一个sid, 提供各个session 所有等待过事件的统计信息。而当前等待的信息在v$session_wait中
安全锁锁芯类网站模板(响应式)是一个响应式优雅大气的集团企业网站模板,自带内核安装即用,响应式模板,图片文本均已可视化,简单后台易上手。支持多种内容模型,可按需添加。模板特点: 1、安装即用,自带人人站CMS内核及企业站展示功能(产品,新闻,案例展示等),并可根据需要增加表单 搜索等功能(自带模板) 2、支持响应式 3、前端banner轮播图文本均已进行可视化配置 4、伪静态页面生成 5、支持内容
0
V$SESSION_WAIT (当前)
系统当前的每个活动session ( v$session )当前正在等待什么(如果现在没有等待任何资源,在显示最后一次等待的情况)
• SID: session id
• EVENT: Event the session is currently waiting for, or the last event the session had to wait for
• WAIT_TIME: Time (in hundredths of a second) that the session waited for the event; if the WAIT_TIME is 0, then the session is currently waiting for the event
• SEQ#: Gets incremented with every wait of the session
• P1, P2, P3: Wait event specific details for the wait
• P1TEXT, P2TEXT, P3TEXT: Description of P1,P2,P3 for the given event
WAIT_TIME Meaning Waiting
>0 Time waited in the last wait (in 10 ms clock ticks) No
0 Session is currently waiting for this event Yes
-1 Time waited in the last wait was less than 10 ms No
-2 Timing is not enabled No
Script:
select * from
(select sid, event ,p1,p2,p3 ,WAIT_TIME, SECONDS_IN_WAIT
from v$session_wait
where SID = &THE_SID
order by wait_time desc )
where rownum

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号