Quick & Dirty: AWR Query for Tablespace groth

The query:

select
  rtime as time,
  sn.snap_id,
  ts.name,
  round(tablespace_size*tsb.block_size/1024/1024,0) SIZE_MB,
  round(tablespace_maxsize*tsb.block_size/1024/1024,0) MAXSIZE_MB,
  round(tablespace_usedsize *tsb.block_size/1024/1024,0) USEDSIZE_MB
from
  dba_hist_tbspc_space_usage tsu,
  v$tablespace ts,
  dba_hist_snapshot sn,
  dba_tablespaces tsb
where
  tsu.tablespace_id=ts.ts#
  and sn.snap_id= tsu.snap_id
  --and ts.name='USERS'
  and tsb.tablespace_name=ts.name
order by
sn.snap_id desc, tablespace_name;

 

Sample output;

TIME                 SNAP_ID  NAME      SIZE_MB   MAXSIZE_MB   USEDSIZE_MB
07/01/2013 11:00:30    644    SYSAUX    64000     65536        2154
07/01/2013 11:00:30    644    SYSTEM    6144      8192         2884
07/01/2013 11:00:30    644    TOOLS     100       65536        1
07/01/2013 11:00:30    644    UNDOTBS1  65535     65535        54
07/01/2013 11:00:30    644    USERS     8         8            7
07/01/2013 10:00:28    643    SYSAUX    64000     65536        2154
07/01/2013 10:00:28    643    SYSTEM    6144      8192         2884
07/01/2013 10:00:28    643    TOOLS     100       65536        1
07/01/2013 10:00:28    643    UNDOTBS1  65535     65535        58
07/01/2013 10:00:28    643    USERS     8         8            7
This entry was posted in Oracle in general. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *