Oracle查询临时表空间
1、查看临时表分区
SELECT * FROM (SELECT USERNAME, SESSION_ADDR, SQL_ID, CONTENTS, SEGTYPE, BLOCKS * 8 / 1024 / 1024 GB FROM V$SORT_USAGE ORDER BY BLOCKS DESC) WHERE ROWNUM <= 200;
2、查看临时表空间
select * from (Select a.tablespace_name, to_char(a.bytes / 1024 / 1024, '99,999.999') total_bytes, to_char(b.bytes / 1024 / 1024, '99,999.999') free_bytes, to_char(a.bytes / 1024 / 1024 - b.bytes / 1024 / 1024, '99,999.999') use_bytes, to_char((1 - b.bytes / a.bytes) * 100, '99.99') || '%' use from (select tablespace_name, sum(bytes) bytes from dba_data_files group by tablespace_name) a, (select tablespace_name, sum(bytes) bytes from dba_free_space group by tablespace_name) b where a.tablespace_name = b.tablespace_name union all select c.tablespace_name, to_char(c.bytes / 1024 / 1024, '99,999.999') total_bytes, to_char((c.bytes - d.bytes_used) / 1024 / 1024, '99,999.999') free_bytes, to_char(d.bytes_used / 1024 / 1024, '99,999.999') use_bytes, to_char(d.bytes_used * 100 / c.bytes, '99.99') || '%' use from (select tablespace_name, sum(bytes) bytes from dba_temp_files group by tablespace_name) c, (select tablespace_name, sum(bytes_cached) bytes_used from v$temp_extent_pool group by tablespace_name) d where c.tablespace_name = d.tablespace_name) order by tablespace_name ;
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步