Oracle等待事件db file parallel read
SQL> select event#,name,parameter1,parameter2,parameter3 from v$event_name where name = 'db file parallel read';
EVENT# NAME PARAMETER1 PARAMETER2 PARAMETER3
---------- ------------------------------ --------------- --------------- ---------------
120 db file parallel read files blocks requests
1. db file parallel read
Contrary to what the name suggests, the db file parallel read event is not related to any parallel
operation—neither parallel DML nor parallel query. This event occurs during the database recovery
operation when database blocks that need changes as a part of recovery are read in parallel from the
datafiles. This event also occurs when a process reads multiple noncontiguous single blocks from
one or more datafiles.
Wait Parameters
Wait parameters for db file parallel read are described here:
l P1 Number of files to read from
l P2 Total number of blocks to read
l P3 Total number of I/O requests (the same as P2 since multiblock read is not used)
Wait Time
No timeouts. The session waits until all of the I/Os are completed.
案例
http://www.itpub.net/thread-1586802-1-1.html
虽然执行计划正确,但是由于index的聚合因子过高,导致prefetch功能大量预读取数据.
一个语句执行计划没有问题,单独提取出来执行只要0.8秒。但是放到存储过程中就很慢 需要10秒左右甚至更多。
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU) | Time |
| 0 | SELECT STATEMENT | 1839 (100) | ||||
| 1 | SORT AGGREGATE | 1 | 37 | |||
| 2 | FILTER | |||||
| 3 | TABLE ACCESS BY INDEX ROWID | V_RPT_PLYEDR_INSRNC | 1 | 37 | 1839 (1) | 00:00:23 |
| 4 | INDEX RANGE SCAN | ACIF_INDEX_001 | 2147 | 18 (0) | 00:00:01 |
但是带入数据单独这个语句执行计划一样的情况下,只要1秒左右。应该不是绑定变量导致的执行计划问题,因为可以看到执行计划是最优的,我查看了等待事件
491 db file parallel read 2041
491 db file sequential read 526
491 db file scattered read 23
SQL> select distinct(file_id) from dba_extents where segment_name='V_RPT_PLYEDR_INSRNC';
FILE_ID
----------
25
22 SQL> select name from v$datafile where file# in ('',''); NAME
--------------------------------------------------------------------------------
/repdata/ora9i/CIRCI.dbf
/repdata/ora9i/circi01.dbf
Top 5 Timed Events
| Event | Waits | Time(s) | Avg Wait(ms) | % Total Call Time | Wait Class |
| db file parallel read |
351,880 |
2,891 |
8 |
68.3 |
User I/O |
| db file sequential read |
463,984 |
1,216 |
3 |
28.7 |
User I/O |
| CPU time | 184 | 4.4 | |||
| log file parallel write |
1,346 |
3 |
2 |
.1 |
System I/O |
| db file parallel write |
512 |
3 |
6 |
.1 |
System I/O |
File IO Stats
- ordered by Tablespace, File
| Tablespace | Filename | Reads | Av Reads/s | Av Rd(ms) | Av Blks/Rd | Writes | Av Writes/s | Buffer Waits | Av Buf Wt(ms) |
| CIRCI | /repdata/ora9i/CIRCI.dbf |
2,847,514 |
787 |
12.59 |
1.02 |
1,258 |
0 |
3 |
20.00 |
| CIRCI | /repdata/ora9i/circi01.dbf |
915,158 |
253 |
8.63 |
1.00 |
13 |
0 |
0 |
0.00 |
| REPORT | /repdata/ora9i/REPORT01.dbf |
257,679 |
71 |
0.75 |
15.15 |
0 |
0 |
186,811 |
0.45 |
| REPORT | /repdata/ora9i/REPORT02.dbf |
255,701 |
71 |
0.71 |
15.21 |
0 |
0 |
187,164 |
0.43 |
| REPORT | /repdata/ora9i/REPORT03.dbf |
135,105 |
37 |
0.72 |
15.35 |
0 |
0 |
125,856 |
0.39 |
Av Rd(ms) 过大 排除 整列本生有问题,是否和 集群因子过大导致通过ROWID寻找TABLE ROWS时跳跃过大有关?
结果显示集群因子相当的大,表中一共3000多W调数据 集群因子达到2600W,但是索引的DISTINCT值确只有846,表只是批量的进行INSERT
所以是否可以考虑如下的方法
1、建立BITMAP索引代替以前爱的B-TREE索引
2、或者建立一个大的联合索引,让查询直接走INDEX FAST FULL SCAN。
3、同时建立一个新的表空间来存放索引,做好把TABLE也MOVE到新建的表空间中。
我已经建立了联合索引。效果灰常好。已经不通过TABLE ACCESS BY INDEX ROWID 了。只扫描索引就好了。
新的Execution Plan 如下:
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 2161530321
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 37 | 156 (1)| 00:00:02 |
| 1 | SORT AGGREGATE | | 1 | 37 | | |
|* 2 | INDEX RANGE SCAN| TEST01 | 2 | 74 | 156 (1)| 00:00:02 |
原理:
高聚簇因子 index range scan -----> 引发灰常多的 rowid 回表扫描离散的block ------>buffer prefetching(11G) ------------> db file parallel read...
当 db 出现过多的 db file parallel read 优化SQL 去吧。
案列二:
http://yangtingkun.net/?p=695 消除11.2上的db file parallel read
客户在11.2.0.3环境中进行压力测试,发现出现大量的db file parallel read等待事件。
这个等待是11g以后才出现的,而在11g以前,一般这个等待事件发生在数据文件的恢复过程中。而11g新增了prefetch的特性,也可能导致这个等待事件的产生。
当运行压力测试时,后台的等待事件如下:
SQL> SELECT event, COUNT(*) FROM v$session WHERE username = USER GROUP BY event ORDER BY 2;
EVENT COUNT(*)
---------------------------------------------------------------- ----------
SQL*Net message FROM client 1
SQL*Net message TO client 1
db file sequential READ 24
db file scattered READ 33
db file parallel READ 42
可以看到用户进程经历比较严重的IO等待,而此时的db file parallel read,并不会带来性能提升。
可以通过添加隐含参数的方法来屏蔽prefetch功能,从而避免db file parallel read等待事件的产生:
_db_block_prefetch_limit=0
_db_block_prefetch_quota=0
_db_file_noncontig_mblock_read_count=0
修改这三个隐藏参数后,发现db file parallel read等待事件已经消失:
SQL> SELECT event, COUNT(*) FROM v$session WHERE username = USER GROUP BY event ORDER BY 2;
EVENT COUNT(*)
---------------------------------------------------------------- ----------
SQL*Net message TO client 1
db file scattered READ 30
db file sequential READ 70
Oracle等待事件db file parallel read的更多相关文章
- ORACLE等待事件: log file parallel write
log file parallel write概念介绍 log file parallel write 事件是LGWR进程专属的等待事件,发生在LGWR将日志缓冲区(log_buffer)中的重做日志 ...
- Oracle 等待事件 db file sequential read
db file sequential read-数据文件顺序读取 等待事件: "db file sequential read" Reference Note (文档 ID 345 ...
- 等待事件--db file sequential read
对于最小化db file sequential read 事件所带来的影响,你可以做的另一件事情是减少AVERAGE_WAIT时间. 这是会话必须等待从磁盘提取单块的平均时间,这些信息可以从v$ses ...
- I/O等待事件-db file scattered read
摘自:http://blog.csdn.net/zq9017197/article/details/7925338
- ORACLE等待事件:read by other session
read by other session简介 官方关于read by other session的介绍如下: When information is requested from the datab ...
- 全面解析Oracle等待事件的分类、发现及优化
一.等待事件由来 大家可能有些奇怪,为什么说等待事件,先谈到了指标体系.其实,正是因为指标体系的发展,才导致等待事件的引入.总结一下,Oracle的指标体系,大致经历了下面三个阶段: · 以命中率为主 ...
- Oracle db file parallel write 和 log file parallel write 等待事件
一. db file parallel write等待事件 引自如下blog: http://oradbpedia.com/wiki/Wait_Events_-_db_file_parallel_wr ...
- Oracle等待事件之db file sequential read/ db file parallel read
1.产生原因 db file sequential read这个是非常常见的I/O 相关的等待事件.表示发生了与索引扫描相关的等待.意味着I/O 出现了问题,通常表示I/O竞争或者I/O 需求太多. ...
- [20180316]理解db file parallel read等待事件.txt
[20180316]理解db file parallel read等待事件.txt --//一直对db file parallel read等待事件不理解,因为在实际系统中很少遇到这样的等待事件. S ...
随机推荐
- BZOJ 3211 题解
3211: 花神游历各国 Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 2549 Solved: 946[Submit][Status][Discus ...
- URAL 1057. Amount of Degrees(数位DP)
题目链接 我看错题了...都是泪啊,不存在3*4^2这种情况...系数必须为1... #include <cstdio> #include <cstring> #include ...
- 【JAVA】JMX简单使用方法
[BEAN] 配置 <!-- JMX 对应的接口服务--> <bean id="emailInterfaceServer" class="com.s ...
- Thymeleaf基本知识
Thymeleaf是个XML/XHTML/HTML5模板引擎,可以用于Web与非Web应用. Thymeleaf的主要目标在于提供一种可被浏览器正确显示的.格式良好的模板创建方式,因此也可以用作静态建 ...
- GO语言练习:网络编程 TCP 示例
1.代码 2.编译及运行 1.网络编程 TCP 示例 simplehttp.go 代码 package main import ( "net" "os" &qu ...
- PostgreSQL新手入门
自从MySQL被Oracle收购以后,PostgreSQL逐渐成为开源关系型数据库的首选. 本文介绍PostgreSQL的安装和基本用法,供初次使用者上手.以下内容基于Debian操作系统,其他操作系 ...
- Redis常用命令(二)
连接操作相关的命令 quit:关闭连接(connection) auth:简单密码认证 持久化 save:将数据同步保存到磁盘 bgsave:将数据异步保存到磁盘 lastsave:返回上次成功将数据 ...
- ASP.NET生成静态方法
CMS系统如果新闻多了,全部生成静态的话.不现实,而且占用空间比较大.那么只生成网站首页是必须的了,下面列出JCMS首页生成静态的方法.换一种思路其实更简单. 当点击生成首页静态的时候.去获取动态首页 ...
- web.xml的一份配置(备忘)
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java ...
- intellij idea 插件 ideaVim
像Eclipse一样,idea这个公认最好的javaIDE也有Vim插件. 安装方法 File>Settings>Plugins>Install JetBrains plugin.. ...