博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UNDO 100%
阅读量:4615 次
发布时间:2019-06-09

本文共 3097 字,大约阅读时间需要 10 分钟。

另外查了下v$undostat,发现begin_time已经很久没有改变,

BEGIN_TIME           END_TIME             MAXQUERYLEN MAXCONCURRENCY UNEXPIREDBLKS EXPIREDBLKS

BEGIN_TIME DATE Identifies the beginning of the time interval

unexpired的在retention guarantee没有启用的情况下,可以看作是free的,你这里还有2g多的可用空间,99%看到的是假象

select sum(bytes),status from dba_undo_extents group by status;
select sid,USED_UBLK from v$transaction a,v$session b where a.addr=b.taddr;

dba_undo_extents:描述了extents包括在所有的undo表空间中的segments

SQL> select sum(bytes),status from dba_undo_extents group by status;

SUM(BYTES) STATUS

---------- ---------
   3670016 UNEXPIRED
1398407168 EXPIRED

 

查看UNDO表空间是否retention guarantee

undo_retention:指定事物commit后undo 将要保存的时间(秒),在ORACLE10g中默认的是900秒。

GUARANTEE : 保证undo_retention参数所设定的时间有效,这个是10g的新功能。

NOGUARANTEE:在没有guarantee的保证下,ORACLE并不能保证能够将undo信息存储900秒,如果undo表空间不足,那么ORACLE将忽略undo_retention的设置,直接覆盖掉以前的undo.

SQL> ALTER TABLESPACE undotbs1 RETENTION GUARANTEE;

SQL> ALTER TABLESPACE undotbs1 RETENTION NOGUARANTEE;

SQL> select tablespace_name,retention from dba_tablespaces where tablespace_name='UNDOTBS1';

TABLESPACE_NAME         RETENTION

------------------------------ -----------
UNDOTBS1         NOGUARANTEE

RETENTION VARCHAR2(11)   Undo tablespace retention:
GUARANTEE - Tablespace is an undo tablespace with RETENTION specified as GUARANTEE
A RETENTION value of GUARANTEE indicates that unexpired undo in all undo segments in the undo tablespace should be retained even if it means that forward going operations that need to generate undo in those segments fail.

NOGUARANTEE - Tablespace is an undo tablespace with RETENTION specified as NOGUARANTEE

SQL> select sum(bytes),status from dba_undo_extents group by status;

SUM(BYTES) STATUS

---------- ---------
   2621440 UNEXPIRED
  32702464 ACTIVE
1384775680 EXPIRED

SQL> select begin_time, END_TIME , MAXQUERYLEN,MAXCONCURRENCY,UNEXPIREDBLKS ,EXPIREDBLKS from v$undostat;

BEGIN_TIM END_TIME  MAXQUERYLEN MAXCONCURRENCY UNEXPIREDBLKS EXPIREDBLKS

--------- --------- ----------- -------------- ------------- -----------
26-FEB-01 26-FEB-01     124       3  3976   169216
26-FEB-01 26-FEB-01     725       0     0   170992
26-FEB-01 26-FEB-01     123       0     0   170992
26-FEB-01 26-FEB-01     725       0     0   170992
26-FEB-01 26-FEB-01    1326       0     0   170992

 

##################################################################################################################

SQL> select tablespace_name,retention from dba_tablespaces where tablespace_name='UNDOTBS1';

TABLESPACE_NAME         RETENTION

------------------------------ -----------
UNDOTBS1         NOGUARANTEE

查看UNDO表空间是否retention guarantee

undo_retention:指定事物commit后undo 将要保存的时间(秒),在ORACLE10g中默认的是900秒。

GUARANTEE : 保证undo_retention参数所设定的时间有效,这个是10g的新功能。

NOGUARANTEE:在没有guarantee的保证下,ORACLE并不能保证能够将undo信息存储900秒,如果undo表空间不足,那么ORACLE将忽略undo_retention的设置,直接覆盖掉以前的undo.

查看实际的UNDO使用率:
select sum(bytes/1024/1024) as free_mb from dba_undo_extents where status in ('UNEXPIRED','EXPIRED');

SQL> select sum(bytes/1024/1024) as free_mb from dba_undo_extents where status in ('UNEXPIRED','EXPIRED');

   FREE_MB

----------
   2026.75

unexpired的在retention guarantee没有启用的情况下,可以看作是free的,你这里还有2g多的可用空间,99%看到的是假象

转载于:https://www.cnblogs.com/zhaoyangjian724/p/3798035.html

你可能感兴趣的文章
技术人的折腾(二)-缺少的东西,你迟早要补起来
查看>>
mysql_select 多表查询
查看>>
排序总结-直接插入排序算法
查看>>
Java程序员面试中的多线程问题
查看>>
Java Thread 多线程 操作线程
查看>>
Java对象在JVM中的生命周期
查看>>
vue+iview-ui 的render函数的使用
查看>>
PAT 乙级 1043 输出PATest
查看>>
Java--多态
查看>>
JS 查找元素
查看>>
LJ 5月6日A组考试考试题解
查看>>
win10下安装es
查看>>
php 8小时时间差的解决方法小结
查看>>
Python3基础系列——枚举类型大揭秘
查看>>
Windows + IIS 环境部署Asp.Net Core App
查看>>
HDU2050
查看>>
正则表达式工具类单例
查看>>
C#图解教程 第十章 结构
查看>>
HDU 4686 Arc of Dream 矩阵
查看>>
微信小程序购物车功能
查看>>