ちょっと長いですが・・・
------------------------
set pagesize 1000
set pause off
set verify off
--
define in_tsname=&tablespace_name
set linesize 100
col tn format a10 heading 'Name' trunc
col fn format a45 heading 'Located in file_ID + File Name'
col bts format a12 heading 'Size'
col used format a12 heading 'Used'
col ex format 9999 headin 'NrExt'
col rs format 999,999,999 heading 'RBSsize'
col init format 9,999,999 heading 'Init'
col next format 9,999,999 heading 'Next'
col mi format 999 heading 'Min'
col ma format 999 heading 'Max'
col pct format 990 heading '%Inc'
col st format a4 heading 'Stat'
col sn format a15 heading 'Segm Name'
col ts format a15 heading 'In Table Space'
select d.tablespace_name tn,
f.file_id||' '||file_name fn,
to_char(f.bytes/1024,'9,999,999')||'K' bts,
to_char( (f.bytes - nvl(s.free_bytes,0))/1024,'9,999,999')||'K' used
from sys.dba_tablespaces d, sys.dba_data_files f,
(select file_id, sum(bytes) free_bytes
from sys.dba_free_space
group by file_id) s
where d.tablespace_name = f.tablespace_name
and f.file_id = s.file_id (+)
and d.tablespace_name like '&in_tsname%'
order by d.tablespace_name, f.file_id;
define part1="rpad('|',29*(f.bytes-nvl(s.free_bytes,0))/f.bytes,'*')"
col gr format a30 heading 'Percent full'
select d.tablespace_name tn,
d.initial_extent init,
d.next_extent next,
d.pct_increase pct,
d.min_extents mi, max_extents ma,
decode(d.status,'ONLINE','OnL','OFFLINE','OffL') st,
rpad(&part1,29,' ')||'|' gr
from sys.dba_tablespaces d, sys.dba_data_files f,
(select file_id, sum(bytes) free_bytes
from sys.dba_free_space
group by file_id) s
where d.tablespace_name = f.tablespace_name
and f.file_id = s.file_id (+)
and d.tablespace_name like '&in_tsname%'
order by d.tablespace_name, f.file_id;
------------------------
上記をSQL*PLUSで流すと、テーブルが使用している実領域が表示されます。
(一度、領域を入力するパラメータが表示されます)
たぶん、これでよいと思いますが・・・