oracle 回滚段介绍(三)
所用数据字典:DBA_ROLLBACK_SEGS
Column
|
Datatype
|
NULL
|
Description
|
SEGMENT_NAME
|
VARCHAR2(30)
|
NOT NULL
|
Name of the rollback segment
|
OWNER
|
VARCHAR2(6)
|
|
Owner of the rollback segment
|
TABLESPACE_NAME
|
VARCHAR2(30)
|
NOT NULL
|
Name of the tablespace containing the rollback segment
|
SEGMENT_ID
|
NUMBER
|
NOT NULL
|
ID number of the rollback segment
|
FILE_ID
|
NUMBER
|
NOT NULL
|
File identifier number of the file containing the segment head
|
BLOCK_ID
|
NUMBER
|
NOT NULL
|
ID number of the block containing the segment header
|
INITIAL_EXTENT
|
NUMBER
|
|
Initial extent size in bytes
|
NEXT_EXTENT
|
NUMBER
|
|
Secondary extent size in bytes
|
MIN_EXTENTS
|
NUMBER
|
NOT NULL
|
Minimum number of extents
|
MAX_EXTENTS
|
NUMBER
|
NOT NULL
|
Maximum number of extent
|
PCT_INCREASE
|
NUMBER
|
NOT NULL
|
Percent increase for extent size
|
STATUS
|
VARCHAR2(16)
|
|
Rollback segment status
|
INSTANCE_NUM
|
VARCHAR2(40)
|
|
Rollback segment owning Oracle Real Application Cluster instance number
|
RELATIVE_FNO
|
NUMBER
|
NOT NULL
|
Relative file number of the segment header
|
可以查询的信息:回滚段的标识(SEGMENT_ID)、名称(SEGMENT_NAME)、所在表空间(TABLESPACE_NAME)、类型(OWNER)、状态(STATUS)。
例:
SQL>SELECT segment_name,tablespace_name,owner,status FROM dba_rollback_segs;
回滚段的统计信息
数据字典:V$ROLLNAME,V$ROLLSTAT
Column
|
Datatype
|
Description
|
USN
|
NUMBER
|
Rollback segment number
|
LATCH
|
NUMBER
|
Latch for the rollback segment
|
EXTENTS
|
NUMBER
|
Number of extents in the rollback segment
|
RSSIZE
|
NUMBER
|
Size (in bytes) of the rollback segment. This value differs by the number of bytes in one database block from the value of the BYTES column of the ALL/DBA/USER_SEGMENTS views.
See Also: Oracle9i Database Administrator's Guide.
|
WRITES
|
NUMBER
|
Number of bytes written to the rollback segment
|
XACTS
|
NUMBER
|
Number of active transactions
|
GETS
|
NUMBER
|
Number of header gets
|
WAITS
|
NUMBER
|
Number of header waits
|
OPTSIZE
|
NUMBER
|
Optimal size of the rollback segment
|
HWMSIZE
|
NUMBER
|
High water mark of rollback segment size
|
SHRINKS
|
NUMBER
|
Number of times the size of a rollback segment decreases
|
WRAPS
|
NUMBER
|
Number of times rollback segment is wrapped
|
EXTENDS
|
NUMBER
|
Number of times rollback segment size is extended
|
AVESHRINK
|
NUMBER
|
Average shrink size
|
AVEACTIVE
|
NUMBER
|
Current size of active extents, averaged over time.
|
STATUS
|
VARCHAR2(15)
|
Rollback segment status:
|
CUREXT
|
NUMBER
|
Current extent
|
CURBLK
|
NUMBER
|
Current block
|
SQL>SELECT n.name,s.extents,s.rssize,s.optsize,s.hwmsize,s.xacts,s.status
FROM v$rollname n,v$rollstat s
WHERE n.usn=s.usn;
数据字典:v$undostat
Column
|
Datatype
|
Description
|
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 number of seconds) executed in the instance during the period. You can use this statistic to estimate the proper setting of the UNDO_RETENTION initialization parameter.
|
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.
|
数据字典:V$SESSION,V$TRANSACTION
例:
SQL>SELECT s.username,t.xidusn,t.ubafil,t.ubablk,t.used_ublk
FROM v$session s,v$transaction t
WHERE s.saddr=t.ses_addr;
USERNAME XIDUSN UBAFIL UBABLK USED_UBLK
------- -------- ----------- ----------- -----------
SYSTEM 2 2 7 1
SCOTT 1 2 163 1
2 rows selected.
对于OLTP系统,存在大量的小事务处理,一般建议:
数量多的小回滚段;每四个事务一个回滚段;每个回滚段不要超过十个事务。
对于批处理,一般建议:
少的大回滚段;每个事务一个回滚段。
回滚段的问题及解决方法
问题一:事务要求的回滚段空间不够,表现为表空间用满(ORA-01560错误),回滚段扩展到达参数MAXEXTENTS的值(ORA-01628)。
解决方法:向回滚段表空间添加文件或使已有的文件变大;增加MAXEXTENTS的值。
问题二:读一致性错误(ORA-01555 SNAPSHOT TOO OLD)
解决方法:增加MINEXTENTS的值,增加区的大小,设置一个高的OPTIMAL值。
转载于:https://blog.51cto.com/31216/144575
oracle 回滚段介绍(三)相关推荐
- ORACLE 回滚段详解
ORACLE 回滚段 回滚段概述 回滚段用于存放数据修改之前的值(包括数据修改之前的位置和值).回滚段的头部包含正在使用的该回滚段事务的信息.一个事务只能使用一个回滚段来存放它的回滚信息,而一个 ...
- ORACLE回滚段管理(上)
回滚段管理一直是ORACLE数据库管理的一个难题,本文通过实例介绍ORACLE回滚段的概念, 用法和规划及问题的解决. 回滚段概述 回滚段用于存放数据修改之前的值(包括数据修改之前的位置和值).回滚段 ...
- ORACLE回滚段管理
回滚段管理一直是ORACLE数据库管理的一个难题,本文通过实例介绍ORACLE回滚段的概念,用法和规划及问题的解决. 回滚段概述 回滚段用于存放数据修改之前的值(包括数据修改之前的位置和值).回滚段的 ...
- oracle回滚断查询,Oracle回滚段使用查询代码详解
大批量执行DML语句造成回滚段大量占用,又回退操作,如何直观查询数据回滚情况? 单机环境 查询回滚执行进度 sql;"> select /*+ rule */s.sid,r.name ...
- oracle回滚段创建,Oracle回滚段管理
Oracle回滚段管理 回滚段管理一直是ORACLE数据库管理的一个难题,本文通过实例介绍ORACLE回滚段的概念 回滚段概述 回滚段用于存放数据修改之前的值(包括数据修改之前的位置和值).回滚段的头 ...
- 深入解析oracle回滚段
深入解析oracle的回滚段 日前在整理数据库表空间的是否,发现最大的数据文件来自回滚段.回滚段文件undotbs1的数据文件已经达到23G. 希望清理这部分数据,但一时又无从下手.于是决定深入了解一 ...
- oracle一个循环中回滚继续,oracle回滚段
http://hi.baidu.com/ipeipei/blog/item/34f84316f7126d4a20a4e950.html 1. 概述 本文主要从回滚段的原理,分配和使用,以及回滚段的相关 ...
- oracle 回滚空间查询,oracle回滚段和回滚表空间操作
1.查询回滚段信息:状态为ONLINE,当前UNDO表空间为undotbs1 SQL>select segment_name, owner, tablespace_name, status fr ...
- Oracle - 回滚段
一直以来对回滚段的理解都不是很清晰,更谈不上深入.今天偶然在网上看到了一篇文章,比较浅显易懂地阐述了回滚段的概念,用法和规划及问题的解决,这里主要摘录一下概念部分,以及日常管理的内容和常见问题的解决, ...
最新文章
- 第一次胜过MobileNet的二值神经网络,-1与+1的三年艰苦跋涉
- python字典可以切片吗_7.map(感觉跟python中的字典有点像)数组,切片(make)傻傻分不清楚,多多指点...
- 全球规模最大的全浸没式液冷数据中心落户杭州余杭
- matlab求解多项式系数,C++和MATLAB混合编程求解多项式系数(矩阵相除)
- Python | Pyplot标签
- three.js(五) 地形纹理混合
- 繁体字_如何简单快速地批量认识繁体字?
- 23个小动作让你记忆力惊人
- 让一让,神州泰岳要进化了
- TypeScript 令我苦不堪言
- 用递归解决冒泡排序问题
- 在 Ubuntu 中使用 GDebi 快速安装 DEB 包
- 放之四海皆适用的设计原则(一)
- 为什么使用nginx反向代理
- 给Activity设置背景色
- Python图像灰度化处理
- 解决安装软件时出现的error1723,以安装破解版Endnote X9为例(附资源)
- 如何制作一个简易的家庭记账系统
- VMWare虚拟机启动失败,显示intel VT-X处于禁用状态
- [我是面试官系列]如何判断一个人的执行力?
热门文章
- 部署node.js的开发环境
- 游戏中反向运动学(ik)的研究与简介
- ASP.NET在IIS上部署使用Oracle数据库无法连接数据库解决方法
- 引入js失败的可能原因
- [BTS06]BizTalk2006 SDK阅读笔记(五) 管道-Pipeline
- mysql8.0.18ZIP版下载与安装(以及无my-default.ini文件和data文件夹的解决方法)
- 分布式系统一致性问题解决实战
- C#操作FTP报错,远程服务器返回错误:(550)文件不可用(例如,未找到文件,无法访问文件)的解决方法
- Amqp整合com.rabbitmq.client.ShutdownSignalException: channel error; protocol method异常处理
- 解决eclipse+MAVEN提示One or more constraints have not been satisfied.的问题