統計信息:
? ? ? ? ? 0? recursive calls
????? 20434? db block gets
? 317970511? consistent gets
????????? 0? physical reads
??? 3759764? redo size
??????? 382? bytes sent via SQL*Net to client
?????? 1061? bytes received via SQL*Net from client
????????? 3? SQL*Net roundtrips to/from client
????? 10001? sorts (memory)
????????? 0? sorts (disk)
????? 10000? rows processed
? 317970511? consistent gets
????????? 0? physical reads
??? 3759764? redo size
??????? 382? bytes sent via SQL*Net to client
?????? 1061? bytes received via SQL*Net from client
????????? 3? SQL*Net roundtrips to/from client
????? 10001? sorts (memory)
????????? 0? sorts (disk)
????? 10000? rows processed
?
recursive calls?統計在一段語句執行時,遞歸調用的次數。在執行SQL時,生成的執行計劃可能牽涉到許多相關的調用執行,比如在執行Update時可能需要先select,這個select就是update的遞歸調用;在執行語句時可能還牽涉到對系統表的遞歸查詢等操作,這些通通都算是遞歸調用。
?
Recursive Calls:?
Number of recursive calls generated at both the user and system level.?
Oracle Database maintains tables used for internal processing. When it needs to change these tables, Oracle Database generates an internal SQL statement, which in turn generates a recursive call.?
In short, recursive calls are basically SQL performed on behalf of your SQL. So, if you had to parse the query, for example, you might have had to run some other queries to get data dictionary information. These would be recursive calls. Space management, security checks, calling PL/SQL from SQL—all incur recursive SQL calls.?
Oracle Database maintains tables used for internal processing. When it needs to change these tables, Oracle Database generates an internal SQL statement, which in turn generates a recursive call.?
In short, recursive calls are basically SQL performed on behalf of your SQL. So, if you had to parse the query, for example, you might have had to run some other queries to get data dictionary information. These would be recursive calls. Space management, security checks, calling PL/SQL from SQL—all incur recursive SQL calls.?
DB Block Gets:(DB Block Gets:請求的數據塊在buffer能滿足的個數)
Number of times a CURRENT block was requested.?
Current mode blocks are retrieved as they exist right now, not in a consistent read fashion.
Normally, blocks retrieved for a query are retrieved as they existed when the query began. Current mode blocks are retrieved as they exist right now, not from a previous point in time.?
During a SELECT, you might see current mode retrievals due to reading the data dictionary to find the extent information for a table to do a full scan (because you need the "right now" information, not the consistent read). During a modification, you will access the blocks in current mode in order to write to them.?
Current mode blocks are retrieved as they exist right now, not in a consistent read fashion.
Normally, blocks retrieved for a query are retrieved as they existed when the query began. Current mode blocks are retrieved as they exist right now, not from a previous point in time.?
During a SELECT, you might see current mode retrievals due to reading the data dictionary to find the extent information for a table to do a full scan (because you need the "right now" information, not the consistent read). During a modification, you will access the blocks in current mode in order to write to them.?
Consistent Gets:(Consistent Gets:數據請求總數在回滾段Buffer中)
Number of times a consistent read was requested for a block.?
This is how many blocks you processed in "consistent read" mode. This will include counts of blocks read from the rollback segment in order to roll back a block.?
This is the mode you read blocks in with a SELECT, for example.?
Also, when you do a searched UPDATE/DELETE, you read the blocks in consistent read mode and then get the block in current mode to actually do the modification.?
This is how many blocks you processed in "consistent read" mode. This will include counts of blocks read from the rollback segment in order to roll back a block.?
This is the mode you read blocks in with a SELECT, for example.?
Also, when you do a searched UPDATE/DELETE, you read the blocks in consistent read mode and then get the block in current mode to actually do the modification.?
Physical Reads:
Total number of data blocks read from disk. This number equals the value of "physical reads direct" plus all reads into buffer cache. (Physical Reads:實例啟動后,從磁盤讀到Buffer Cache數據塊數量)
sorts (memory):
在內存中排序
?
Sorts (disk):
Number of sort operations that required at least one disk write. Sorts that require I/O to disk are quite resource intensive. Try increasing the size of the initialization parameter SORT_AREA_SIZE.
(Sorts(disk):從磁盤上進行排序的數量)
?
Physical Reads通常是我們最關心的,如果這個值很高,說明要從磁盤請求大量的數據到Buffer Cache里,通常意味著系統里存在大量全表掃描的SQL語句,這會影響到數據庫的性能,因此盡量避免語句做全表掃描,對于全表掃描的SQL語句,建議增加相關的索引,優化SQL語句來解決。
關于physical reads ,db block gets 和consistent gets這三個參數之間有一個換算公式:
數據緩沖區的使用命中率=1 - ( physical reads / (db block gets + consistent gets) )
?
針對以上3個概念進行的說明解釋及關系如下:
1、DB Block Gets(當前請求的塊數目)
當前模式塊意思就是在操作中正好提取的塊數目,而不是在一致性讀的情況下而產生的塊數。正常的情況下,一個查詢提取的塊是在查詢開始的那個時間點上存在的數據塊,當前塊是在這個時刻存在的數據塊,而不是在這個時間點之前或者之后的數據塊數目。
2、Consistent Gets(數據請求總數在回滾段Buffer中的數據一致性讀所需要的數據塊)
這里的概念是在處理你這個操作的時候需要在一致性讀狀態上處理多少個塊,這些塊產生的主要原因是因為由于在你查詢的過程中,由于其他會話對數據塊進行操作,而對所要查詢的塊有了修改,但是由于我們的查詢是在這些修改之前調用的,所以需要對回滾段中的數據塊的前映像進行查詢,以保證數據的一致性。這樣就產 生了一致性讀。
3、Physical Reads(物理讀)
就是從磁盤上讀取數據塊的數量,其產生的主要原因是:
1、 在數據庫高速緩存中不存在這些塊
2、 全表掃描
3、 磁盤排序
它們三者之間的關系大致可概括為:
邏輯讀指的是Oracle從內存讀到的數據塊數量。一般來說是'consistent gets' + 'db block gets'。當在內存中找不到所需的數據塊的話就需要從磁盤中獲取,于是就產生了'phsical reads'。