巩固知识点1:direct path read, db file sequential read,db file scattered read
今天在pub上帮人看一个awr,分析结果如下:
Event Waits Time(s) Avg wait (ms) % DB time Wait Class
direct path read 2,738,048 97,829 36 32.29 User I/O
direct path read 等待
physical read bytes 973,537,861,632 135,953,594.86 2,601,199.32
physical read total IO requests 4,534,396 633.22 12.12
physical read total bytes 975,089,198,080 136,170,237.46 2,605,344.34
物理读 和 IO
table scans (direct read) 1,836 0.26 0.00
table scans (long tables) 1,836 0.26 0.00
大表的 direct path read
Physical Reads Executions Reads per Exec %Total Elapsed Time (s) %CPU %IO SQL Id SQL Module SQL Text
42,257,409 12 3,521,450.75 35.56 12,822.57 1.07 97.32 cmna651uadt5x JDBC Thin Client select max(frid) as maxid from...
36,910,214 1,516 24,347.11 31.06 60,064.30 0.27 95.32 0zqc0vmmvus23 JDBC Thin Client select video_id, pubtime,
sql需要调整
造成direct path read 的主要原因
大量的磁盘排序操作,无法在排序区中完成排序,需要利用temp表空间进行排序.
大量的Hash Join操作,利用temp表空间保存hash区。
SQL语句的并行处理
大表的全表扫描,在Oracle11g中,全表扫描的算法有新的变化,根据表的大小、高速缓存的大小等信息,决定是否绕过SGA直接从磁盘读取数据。而10g则是全部通过高速缓存读取数据,称为table scan(large)。11g认为大表全表时使用直接路径读,可能比10g中的数据文件散列读(db file scattered reads)速度更快,使用的latch也更少。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24383181/viewspace-711966/
,如需转载,请注明出处,否则将追究法律责任。