Chinaunix首页 | 论坛 | 博客
  • 博客访问: 49895
  • 博文数量: 13
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 141
  • 用 户 组: 普通用户
  • 注册时间: 2013-04-23 09:08
个人简介

屌丝逆袭中!!!

文章分类

全部博文(13)

文章存档

2014年(8)

2013年(5)

我的朋友

分类: Oracle

2014-08-01 10:32:48

  undo表空间,也成为撤销表空间(undo_management设置决定是否使用撤销段),保证acid原则,读一致性与隔离性实现的关键因素。撤销表空间应该足够大,这样才能存储最坏情况下并发事物生成的所有撤销数据,这些数据是活动的撤销数据以及运行时间最长的查询所需的足够的未过期撤销数据。这个算法很简单:首先在最高工作负荷时生成撤销的速度,然后乘以耗时最长的查询的时间长度。可通过v$undostat获得所需信息。v$undostat视图各列如下:
BEGIN_TIME DATE Identifies the beginning of the time interval
END_TIME DATE Identifies the end of the time interval
UNDOTSN NUMBER Represents the last active undo tablespace in the duration of time. The tablespace ID of the active undo tablespace is returned in this column. If more than one undo tablespace was active in that period, the active undo tablespace that was active at the end of the period is reported.
UNDOBLKS NUMBER 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 NUMBER Identifies the total number of transactions executed within the period
MAXQUERYLEN NUMBER 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 reflected in the view.
MAXQUERYID VARCHAR2(13) SQL identifier of the longest running SQL statement in the period
MAXCONCURRENCY NUMBER Identifies the highest number of transactions executed concurrently within the period
UNXPSTEALCNT NUMBER Number of attempts to obtain undo space by stealing unexpired extents from other transactions
UNXPBLKRELCNT NUMBER Number of unexpired blocks removed from certain undo segments so they can be used by other transactions
UNXPBLKREUCNT NUMBER Number of unexpired undo blocks reused by transactions
EXPSTEALCNT NUMBER Number of attempts to steal expired undo blocks from other undo segments
EXPBLKRELCNT NUMBER Number of expired undo blocks stolen from other undo segments
EXPBLKREUCNT NUMBER Number of expired undo blocks reused within the same undo segments
SSOLDERRCNT NUMBER Identifies the number of times the error ORA-01555 occurred. You can use this statistic to decide whether or not the UNDO_RETENTION initialization parameter is set properly given the size of the undo tablespace. Increasing the value of UNDO_RETENTION can reduce the occurrence of this error.
NOSPACEERRCNT NUMBER Identifies the number of times space was requested in the undo tablespace and there was no free space available. That is, all of the space in the undo tablespace was in use by active transactions. The corrective action is to add more space to the undo tablespace.
ACTIVEBLKS NUMBER Total number of blocks in the active extents of the undo tablespace for the instance at the sampled time in the period
UNEXPIREDBLKS NUMBER Total number of blocks in the unexpired extents of the undo tablespace for the instance at the sampled time in the period
EXPIREDBLKS NUMBER Total number of blocks in the expired extents of the undo tablespace for the instance at the sampled time in the period
TUNED_UNDORETENTION NUMBER System tuned value indicating the period for which undo is being retained
其中UNDOBLKS和MAXQUERYLEN可分别获得消耗速度和最大查询时长。具体算法:
SELECT (UR * (UPS * DBS)) + (DBS * 24) AS "Bytes" FROM (SELECT value AS UR  FROM v$parameter WHERE name = 'undo_retention'),(SELECT (SUM(undoblks)/SUM(((end_time -begin_time)*86400))) AS UPS  FROM v$undostat),  (SELECT value AS DBS FROM v$parameter  WHERE name = 'db_block_size');
阅读(1233) | 评论(0) | 转发(0) |
0

上一篇:Oracle database 11g rac损坏ocr和votedisk恢复实验

下一篇:没有了

给主人留下些什么吧!~~