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)中的重做日志 ...
随机推荐
- e774. 创建JList组件
By default, a list allows more than one item to be selected. Also, the selected items need not be co ...
- (转)tcp和udp能否发送0字节的数据包
版权声明:本文为博主原创文章,未经博主允许不得转载. 转自:http://blog.csdn.net/wzx19840423/article/details/6643094 最近去一家牛逼的公司面试 ...
- Python学习注脚
python版本:2.7.6 Python基础学习书摘. 变量命名规范: python的变量名只能由字母和数字组成,且必须以字母开头. python的变量名不能使用系统已有的关键字,包括: and c ...
- C#跳转网页7种方法
1.Response.Redirect(http://www.baidu.com,false); 目标页面和原页面可以在2个服务器上,可输入网址或相对路径.后面的bool值为是否停止执行当前页. 跳转 ...
- 工作所用的日常 Git 命令
几乎每个开发人员都在使用 Git,当然很可能是 GitHub.但大多数开发者大概有 99% 的时间只是使用这三个命令: #使用命令git add <file>,将文件添加到暂存区 git ...
- ASM实例原始磁盘搜索路径
discovery diskstring==>ASM实例原始磁盘搜索路径,一般搜索/dev/raw/ /dev/oracleasm/ 初始化参数文件中为:asm_diskstring asmc ...
- pycharm环境下:同文件夹下文件(.py)之间的调用,出现红线问题
只要将pycharm下打开项目后: 将你运行文件(.py)的项目设置为根目录,就不会出现红色线:
- cordova ios and ios8
ios8发布后,一些用cordova编写的app会碰到问题,总的来说,cordova官方称是完全支持ios8的,而且由于ios8推出的WKWebView存在问题并没能很好的解决(看原文),仍旧用了UI ...
- Android 布局学习之——Layout(布局)详解二(常见布局和布局参数)
[Android布局学习系列] 1.Android 布局学习之——Layout(布局)详解一 2.Android 布局学习之——Layout(布局)详解二(常见布局和布局参数) 3.And ...
- difference between TotalFreeSpace and AvailableFreeSpace
Refer:http://stackoverflow.com/questions/7275806/what-is-the-difference-between-totalfreespace-and-a ...