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)中的重做日志 ...
随机推荐
- Python——uuid
uuid模块在Python 2.5以后引入,接口包括:不可变对象UUID(UUID类)和函数uuid1().uuid3().uuid4()和uuid5(),后面的四个函数用于生成 RFC 4122 规 ...
- 使用OpenSSL创建自己的CA root certificate
在密码学中,CA(Certificate Authority,认证机构)是指一个被多个用户信任的机构,该机构能够创建和指派公钥证书. 为规范起见,我们先介绍本文可能涉及的术语, asymmetric ...
- gitlab的安装和基本维护
基本介绍 GitLab是一个自托管的Git项目仓库,可以自己搭建个人代码管理的仓库,功能与github类似. 安装 操作系统:CentOS6.5 gitlab官网下载安装地址:https://abou ...
- PHP中单引号与双引号的区别分析
From: http://www.jb51.net/article/53973.htm 在PHP中,我们可以使用单引号或者双引号来表示字符串.不过我们作为开发者,应该了解其中的区别.单引号与双引号对于 ...
- shiro+redis多次调用doReadSession方法的解决方案
Web 项目使用shiro,针对这个问题可以重写DefaultWebSessionManager,将缓存数据存放到request中,这样可以保证每次请求(可能会多次调用doReadSession方法) ...
- Java标准I/O流编程一览笔录
I/O是什么 I/O 是Input/Output(输入.输出)的简称,输入流可以理解为向内存输入,输出流是从内存输出. 流 流是一个连续的数据流,可以从流中读取数据,也可以往流中写数据.流与数据源,或 ...
- com.alibaba.com.caucho.hessian.io.SerializerFactory getDeserializer
2016-1-27 14:40:25 com.alibaba.com.caucho.hessian.io.SerializerFactory getDeserializer 警告: Hessian/B ...
- Thinkphp5笔记七:设置错误页面②
更加完美的去设置错误页面. 一.准备一个错误页面 error.html,位置:thinkphp\template\index\default\error.html ,准备把前段所有的错误提示都指向这里 ...
- Objective-C语法之可变参数
可变参数的方法在Objective-C中不罕见,像Cocoa中的很多常见的方法都是可变参数的,如: NSLog(NSString *format, ...) + (id)arrayWithObject ...
- 想高效学会Hadoop,你要按照这个路线
学习hadoop,首先我们要知道hadoop是什么? 说到底Hadoop只是一项分布式系统的工具,我们在学习的时候要理解分布式系统设计中的原则以及方法,只有这样才能以不变应万变.再一个就是一定要动手, ...