oracle_基础八(Undo)
来源:互联网 发布:pyqt5 知乎编程 编辑:程序博客网 时间:2024/06/01 01:33
Auto Undo Mgmt: Concepts
1.Undo data is managed using an UNDO tablespace.
2.You allocate one UNDO tablespace per instance with enough space for the workload of the instance.
3.The Oracle server automatically maintains undo data within the UNDO tablespace
Auto undo Mgmt: config
1.configure two parameters in the initailization file:
a.UNDO_MANAGEMENT //推荐设置为auto
b.UNDO_TABLESPACE
2.Create at least one UNDO tablespace
AUM: Init Parameters
1.UNDO_MANAGEMENT: Specifies whether the system should use AUTO or MANUAL mode
2.UNDO_TABLESPACE: specifies a particular UNDO TABLEspace to be used
UNDO_MANAEMENT=AUTOUNDO_TABLESPACE=UNDOTBS
CREATE DATABASE db01 ...UNDO_TABLESPACE undo1DATAFILE '/u01/....undodb01.dbf' SIZE 40M AUTOEXTEND ONCREATE UNDO TABLESPACE undo1 DATAFILE '/u01/.../undodb01.dbf' SIZE 20M
</pre><pre class="sql" name="code">ALTER TABLESPACE undotbs ADD DATAFILE '/u01/oradata/undotbs2.dbf' SIZE 30M AUTOEXTEND ON
AUM: Switching UNDO TS
1.you can switch form using one UNDO tablespace to another.
2.Only one UNDO tablespace can be in assigned to a database at a time
3. More than one UNDO tablespace may exist within an instance , but only one can be active
4. Use the ALTER SYSTEM command for dynamic switching between UNDO tablespaces
ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS
AUM: Dropping an UNDO TS
DROP TABLESPACE UNDOTBS2
1.An UNDO tablespace can only be dropped if it is currently not in use by any instance.
2.To drop an active UNDO tablespace:
a.Switch to new UNDO tablespace
b. Drop the tablespace after all current transactions are complete.
UNDO_RETENTION :This parameter controls the amount of undo data to retain for consistent read.
v$transaction 其中 USED_UBLK 说明该事务使用的undo 数据块
可以根据这个表来算每秒中需要多少undo空间, 然后综合UNDO_RETENTION就是需要的undo表空间
select max(undoblks/((end_time-begin_time)*24*3600)) from v$undostat; 一般用这种
select sum(undoblks) /sum((end_time-begin_time)*24*3600) from v$undostat
show parameter undo_retention ;
show parameter db_block_size
AUM:Sizing an UNDO TS
Determing a size for theUNDO tablespace requires three pieces of information:
1.(UR) UNDO_RETENTION in seconds
2.(UPS) Number of undo data blocks generated per second
3.(DBS) Overhead varies based on extent and file size (db_block_size)
AUM: Altering an UNDO TS
1.The ALTER TABLESPACE command can make changes to UNDO tablespaces
2. The following example adds another data file to the UNDO tablespace:
ALTER TABLESPACE undotbs ADD DATAFILE '/u01/oradata/undotbs2.dbf' SIZE 30M AUTOEXTEND ON;
AUM:Undo Quota
1.Long transactions and improperly written transactions can consume valuable resources.
2.With undo quota, users can be grouped and a maximum undo space limit can be assigned to the group
3. UNDO_POOL a Resource Manager directive, defines the amount of space allowed for a resource group.
4.When a group excessds its limit , no new transactions are possible for the group , until undo space is freed by current transactions which are either completing or aborting
Get Undo Segment Info
1.Information about undo segments can be obtained by querying the following views:
a.DBA_ROLLBACK_SEGS //所有的segment
2.Dynamic Performance Views
V$ROLLNAME //在线的segment信息
V$ROLLSTAT //在线的segment统计信息
V$UNDOSTAT
V$SESSION
V$TRANSACTION
select segment_name, tablespace_name from dba_rollback_segs;
- oracle_基础八(Undo)
- SQL/ORACLE_基础英语词汇
- 基础oracle_创建
- ORACLE_基础九(Tables)
- ORACLE_基础十(index)
- ORACLE_基础十二(Profiles)
- ORACLE_基础十三(user)
- UNDO管理之一:UNDO基础
- ORACLE_基础十四(Privileges Auditing)
- ORACLE_基础十九(Backup Recovery)
- undo基础内容
- undo基础内容
- undo基础内容
- UNDO管理之二:UNDO基础
- Oracle_面向服务体系结构的基础
- ORACLE_基础二十(Archiving Mode)
- ORACLE_基础二十二(User-Managed Backup)
- ORACLE_基础二十三(User-Managed Recovery)
- tomcat加载Listener,Filter,Servlet顺序
- Socket编程笔记
- Ibatis 批量操作 和 三级下拉框连动问题
- Socket网络编程入门
- 矩阵(n阶方阵)的初等变换 初等矩阵 几何意义
- oracle_基础八(Undo)
- Phone List 南邮NOJ 1522
- 最傻的人是我
- 蓝桥杯那些事
- 算法导论 第18章 B 树
- 统计源代码文件的总行数、空行数、注释行数、代码行数
- 将一个二叉树镜像
- 【R for fun 系列】汉诺塔
- C++ 运算结果出现 1.#IND, 1.#INF nan, inf 原因