Oracle數據庫容量使用情況調查


-- 剩余容量
select sum(bytes) FREE from DBA_FREE_SPACE where tablespace_name ='xxx';
-- 總容量
select sum(bytes) TOTAL from DBA_DATA_FILES where tablespace_name ='xxx';

 

查詢整個數據庫剩余和使用的表空間大小使用情況:

select df.tablespace_name "表空間名",totalspace "總空間M",freespace "剩余空間M",round((1-freespace/totalspace)*100,2) "使用率%" 
from 
(select tablespace_name,round(sum(bytes)/1024/1024) totalspace 
from dba_data_files 
group by tablespace_name) df, 
(select tablespace_name,round(sum(bytes)/1024/1024) freespace 
from dba_free_space 
group by tablespace_name) fs 
where df.tablespace_name=fs.tablespace_name;

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM