常用sql语句–表空间使用情况历史记录

语句中的{tablespace_name}根据实际情况修改为表空间名称

select ff.rtime,
       ee.name,
       ff.tablespace_size *
       (select value from v$parameter where name = 'db_block_size') / 1024 / 1024 tablespace_sizemb,
       ff.tablespace_usedsize *
       (select value from v$parameter where name = 'db_block_size') / 1024 / 1024 tablespace_usedsize_mb,
       ff.tablespace_maxsize *
       (select value from v$parameter where name = 'db_block_size') / 1024 / 1024 tablespace_maxsize_mb
  from dba_hist_tbspc_space_usage ff, v$tablespace ee
 where rtime > to_char(sysdate - 90)
   and ee.TS# = ff.tablespace_id
   and ee.NAME = {tablespace_name}
 order by rtime;

Related Posts