tblspc_files.sql

This script help you to find the information about tablespace usage in oracle database.
Call the script @tblspc_files.sql

set linesize 200
column tablespace_name format a45
column file_name format a60
column Allocated_mb format 9999999
column free_mb format 9999999
column Percent_Free format 9999999

SELECT
   df.tablespace_name,
   df.file_name,
   round(df.bytes/1024/1024,2) Allocated_mb,
   round(free.free_mb,2) free_mb,
   Round(free.free_mb/(df.bytes/1024/1024)*100) Percent_Free
FROM
   dba_data_files df,
   (SELECT file_id, SUM(bytes)/1024/1024 free_mb
    FROM dba_free_space GROUP BY file_id) free
WHERE
   df.file_id=free.file_id(+)
   and ('&1' is NULL or df.tablespace_name='&&1')
ORDER BY
   Percent_Free;

Click here for Tablespace usage in oracle database

Please share this Blog with your colleagues or friends. Your suggestions and feedback are very helpful for everyone who come to this site and learn it from oracleocpworld.com.
Please comment here for your any query related to above post. You can email me on : oracleocpworld@gmail.com.

Leave a Comment