Oracle動態效能檢視學習筆記(3)_v$undostat
Oracle動態效能檢視學習筆記(3)_v$undostat
參考文件<>Chapter 24
##################################################################
1 Overview
##################################################################
V$UNDOSTAT displays a histogram of statistical data to show how well the system is working. The available statistics include undo space consumption, transaction
concurrency, and length of queries executed in the instance. You can use this view to estimate the amount of undo space required for the current workload. Oracle uses this view to tune undo usage in the system. The view returns null values if the system is in manual undo management mode. Each row in the view keeps statistics collected in the instance for a 10-minute interval. The rows are in descending order by the BEGIN_TIME column value. Each row belongs to the time interval marked by (BEGIN_TIME, END_TIME). Each column represents the data collected for the particular statistic in that time interval. The first row of the view contains statistics for the (partial) current time period. The view contains a total of 1008 rows, spanning a 7 day cycle.
(這個檢視可以統計undo表空間的使用情況,事務的併發度,查詢語句的執行時間。透過這個檢視可以估算undo表空間的適合大小。
預設情況下每隔10Min取樣一次資料,共保留7 days)
##################################################################
2 Useful Columns for v$undostat
##################################################################
1) End_time: End time for each ten minute interval
2) UNDOBLKS: The total number of undo blocks consumed.
3) MAXCONCURRENCY: Maximum number of transactions executed concurrently.
(最大的併發度)
4) TXNCOUNT: Total number of transactions executed within the interval.
(間隔期間內總共的事務數)
5) MAXQUERYLEN: Maximum length of queries, in seconds executed in the instance
(最長的查詢時間)
6) EXPSTEALCNT: Number of times an undo extent must be transferred from one undo segment to another within the interval.
(undo extent出現Segment遷移的次數,什麼時候會出現這種情況呢?)
7) UNDOTSN: undo tablespaces in service during each time period
undo表空間的ts#號
8) SSOLDERRCNT:Identifies the number of times the error ORA-01555 occurred.
出現ORA-01555錯誤的次數
##################################################################
3 示例
##################################################################
alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
select begin_time, end_time, undoblks, MAXCONCURRENCY, txncount,MAXQUERYLEN, EXPSTEALCNT, SSOLDERRCNT, undotsn from v$undostat;
SQL> show parameter retention
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_retention integer 10800
SQL> select 10800/3600 from dual;
10800/3600
----------
3
UNDO表空間的監測:
正在使用的undo block.返回的每一行代表一個Extent,每個Extent包含的Blocks數可能為1024,128.64,....
select tablespace_name,segment_name, blocks, bytes/1024, status,BLOCK_ID,BLOCK_ID+blocks-1 from dba_undo_extents where status='ACTIVE';
or
select tablespace_name, sum(bytes/1024/1024) from dba_undo_extents where status='ACTIVE' group by tablespace_name;
select begin_time, end_time, UNDOBLKS ten, ((undoblks*6*3)*8*1.5)/1024/1024 undo_size, TXNCOUNT,MAXQUERYLEN,MAXCONCURRENCY
from v$undostat
order by undoblks desc ;
6 -- 一小時 6 * 10
3 --- 為undo_retention時間.
8 --- blocksize=8k
1.5 --為預估1.5倍空間
從這裡可以預估undo表空間size 大小.
參考文件<
##################################################################
1 Overview
##################################################################
V$UNDOSTAT displays a histogram of statistical data to show how well the system is working. The available statistics include undo space consumption, transaction
concurrency, and length of queries executed in the instance. You can use this view to estimate the amount of undo space required for the current workload. Oracle uses this view to tune undo usage in the system. The view returns null values if the system is in manual undo management mode. Each row in the view keeps statistics collected in the instance for a 10-minute interval. The rows are in descending order by the BEGIN_TIME column value. Each row belongs to the time interval marked by (BEGIN_TIME, END_TIME). Each column represents the data collected for the particular statistic in that time interval. The first row of the view contains statistics for the (partial) current time period. The view contains a total of 1008 rows, spanning a 7 day cycle.
(這個檢視可以統計undo表空間的使用情況,事務的併發度,查詢語句的執行時間。透過這個檢視可以估算undo表空間的適合大小。
預設情況下每隔10Min取樣一次資料,共保留7 days)
##################################################################
2 Useful Columns for v$undostat
##################################################################
1) End_time: End time for each ten minute interval
2) UNDOBLKS: The total number of undo blocks consumed.
3) MAXCONCURRENCY: Maximum number of transactions executed concurrently.
(最大的併發度)
4) TXNCOUNT: Total number of transactions executed within the interval.
(間隔期間內總共的事務數)
5) MAXQUERYLEN: Maximum length of queries, in seconds executed in the instance
(最長的查詢時間)
6) EXPSTEALCNT: Number of times an undo extent must be transferred from one undo segment to another within the interval.
(undo extent出現Segment遷移的次數,什麼時候會出現這種情況呢?)
7) UNDOTSN: undo tablespaces in service during each time period
undo表空間的ts#號
8) SSOLDERRCNT:Identifies the number of times the error ORA-01555 occurred.
出現ORA-01555錯誤的次數
##################################################################
3 示例
##################################################################
alter session set nls_date_format='YYYY-MM-DD HH24:MI:SS';
select begin_time, end_time, undoblks, MAXCONCURRENCY, txncount,MAXQUERYLEN, EXPSTEALCNT, SSOLDERRCNT, undotsn from v$undostat;
SQL> show parameter retention
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_retention integer 10800
SQL> select 10800/3600 from dual;
10800/3600
----------
3
UNDO表空間的監測:
正在使用的undo block.返回的每一行代表一個Extent,每個Extent包含的Blocks數可能為1024,128.64,....
select tablespace_name,segment_name, blocks, bytes/1024, status,BLOCK_ID,BLOCK_ID+blocks-1 from dba_undo_extents where status='ACTIVE';
or
select tablespace_name, sum(bytes/1024/1024) from dba_undo_extents where status='ACTIVE' group by tablespace_name;
select begin_time, end_time, UNDOBLKS ten, ((undoblks*6*3)*8*1.5)/1024/1024 undo_size, TXNCOUNT,MAXQUERYLEN,MAXCONCURRENCY
from v$undostat
order by undoblks desc ;
6 -- 一小時 6 * 10
3 --- 為undo_retention時間.
8 --- blocksize=8k
1.5 --為預估1.5倍空間
從這裡可以預估undo表空間size 大小.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10248702/viewspace-669514/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle動態效能檢視學習筆記(1)_v$sysstatOracle筆記
- Oracle動態效能檢視學習筆記(4)_v$rollstatOracle筆記
- Oracle動態效能檢視學習筆記(6)_v$filestatOracle筆記
- Oracle動態效能檢視學習筆記(7)_v$sessionOracle筆記Session
- Oracle動態效能檢視學習筆記(4)_v$waitstatOracle筆記AI
- Oracle動態效能檢視學習筆記(8)_v$waitstatOracle筆記AI
- (轉):學習Oracle動態效能表-(21)-V$UNDOSTATOracle
- 學習動態效能表(19)--V$UNDOSTAT
- Oracle動態效能檢視學習筆記(9)_v$system_eventOracle筆記
- Oracle動態效能檢視學習筆記(10)_v$session_waitOracle筆記SessionAI
- Oracle動態效能檢視學習筆記(2)_v$sesstat_v$mystat_v$statnameOracle筆記
- Oracle動態效能檢視學習之v$sqltext & v$sqlareaOracleSQL
- (轉)Oracle動態效能檢視學習之v$processOracle
- Oracle動態效能檢視學習之 V$ROLLSTAT -- 轉Oracle
- Oracle動態效能檢視學習之v$lock & v$locked_objectOracleObject
- (轉)Oracle動態效能檢視學習之V$DB_OBJECT_CACHEOracleObject
- Oracle效能優化視訊學習筆記-動態調整SGAOracle優化筆記
- V$PGASTAT動態效能檢視AST
- 學習oracle動態效能表--v$transactionOracle
- (轉)學習Oracle動態效能表-(3)V$LOCK,V$LOCKED_OBJECTOracleObject
- oracle學習筆記——檢視、索引Oracle筆記索引
- Oracle檢視:常用動態效能檢視Oracle
- (轉)Oracle 動態效能檢視Oracle
- oracle 學習筆記---效能優化(3)Oracle筆記優化
- 動態檢視V$SESSION_LONGOPS學習SessionGo
- Oracle動態效能檢視之v$session_longops ztOracleSessionGo
- Oracle的v$動態檢視 收藏Oracle
- (轉):學習Oracle動態效能表-(7)-V$SQLTEXT,V$SQLAREAOracleSQL
- [轉]學習Oracle動態效能表-(6)-V$SQLTEXT,V$SQLAREAOracleSQL
- (轉):學習Oracle動態效能表-(12)-V$PROCESSOracle
- (轉):學習Oracle動態效能表-(10)-V$FILESTATOracle
- (轉):學習Oracle動態效能表-(8)-V$SESSIONOracleSession
- (轉):學習Oracle動態效能表-(5)-V$SESSTATOracle
- (轉)學習Oracle動態效能表-(4)-V$SYSSTATOracle
- (轉):學習Oracle動態效能表-(2)-V$SQLTEXTOracleSQL
- (轉):學習Oracle動態效能表-(1)-V$SQLAREAOracleSQL
- (轉):學習Oracle動態效能表-(19)-v$rowcacheOracle
- (轉):學習Oracle動態效能表-(18)-V$ROLLSTATOracle