小編給大家分享一下如何檢查Undo表空間使用情況,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!
我們提供的服務(wù)有:成都網(wǎng)站制作、網(wǎng)站建設(shè)、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、新都ssl等。為數(shù)千家企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的新都網(wǎng)站制作公司
######腳本###########
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.
以上是“如何檢查Undo表空間使用情況”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!