read by other session 等待事件。
今天是2014-01-06,从今天开始,打算春节之前每天学习一个等待事件,今天就记录一下read by other session这个等待事件笔记。
什么是read by other session?
This wait event occurs when we are trying to access a buffer in the buffer cache but we find that the buffer is currently being read from disk by another user so we need to wait for that to complete before we can access it. In previous versions, this wait was classified under the "buffer busy waits" event. However, in Oracle 10.1 and higher, the wait time is now broken out into the "read by other session" wait event.
Excessive waits for this event are typically due to several processes repeatedly reading the same blocks, e.g. many sessions scanning the same index or performing full table scans on the same table. Tuning this issue is a matter of finding and eliminating this contention.
参考文档:文档 ID 732891.1
官方介绍:
read by other session
This event occurs when a session requests a buffer that is currently being read into the buffer cache by another session. Prior to release 10.1, waits for this event were grouped with the other reasons for waiting for buffers under the 'buffer busy wait' event
Wait Time: Time waited for the buffer to be read by the other session (in microseconds)
Parameter Description
file# See "file#"
block# See "block#"
class# See "class"
注意有p1,p2,p3,。
当出现该问题如何解决?
一般出现该问题是由于sql导致的,或者是由于磁盘设备可能导致。
当出现该问题的时候,首先需要定位sql。
方法一:通过ash获得细粒度的报告,查看top sql statement 获得sql。
方法二:通过sql语句直接获得:
1、当前正在发生的问题:
select sql_fulltext from v$sql a,v$session b where a.sql_id=b.sql_id and b.event='read by other session';
2、历史曾经发生的
select a.sql_id,sql_fulltext from v$sql a,dba_hist_active_sess_history b where a.sql_id=b.sql_id and b.event='read by other session';
往往read by other session伴随着db file sequential read事件的出现。
另外可以查看涉及对象信息,此处就是p1,p2,p3
SELECT p1 "file#", p2 "block#", p3 "class#"
FROM v$session_wait WHERE event = 'read by other session';
通过p1,p2,p3获得热点对象:
SELECT relative_fno, owner, segment_name, segment_type FROM dba_extents
WHERE file_id = &file
AND &block BETWEEN block_id AND block_id + blocks - 1;
另外,也可以 直接查看热点块的信息,如查看热点块导致的sql语句:
select sql_text
from v$sqltext a,
(select distinct a.owner, a.segment_name, a.segment_type
from dba_extents a,
(select dbarfil, dbablk
from (select dbarfil, dbablk from x$bh order by tch desc)
where rownum < 11) b
where a.RELATIVE_FNO = b.dbarfil
and a.BLOCK_ID <= b.dbablk
and a.block_id + a.blocks > b.dbablk) b
where a.sql_text like '%' || b.segment_name || '%'
and b.segment_type = 'TABLE'
order by a.hash_value, a.address, a.piece;
查看热点块对象:
SELECT E.OWNER, E.SEGMENT_NAME, E.SEGMENT_TYPE
FROM DBA_EXTENTS E,
(SELECT *
FROM (SELECT ADDR, TS#, FILE#, DBARFIL, DBABLK, TCH
FROM X$BH
ORDER BY TCH DESC)
WHERE ROWNUM < 11) B
WHERE E.RELATIVE_FNO = B.DBARFIL
AND E.BLOCK_ID <= B.DBABLK
AND E.BLOCK_ID + E.BLOCKS > B.DBABLK;
找到sql之后需要做的就是查看执行计划,判断问题所在,并进行优化。
1、对于在shared pool存在的cursor可以通过如下命令查看执行计划
select * from table(dbms_xplan.display_cursor('sql_id',null,'allstats'));
2、对于历史可以通过查看awr信息获得:
select * from table(dbms_xplan.display_awr('sql_id'));
另外对于设备引起的需要查看磁盘读写信息,可以 通过vmstat 2 200进行判断。
Reducing Number of Waits:
- If you are seeing long delays taken to service this wait event then check the amount of I/O being performed on the device identified by the P1 argument of this wait event.
The device and / or the controller may be overloaded. If this is the case then take the standard steps of spreading the file across further devices etc. - Check that the real problem isn't the amount of time that the operating system is taking to service the system call.
- Find out which file numbers are causing the highest average waits and then determine which filesystem contains the file
- Determine why the filesystems are performing poorly. Some common causes are:
- "hot filesystems" - too many active files on the same filesystem exhausting the I/O bandwidth
- hardware problem
- In Parallel Execution (PX) is being used, determine if the I/O subsystem is saturated by having too many slaves in use.
文档 ID 1477229.1
read by other session 等待事件。的更多相关文章
- ORACLE等待事件:read by other session
read by other session简介 官方关于read by other session的介绍如下: When information is requested from the datab ...
- 【Oracle】等待事件之 V$SESSION_WAIT
(1)-V$SESSION_WAIT 这是一个寻找性能瓶颈的关键视图.它提供了任何情况下session在数据库中当前正在等待什么(如果session当前什么也没在做,则显示它最后的等待事件).当系统存 ...
- 一个session已经ACTIVE20多小时,等待事件SQL*Net more data from client
问题描述: 一个session已经ACTIVE20多小时,等待事件SQL*Net more data from client 有一人session,从昨天上午11点多登陆(v$session.logi ...
- 查看历史会话等待事件对应的session信息
此处以enq: TX - row lock contention等待时间为例. 查看snap_id对应时间 select to_char(s.startup_time,'dd Mon "at ...
- 数据库服务器CPU持续百分之百、部分Session一直处于执行状态---等待事件为:asynch descriptor resize(Oracle Bug )
问题描述: 项目反馈数据库服务器的CPU持续100%的情况,跟踪发现很多活动会话的等待事件是“asynch descriptor resize”,并且这些会话一直处于Active状态,而这些会话执行的 ...
- Oracle Tuning 基础概述01 - Oracle 常见等待事件
对Oracle数据库整体性能的优化,首先要关注的是在有性能问题时数据库排名前几位等待事件是哪些.Oracle等待事件众多,随着版本的升级,数量还在不断增加,可以通过v$event_name查到当前数据 ...
- SQL SERVER中的OLEDB等待事件
OLEDB等待事件介绍 OLEDB等待类型是SQL SERVER 数据库中最常见的几种等待类型之一.它意味着某个会话(SPID)通过SQL Server Native Client OLEDB Pro ...
- ORACLE等待事件:enq: TX - row lock contention
enq: TX - row lock contention等待事件,这个是数据库里面一个比较常见的等待事件.enq是enqueue的缩写,它是一种保护共享资源的锁定机制,一个排队机制,先进先出(FIF ...
- ORACLE等待事件: log file parallel write
log file parallel write概念介绍 log file parallel write 事件是LGWR进程专属的等待事件,发生在LGWR将日志缓冲区(log_buffer)中的重做日志 ...
随机推荐
- e834. 设置JTabbedPane中卡片的位置
The tabs of a tabbed pane can be placed on one of the four edges of its container. By default, when ...
- 开源项目推荐:e-example / Springboot+bootstrap + ……
前言: 我想要找一个 springboot + bootstrap 的例子介绍,然后搜索到了这个开源项目. 所有能跑起来的项目都有研究价值,看看这个项目的文档.目前正好满足我想要的功能.推荐 正文: ...
- git解决冲突(rebase版)
当使用git rebase碰到冲突时, git rebase <Remote Branch>/<Your Branch> 信息如下: error: Failed to merg ...
- MyEclipse远程调试Tomcat
程序就是这么一个神奇的东西,有时你的一个项目,在本机上运行得还是好好的,可当你把这货放到了服务器上,同样的条件就是结果不一样.于是就灰常想看一下程序在远程运行时候的状态,希望让程序在远程运行,还可以在 ...
- jsp连接mysql----------第一篇技术类文章
今天做作业连了一天的mysql. 最后我痛定思痛,决定从0開始学习jsp.省的又面临不会的局面. 忙活了一晚上.最终把数据库连接上了,只是.好伤心啊,我连个数据库都这么墨迹. . . <%@ p ...
- 各大公司Java面试题超详细总结
ThreadLocal(线程变量副本)Synchronized实现内存共享,ThreadLocal为每个线程维护一个本地变量.采用空间换时间,它用于线程间的数据隔离,为每一个使用该变量的线程提供一个副 ...
- Spring MVC手札
本文用于记录使用Spring MVC中的零散手札 1.在普通java类中获取HttpServletRequest对象 在web.xml的listener节点加入 <listener> & ...
- php5.4安装fileinfo扩展
Fileinfo 扩展是libmagic库的一个封装,可以用来获得文件的一些信息,如MIME类型 安装php_fileinfo扩展 1.windows 用phpinfo()查看php版本 下载 选择合 ...
- 安装MySQL后经常弹出taskeng.exe~
taskeng.exe,是Microsoft任务计划程序引擎调用的安全进程.文件路径为C:\Windows\system32\taskeng.exe.大小165KB. 解决办法: 这个问题是Wind ...
- 纯CSS实现瀑布流布局
https://www.w3cplus.com/css/pure-css-create-masonry-layout.html