检查Undo表空间使用情况

######脚本###########

SELECT TABLESPACE_NAME, ROUND ( (USED / TOTAL_SIZE) * 100, 2) USED_RATE
  FROM (SELECT A.TABLESPACE_NAME, TOTAL_SIZE, USED
          FROM (  SELECT TABLESPACE_NAME,
                         ROUND (SUM (BYTES) / 1024 / 1024 / 1024, 2) TOTAL_SIZE
                    FROM DBA_DATA_FILES
                   WHERE 1 = 1 AND TABLESPACE_NAME LIKE 'UNDOTBS%'
                GROUP BY TABLESPACE_NAME) A,
               (  SELECT TABLESPACE_NAME,
                         ROUND (SUM (BYTES) / 1024 / 1024 / 1024, 2) USED
                    FROM DBA_UNDO_EXTENTS
                   WHERE 1 = 1 AND STATUS = 'UNEXPIRED'
                GROUP BY TABLESPACE_NAME) B
         WHERE 1 = 1 AND A.TABLESPACE_NAME = B.TABLESPACE_NAME);

------------------------------------------------------------------------------------------------------------------

The Expired blocks will be reused and hence this should be counted as 'available' space in the Undo segment.

You can check the status of the undo extents via the SQLs below.
select sum(bytes /(1024*1024)) from dba_undo_extents where status='EXPIRED';
select sum(bytes /(1024*1024)) from dba_undo_extents where status='ACTIVE';
select sum(bytes /(1024*1024)) from dba_undo_extents where status='UNEXPIRED';

For more detailed information, please refer to:
Master Note: High Undo Space Usage ( Doc ID 1578639.1 )

Above all, if the undo status is Expired, you can safely ignore the undo usage, as the space will be reused automatically.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31401608/viewspace-2148937/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31401608/viewspace-2148937/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值