作者:david_zhang@sh 【转载时请以超链接形式标明文章】
链接:http://www.cnblogs.com/david-zhang-index/archive/2013/01/18/2866202.html
1.清空共享池和缓冲区缓存 SQL> alter system set events 'immediate trace name flush_cache'; System altered. SQL> alter system flush shared_pool; System altered. SQL> set autotrace traceonly statistics SQL> select * from dept; Statistics ---------------------------------------------------------- 355 recursive calls 0 db block gets 68 consistent gets 20 physical reads 0 redo size 666 bytes sent via SQL*Net to client 415 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 6 sorts (memory) 0 sorts (disk) 4 rows processed 2.仅清空缓冲区缓存 SQL> alter system set events 'immediate trace name flush_cache'; System altered. SQL> set autotrace traceonly statistics SQL> select * from dept; Statistics ---------------------------------------------------------- 0 recursive calls 0 db block gets 8 consistent gets 6 physical reads 0 redo size 666 bytes sent via SQL*Net to client 415 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 4 rows processed 3.都不清空 SQL> select * from dept; Statistics ---------------------------------------------------------- 0 recursive calls 0 db block gets 8 consistent gets 0 physical reads 0 redo size 666 bytes sent via SQL*Net to client 415 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 4 rows processed