Script to List all Datafiles and Tablespaces

  • The script will list all the data-files and the table-spaces that they belong to as well as their size calculated in Mb.
  • select
    substr(file_name,1,40) as File_Name,
    substr(tablespace_name,1,10) as Tablespace_Name,
    bytes/1024/1024 as Size_Mb
    from dba_data_files
    order by tablespace_name, file_name;