Tablespace files
SQL> @tf
Enter name of tablespace: SYSAUX
TABLESPACE_NAME DATA_FILE BYTES BYTES_MB CREATED
------------------------------ -------------------------------------------------- ---------------- ------------ -------------------
SYSAUX +DGDATA/DEV01/datafile/sysaux.267.780753563 4,540,334,080 4,330 17/09/2011 09:46:16
1 row selected.
prompt
col data_file for a50
col tablespace_name for a30
col bytes_MB for '999,999,999'
col bytes for '999,999,999,999'
break on tablespace_name skip 1
undefine tspace
spool tf.rpt
accept tspace prompt 'Enter name of tablespace: '
select c.name tablespace_name,
b.name data_file,
a.bytes bytes,
a.bytes/(1024*1024) bytes_MB,
a.creation_time created
from v$datafile a,
v$dbfile b,
sys.ts$ c
where a.file#=b.file#
and c.name like '%' || upper('&tspace') || '%'
and c.ts# = a.ts#
order by c.name, a.creation_time;
clear breaks
spool off