SQL> select STATISTIC#,name from v$statname where name like '%db block gets%';
STATISTIC# NAME
---------- ----------------------------------------------------------------
63 db block gets
64 db block gets from cache
65 db block gets from cache (fastpath)
66 db block gets direct
--9号会话为用户会话
SQL> select sid,VALUE from v$sesstat where STATISTIC#=63 and sid=9;
SID VALUE
---------- ----------
9 375
--9号会话插入数据
SQL> insert into t_detail values(2);
1 row created.
SQL> commit;
Commit complete.
--回到监控会话发现
SQL> select sid,VALUE from v$sesstat where STATISTIC#=63 and sid=9;
SID VALUE
---------- ----------
9 378
--9号会话多次运行select查询, db block gets未发生变化
小结:db block gets仅与dml有关
--buffer gets如何计算
buffer gets = db block gets + consistent gets
---db block gets与consistent gets可由如何计算而知
SQL> select STATISTIC#,name from v$statname where name like '%db block get%';
STATISTIC# NAME
---------- ----------------------------------------------------------------
63 db block gets
64 db block gets from cache
65 db block gets from cache (fastpath)
66 db block gets direct
SQL> select STATISTIC#,name from v$statname where name like '%consistent gets%';
STATISTIC# NAME
---------- ----------------------------------------------------------------
67 consistent gets
68 consistent gets from cache
69 consistent gets from cache (fastpath)
70 consistent gets - examination
71 consistent gets direct