分类: Oracle
2013-05-21 14:28:31
System altered
SQL> select event,total_waits,time_waited,average_wait from v$session_event where sid=1 order by total_waits desc;
EVENT TOTAL_WAITS TIME_WAITED AVERAGE_WAIT
---------------------------------------------------------------- ----------- ----------- ------------
db file sequential read 139 99 0.71 --此等待事件增大,是因为会读取与本话相关的一些字典表的数据
SQL*Net message to client 24 0 0
SQL*Net message from client 23 260608 11330.78
log file sync 5 0 0.09
Disk file operations I/O 4 0 0.06
events in waitclass Other 3 6 1.93
SQL*Net break/reset to client 2 0 0.01
enq: RO - fast object reuse 1 1 0.81
8 rows selected
---读取表记录
SQL> select * from t_single;
A
----------
1
2
---对比发现db file sequential read等待事件加大了
SQL> /
EVENT TOTAL_WAITS TIME_WAITED AVERAGE_WAIT
---------------------------------------------------------------- ----------- ----------- ------------
db file sequential read 142 104 0.73
SQL*Net message to client 26 0 0
SQL*Net message from client 25 263763 10550.52
log file sync 5 0 0.09
Disk file operations I/O 4 0 0.06
events in waitclass Other 3 6 1.93
SQL*Net break/reset to client 2 0 0.01
enq: RO - fast object reuse 1 1 0.81
8 rows selected
---表已在buffer cache中
SQL> /
A
----------
1
2
---对比发现如表已在buffer cache则db file sequential read不会增加
SQL> /
EVENT TOTAL_WAITS TIME_WAITED AVERAGE_WAIT
---------------------------------------------------------------- ----------- ----------- ------------
db file sequential read 142 104 0.73
SQL*Net message to client 28 0 0
SQL*Net message from client 27 280384 10384.58
log file sync 5 0 0.09
Disk file operations I/O 4 0 0.06
events in waitclass Other 3 6 1.93
SQL*Net break/reset to client 2 0 0.01
enq: RO - fast object reuse 1 1 0.81
8 rows selected unix培训