Below sql query is used to find total tablespace size of your database. which includes Tablespace name used size in MB, free size in MB and Total size in MB
Sql command which fetch tablesapce size in GB Click here to get sample output
select d.tablespace_name "Tablespace",
totalusedspace "Used MB",
(d.totalspace - s.totalusedspace) "Free MB",
d.totalspace "Total MB",
round(100 * ( (d.totalspace - s.totalusedspace)/ d.totalspace)) "Pct. Free"
from
(select tablespace_name,
round(sum(bytes) / 1048576) TotalSpace
from dba_data_files
group by tablespace_name) d,
(select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name
from dba_segments
group by tablespace_name) s
where d.tablespace_name = s.tablespace_name ;
We always encourage the technical person to visit section SCRIPTS to get more daily usage SQL commands.
Hope so you like this script!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the most recent update. Click here to know more about our pursuit.