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 ;