解决db file sequential read与db file scattered read

1.根据收集的等待事件,分析是那些对象以及对应的sql。

2.确定是那些对象,执行如下:

SELECT segment_name, partition_name, p1, p2
FROM dba_extents, wait1
WHERE wait1.p2 BETWEEN block_id AND (block_id + blocks - 1)
AND file_id = wait1.p1
ORDER BY segment_name

3.确定执行的sql语句,执行如下:

SELECT hash_value, address, piece, sql_text
FROM v$sqltext
WHERE hash_value IN (SELECT DISTINCT sql_hash_value
FROM wait1)
ORDER BY hash_value, piece;

SELECT hash_value, address, piece, sql_text
FROM v$sqltext
WHERE hash_value = :1
ORDER BY hash_value, piece;

注意这个有可能一些已经不在shared pool。

4.另外通过这个脚本也可以确定对象,缺点这个块一定要读入sga。

SELECT DISTINCT a.object_name, a.subobject_name
FROM dba_objects a, SYS.x_$bh b
WHERE (a.object_id = b.obj OR a.data_object_id = b.obj)
AND b.file# = :p1
AND b.dbablk = :p2 ;

时间: 2024-07-30 18:36:38

解决db file sequential read与db file scattered read的相关文章

详解 db file sequential read 等待事件

db file sequential read (本文由thomaswoo_dba翻译,转载请注明出处) db file sequential read 事件有三个参数:file#,first block#, block count, 在oracle 10g里,此等待事件在归于 User I/O wait class 下面的. 处理db file sequential read 事件要牢牢把握下面三个主要思想: 1)oracle 进程需要访问的block不能从SGA 中获取,因此oracle 进

db file sequential read 详解

db file sequential read (本文由thomaswoo_dba翻译,转载请注明出处) db file sequential read 事件有三个参数:file#,first block#, block count, 在oracle 10g里,此等待事件在归于 User I/O wait class 下面的. 处理db file sequential read 事件要牢牢把握下面三个主要思想:1)oracle 进程需要访问的block不能从SGA 中获取,因此oracle 进程

常识之外:全表扫描为何产生大量 db file sequential read 单块读?

原创 2016-07-05 熊军 Oracle   编辑手记:在理解Oracle技术细节时,我们不仅应该读懂概念,还要能够通过测试验证细节,理解那些『功夫在诗外』的部分,例如全表扫描和单块读. 开发人员在进行新系统上线前的数据校验测试时,发现一条手工执行的 SQL 执行了超过1小时还没有返回结果.SQL 很简单: 下面是这条 SQL 的真实的执行计划: 很显然,在这个表上建 billing_nbr 和 start_date 的复合索引,这条 SQL 就能很快执行完(实际上最后也建了索引).但是这

db file sequential read等待事件

最近某个应用的AWR中总显示"db file sequential read"等待事件位于top 5之首,下面检索下MOS关于这个等待事件的说明. 等待事件: "db file sequential read" Reference Note (文档 ID 34559.1)         这种等待事件是一种IO读请求相关的等待.与"db file scattered read"不同,因为"sequential read"是将数

db file sequential read及优化

db file sequential read:直接路径读:   官方说明如下: This event signifies that the user process is reading a buffer into the SGA buffer cache and is waiting for a physical I/O call to return. A sequential read is a single-block read. Single block I/Os are usuall

Resolving Issues Where Application Queries are Waiting Too Frequently for 'db file sequential read'

昨天有篇"db file sequential read"的介绍,还有一篇类似的:Resolving Issues Where Application Queries are Waiting Too Frequently for 'db file sequential read' Operations (文档 ID 1475825.1) 诊断"db file sequential read"的步骤: 简述: 低效的SQL会引起不同节点间非常多的块读. 问题确认: 花

High Waits on 'Db File Sequential Read' Due to Table Lookup Following Index Access

最近某些系统AWR的top 5中"Db File Sequential Read"占据的时间百分比非常大,通常这种等待事件是一种正常的.但当前系统性能是有些问题的,并发量大,有些缓慢,因此需要判断这种等待事件是否能够减少.MOS有几篇关于这种等待事件的介绍,这是其中一篇. High Waits on 'Db File Sequential Read' Due to Table Lookup Following Index Access (文档 ID 875472.1) 即使执行计划已经

Linux有问必答:怎样解决“XXX is not in the sudoers file”错误

Linux有问必答:怎样解决"XXX is not in the sudoers file"错误 问题:我想在我的Linux系统上使用sudo来运行一些特权命令,然而当我试图这么做时,我却得到了"[我的用户名] is not in the sudoers file. This incident will be reported."的错误信息.我该怎么处理这种sudo错误呢? sudo是一个允许特定的用户组用另一个用户(典型的是root)的特权来运行一个命令.sudo

Cannot open include file: jni.h: No such file or directory解决方法

在此运行Visual Studio 2008 项目时出现 #include <stdio.h> #include <jni.h> int main() { printf("Hello World"); } But when I try to build, I get the following error - 1>c:testtest.cpp(2) : fatal error C1083: Cannot open include file: 'jni.h'