oracle 查询表空间使用情况


SELECT a.tablespace_name "表空间名",
FILENUM 数据文件,
round(total / (1024 * 1024 * 1024),2) "表空间大小(G)",
round(free / (1024 * 1024 * 1024),2) "表空间剩余大小(G)",
round((total - free) / (1024 * 1024 * 1024),2) "表空间使用大小(G)",
round((total - free) / total, 4) * 100 "使用率 %"
FROM (SELECT tablespace_name, SUM(bytes) free FROM dba_free_space GROUP BY tablespace_name) a,
(SELECT tablespace_name,COUNT(FILE_ID) FILENUM,SUM(bytes) total FROM dba_data_files GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name;


select * from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';
select tablespace_name, bytes, user_bytes, user_bytes/bytes,file_name from dba_temp_files;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM