In phpmyadmin, it's able to see database disk usage. I was wondering if there's such thing in Oracle SQL developer. Thanks!
The size of the database is the space the files physically consume on disk. You can find this with: select sum(bytes)/1024/1024 size_in_mb from dba_data_files; But not all this space is necessarily allocated.
To estimate the size of a database, estimate the size of each table individually and then add the values obtained. The size of a table depends on whether the table has indexes and, if they do, what type of indexes.
To check the sizes of all of your databases, at the mysql> prompt type the following command: Copy SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.
We can see that 1.4 GB is the allocated space across all the data files in the database. Out of the 1.4 GB allocated segments, 1.3 GB is used and 0.09 GB is free space.
select nvl(b.tablespace_name,
nvl(a.tablespace_name,'UNKNOWN'))
tablespace_name,
kbytes_alloc kbytes,
kbytes_alloc-nvl(kbytes_free,0)
size_alloc_bytes,
round(((kbytes_alloc-nvl(kbytes_free,0))/
kbytes_alloc)*200) used_chart,
to_char(((kbytes_alloc-nvl(kbytes_free,0))/
kbytes_alloc)*100,
'999G999G999G999G999G999G990D00') ||'%' used,
data_files
from ( select sum(bytes)/1024/1024 Kbytes_free,
max(bytes)/1024/1024 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name ) a,
( select sum(bytes)/1024/1024 Kbytes_alloc,
tablespace_name, count(*) data_files
from sys.dba_data_files
group by tablespace_name )b
where a.tablespace_name (+) = b.tablespace_name
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With