【脚本分享】表空间每天的使用情况

来源:互联网 发布:激活windows 编辑:程序博客网 时间:2024/05/21 14:54

表空间近一个月的使用情况:

 

今天有网友问,如何查询近一个月的表空间使用情况:

select a.name, b.*  from v$tablespace a,       (select tablespace_id,               trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) datetime,               max(tablespace_usedsize * 8 / 1024) used_size          from dba_hist_tbspc_space_usage         where trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) >               trunc(sysdate - 30) groupby tablespace_id,         trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) orderby         tablespace_id, trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss'))) b where a.ts# = b.tablespace_id


原创粉丝点击