Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find database size in Oracle SQL developer

In phpmyadmin, it's able to see database disk usage. I was wondering if there's such thing in Oracle SQL developer. Thanks!

like image 588
Stan Avatar asked Feb 18 '10 08:02

Stan


People also ask

How do I find the size of a database in SQL Developer?

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.

How do you calculate database size?

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.

How do I find the size of a mysql database?

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.

What is the size of Oracle?

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.


1 Answers

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

like image 148
Jeffrey Kemp Avatar answered Sep 21 '22 02:09

Jeffrey Kemp