1. 首页
  2. IT资讯

解决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 ;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-82824/,如需转载,请注明出处,否则将追究法律责任。

主题测试文章,只做测试使用。发布者:深沉的少年,转转请注明出处:http://www.cxybcw.com/182920.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code