views:

460

answers:

3

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

+2  A: 
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

Jeffrey Kemp
+1  A: 

I'd recommend the Insider extension for SQL Developer (Raptor).

Gary
I like this, but when ever trying to 'open insider view' the sqldeveloper hangs. how to resolve this? Thanks.
Stan
I had problems with some EA editions, but not with the latest SQL Developer version. I also have full privileges on a 10.2.0.4 database.
Gary
Maybe it was due to not have full privilege to database. But is there any error to be trace? Thanks.
Stan
+1  A: 
dba.in.ua