以下のSQLを実施する。
粒度は、snapshotが取られる間隔に依存する。
select v.name
,h.snap_id
, h.tablespace_size * p.value/1024/1024 ts_mb
, h.tablespace_usedsize * p.value/1024/1024 used_mb
, h.rtime
, to_char(s.begin_interval_time, 'YYYY-MM-DD HH24:MI:SS') begin_time
, to_char(s.end_interval_time, 'YYYY-MM-DD HH24:MI:SS') end_time
from dba_hist_tbspc_space_usage h
, dba_hist_snapshot s
, v$tablespace v
, dba_tablespaces t
, v$parameter p
where h.tablespace_id = v.ts#
and v.name = t.tablespace_name
and t.contents not in ('UNDO','TEMPORARY')
and p.name = 'db_block_size'
and h.snap_id = s.snap_id
and s.begin_interval_time
-- Start time
between to_date('2024-04-22 11:00:00','YYYY-MM-DD HH24:MI:SS')
-- End time
and to_date('2024-04-22 18:00:00','YYYY-MM-DD HH24:MI:SS')
-- specify tablespace
and v.name in ('USERS')
order by v.name, h.snap_id asc;
以下のブログを参考にしました。
https://www.pythian.com/blog/technical-track/how-to-retrieve-growth-history-for-oracle-tablespaces