v$undostat的一點理解

gaopengtttt發表於2009-09-11

原創 轉載請註明出處

今天在看ORACLE Concepts 的時候重新認識了下v$undostat 檢視,覺得這個檢視對檢視UNDO的使用的使用情況非常有用,可以說可以確定出
你的UNDO tablespace是否合理,這裡還注意一點,就是TYPE2 UNDO這個型別是使用撤銷段而不是使用傳統的回退段的時候的段型別。
    對所有欄位進行逐一解釋:
    BEGIN_TIME : Identifies the beginning of the time interval
    本檢視採用每10分鐘進行分割,這個欄位是一個分割的起始時間。
    END_TIME   : Identifies the end of the time interval
    這個欄位是一個分割的結束時間。
    UNDOTSN    : Represents the last active undo tablespace in the duration of time.
    這個欄位理解得不清楚,大概是時間段內活動的撤銷表空間。
    UNDOBLKS   : Represents the total number of undo blocks consumed. You can use this
                  column to obtain the consumption rate of undo blocks, and thereby
                  estimate the size of the undo tablespace needed to handle the workload on
                  your system.
    這個欄位顯示了這段時間以來總的消耗的撤銷塊的大小,可以用來估計你的撤銷表空間設定是否合理。
    TXNCOUNT   : Identifies the total number of transactions executed within the period
    顯示了這段時間以來的總的事物總量。
    MAXQUERYLEN : Identifies the length of the longest query (in seconds) executed in the
                   instance during the period. You can use this statistic to estimate the proper
                   setting of the UNDO_RETENTION initialization parameter. The length of a
                   query is measured from the cursor open time to the last fetch/execute
                   time of the cursor. Only the length of those cursors that have been
                   fetched/executed during the period are refected in the view.
    這個欄位顯示了這段時間以來最長的查詢,為了防止快照太舊的情況,可以透過這個欄位來設定UNDO_RETENTION引數的大小
    MAXQUERYID : SQL identifier of the longest running SQL statement in the period
    顯示了執行最長時間的sql_id,可以透過這個欄位查詢出執行時間最長的SQL(連線v$sql檢視)
    MAXCONCURRENCY : Identifies the highest number of transactions executed concurrently within
                      the period
    顯示了本段時間以來事務併發執行的最大數。
    UNXPSTEALCNT : Number of attempts to obtain undo space by stealing unexpired extents
                    from other transactions
    當撤銷表空間不足以儲存UNDO_RETENTION引數所指定的時間的時候,就會嘗試使用沒有過期的撤銷空間,當然這個欄位為0最好
    UNXPBLKRELCNT : Number of unexpired blocks removed from certain undo segments so they
                     can be used by other transactions
    同上這個欄位使用塊為單位
    UNXPSTEALCNT  : Number of attempts to obtain undo space by stealing unexpired extents
                     from other transactions
    這個欄位是以分割槽為單位                
    UNXPBLKRELCNT : Number of unexpired blocks removed from certain undo segments so they
                     can be used by other transactions
    UNXPBLKREUCNT : Number of unexpired undo blocks reused by transactions
                     EXPSTEALCNT NUMBER Number of attempts to steal expired undo blocks from other undo
                     segments
    EXPBLKRELCNT  : Number of expired undo blocks stolen from other undo segments
    EXPBLKREUCNT  : Number of expired undo blocks reused within the same undo segments
    我覺得以上的幾個欄位都是由於撤銷表空間不足而導致的,最好都為0.
    
   

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

相關文章