Consistent Gets(就是logical read)+ DB Block Gets = 所謂的Logical Reads
consistent gets :db buffer cache中的塊被訪問的次數,不管你是CR塊還是普通的塊。只要被訪問一次,consistent gets就加1,
SQL>show arraysize
15
顯示了一次返回行數的限制,比如說一個塊中有1000行資料,我要全部邏輯讀這1000條資料需要1000/15 次。如果set arraysize 1000 那麼就需要一次邏輯讀。
它表示從Oracle伺服器端一次只傳遞15行記錄到客戶端(SQLPLUS),當然了JDBC,WEBLOGIC也有行預取,具體自己Google。
db block gets : db buffer cache被更改了,計數加1。
SQL> alter system flush buffer_cache;
系統已更改。
SQL> set autot
用法: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
SQL> set autot traceonly stat
SQL> select * from t
已選擇798945行。
統計資訊
----------------------------------------------------------
1 recursive calls
0 db block gets --這個為0
63677 consistent gets
11118 physical reads
0 redo size
85740332 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> select * from t;
已選擇798945行。
統計資訊
----------------------------------------------------------
0 recursive calls
0 db block gets
69587 consistent gets --全是一致性得到,因為已經在Buffer cache中
0 physical reads
0 redo size
85740332 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> select * from t for update;
已選擇798945行。
統計資訊
----------------------------------------------------------
476 recursive calls
812439 db block gets --更新時,產生這個
884932 consistent gets
5 physical reads
160912940 redo size
73057198 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> rollback;
回退已完成。
SQL> alter system flush buffer_cache;
系統已更改。
SQL> select * from t for update;
已選擇798945行。
統計資訊
----------------------------------------------------------
476 recursive calls
812437 db block gets
884836 consistent gets
11122 physical reads
160903012 redo size
73057198 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> alter system flush buffer_cache;
系統已更改。
SQL> desc t;
名稱 是否為空? 型別
----------------------------------------- -------- ---------------------------
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
SQL> update t set owner='a';
已更新798945行。
統計資訊
----------------------------------------------------------
4564 recursive calls
7008787 db block gets
1123165 consistent gets
13434 physical reads
555747124 redo size
683 bytes sent via SQL*Net to client
558 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
16 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> select * from t;
已選擇798945行。
統計資訊
----------------------------------------------------------
1 recursive calls
0 db block gets
63677 consistent gets
0 physical reads
0 redo size
82886810 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
可以理解 為:
consistent gets : 是由查詢語句產生的,不管所查的資料是否需要構造前映象,都要算進去
db block gets: 是由update,delete,select for update 產生的
SQL>show arraysize
15
顯示了一次返回行數的限制,比如說一個塊中有1000行資料,我要全部邏輯讀這1000條資料需要1000/15 次。如果set arraysize 1000 那麼就需要一次邏輯讀。
它表示從Oracle伺服器端一次只傳遞15行記錄到客戶端(SQLPLUS),當然了JDBC,WEBLOGIC也有行預取,具體自己Google。
db block gets : db buffer cache被更改了,計數加1。
SQL> alter system flush buffer_cache;
系統已更改。
SQL> set autot
用法: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]
SQL> set autot traceonly stat
SQL> select * from t
已選擇798945行。
統計資訊
----------------------------------------------------------
1 recursive calls
0 db block gets --這個為0
63677 consistent gets
11118 physical reads
0 redo size
85740332 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> select * from t;
已選擇798945行。
統計資訊
----------------------------------------------------------
0 recursive calls
0 db block gets
69587 consistent gets --全是一致性得到,因為已經在Buffer cache中
0 physical reads
0 redo size
85740332 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> select * from t for update;
已選擇798945行。
統計資訊
----------------------------------------------------------
476 recursive calls
812439 db block gets --更新時,產生這個
884932 consistent gets
5 physical reads
160912940 redo size
73057198 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> rollback;
回退已完成。
SQL> alter system flush buffer_cache;
系統已更改。
SQL> select * from t for update;
已選擇798945行。
統計資訊
----------------------------------------------------------
476 recursive calls
812437 db block gets
884836 consistent gets
11122 physical reads
160903012 redo size
73057198 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> alter system flush buffer_cache;
系統已更改。
SQL> desc t;
名稱 是否為空? 型別
----------------------------------------- -------- ---------------------------
OWNER VARCHAR2(30)
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(30)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
OBJECT_TYPE VARCHAR2(19)
CREATED DATE
LAST_DDL_TIME DATE
TIMESTAMP VARCHAR2(19)
STATUS VARCHAR2(7)
TEMPORARY VARCHAR2(1)
GENERATED VARCHAR2(1)
SECONDARY VARCHAR2(1)
SQL> update t set owner='a';
已更新798945行。
統計資訊
----------------------------------------------------------
4564 recursive calls
7008787 db block gets
1123165 consistent gets
13434 physical reads
555747124 redo size
683 bytes sent via SQL*Net to client
558 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
16 sorts (memory)
0 sorts (disk)
798945 rows processed
SQL> select * from t;
已選擇798945行。
統計資訊
----------------------------------------------------------
1 recursive calls
0 db block gets
63677 consistent gets
0 physical reads
0 redo size
82886810 bytes sent via SQL*Net to client
586267 bytes received via SQL*Net from client
53264 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
798945 rows processed
可以理解 為:
consistent gets : 是由查詢語句產生的,不管所查的資料是否需要構造前映象,都要算進去
db block gets: 是由update,delete,select for update 產生的
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29990276/viewspace-1456970/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DB Block Gets、Consistent Gets、Physical ReadsBloC
- db block gets 與 consistent read getsBloC
- recursive calls, db block gets,consistent gets,physical ReadsBloC
- 對'Consistent Gets',''Physical Reads'和'DB Block Gets'的理解BloC
- Consistent Gets,Physical Reads和DB Block Gets的解釋(轉)BloC
- (轉)關於 db block gets,consistent gets,physical reads的概念BloC
- 對'Consistent Gets',''Physical Reads'和'DB Block Gets'的理解和解釋BloC
- oracle buffer gets=db block gets+consistent getsOracleBloC
- DB Bocks gets,Consistent gets And Physical reads 轉載
- 關於統計中Consistent Gets,Physical Reads和DB Block Gets的意義BloC
- recursive calls ,db block gets , consistent gets的含義BloC
- consistent gets、db block gets的簡單精闢的理解BloC
- 【Oracle-記憶體管理】-DB Blocks gets,Consistent gets And Physical readsOracle記憶體BloC
- DB Bocks gets & Consistent gets 區別
- 關於執行計劃裡recursive calls,db block gets和consistent gets引數的解釋BloC
- db block gets的解釋[轉]BloC
- consistent gets
- 淺談consistent gets的計算
- consistent gets 到底指的是什麼?
- db block get和consistent read getBloC
- consistent gets暴漲的一種情況
- sqlplus中arrayseize引數以及consistent getsSQL
- oracle實驗記錄 (oracle consistent gets 計算)Oracle
- error:unable to get logical block size for spfileErrorBloC
- ORA-27046: file size is not a multiple of logical block sizeBloC
- Oracle透過AWR的SQL ordered by Gets和SQL ordered by Reads診斷問題OracleSQL
- [20111229]Consistent gets from cache (fastpath).txtAST
- gets函式的漏洞函式
- oracle 10g logical standby db creationOracle 10g
- [20111228]理解consistent gets*相關資訊
- 這就是所謂的OC的反射機制反射
- C語言關於指標,gets()和gets_s()函式的理解C語言指標函式
- [20111229]理解consistent gets*相關資訊[補充]
- 這就是所謂的結對程式設計?程式設計
- AIX: Database performance gets slower the longer the db is running_316533.1AIDatabaseORM
- Your Prediction Gets As Good As Your DataGo
- gets函式的不安性詳解函式
- 沒有備份的情況下如何處理logical & physical corrupt blockBloC