脚本:监控临时表空间使用率
针对字典管理临时表空间:
select (s.tot_used_blocks/f.total_blocks)*100 as "percent used" from (select sum(used_blocks) tot_used_blocks from v$sort_segment where tablespace_name='TEMP') s, (select sum(blocks) total_blocks from dba_data_files where tablespace_name='TEMP') f;针对本地管理表空间:
select (s.tot_used_blocks/f.total_blocks)*100 as "percent used" from (select sum(used_blocks) tot_used_blocks from v$sort_segment where tablespace_name='TEMP') s, (select sum(blocks) total_blocks from dba_temp_files where tablespace_name='TEMP') f;示例输出:
select (s.tot_used_blocks/f.total_blocks)*100 as "percent used"
2 from (select sum(used_blocks) tot_used_blocks from
v$sort_segment where tablespace_name='TEMP') s,
(select sum(blocks) total_blocks from dba_temp_files where tablespace_name='TEMP') f;
percent used
------------
0
posted on 2009-04-13 19:25 Oracle和MySQL 阅读(328) 评论(0) 收藏 举报

2群基础群 适合刚入门的同学,会共享最佳入门实践和资料 QQ群 # QQ群号:171092051 # 已经升级到 500人的超级群,空位多多,无需面试
浙公网安备 33010602011771号