0
点赞
收藏
分享

微信扫一扫

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

橙子好吃吗 2022-07-14 阅读 36

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 / 1024) USED_G
from dba_hist_tbspc_space_usage
where trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) >
trunc(sysdate - 30)
group by tablespace_id,
trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss'))
order by tablespace_id,
trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss'))) b
where a.ts# = b.tablespace_id
and a.NAME = 'AI_DATA'

 

select a.name, b.*
from v$tablespace a,
(select tablespace_id,
trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) datetime,
ROUND(max(tablespace_usedsize * 8 / 1024 / 1024), 2) USED_G
from dba_hist_tbspc_space_usage
where trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss')) >
trunc(sysdate - 30)
group by tablespace_id,
trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss'))
order by tablespace_id,
trunc(to_date(rtime, 'mm/dd/yyyy hh24:mi:ss'))) b
where a.ts# = b.tablespace_id
and a.NAME = 'CM_IDX'

日积月累



举报

相关推荐

0 条评论