star870126 发表于 2018-9-13 10:43:29

查询oracle表空间增长情况

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)
  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

页: [1]
查看完整版本: 查询oracle表空间增长情况