• 脚本:监控临时表空间使用率


    针对字典管理临时表空间:
    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
    
  • 相关阅读:
    awk
    Python自动化开发之python的常用模块
    sed
    python自动化开发-8
    正则表达式-2-正则表达式实战1
    linux之sort和uniq
    SSH免密登录
    Docker下安装Mongodb
    Docker下安装Elasticsearch
    Docker下安装RabbitMQ
  • 原文地址:https://www.cnblogs.com/macleanoracle/p/2967257.html
Copyright © 2020-2023  润新知