-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- AUTHOR         : Sameer S Choudhari
-- DESCRIPTION    : Get the tablespace and related datafiles information sorted by tablespace
-- USAGE          : @datafile_info.sql
-- LAST MODIFIED  : 20/03/2015
-- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SET lines 220 pages 49999
COLUMN tablespace_name format a30
COLUMN file_name format a65
SELECT tablespace_name,
  file_name,
  bytes/1024/1024/1024 file_size_gb,
  status,
  autoextensible,
  maxbytes/1024/1024/1024 maxbytes_gb
FROM dba_data_files
ORDER BY tablespace_name,
  file_name;