oracle buffer gets=db block gets+consistent gets

wisdomone1發表於2013-03-15

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  

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-756267/,如需轉載,請註明出處,否則將追究法律責任。

相關文章