Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie - How can I check diskspace usage?
On 6 Dec 1996 18:43:57 GMT, earvin_at_omega.uta.edu (Earvin C. Lim) wrote:
>Hi all,
>
>We have created a database in a UNIX file system, and about 400MB is
>allocated to it. But how can I check how many actual diskspace is in
>use?
>
>Thanks!
>
>--
>Earvin Lim
>-- Programmer/Analyst
>-- Academic Computing Services
>-- University of Texas at Arlington
>email: earvin_at_omega.uta.edu
>Phone: (817)272-3678
I use the following sql*plus script (shows allocated, used, free, and largest contigous free by tablespace, works in 7.1 and up)
column dummy noprint
column pct_used format 999.9 heading "%|Used" column name format a16 heading "Tablespace Name"column Kbytes format 999,999,999 heading "KBytes" column used format 999,999,999 heading "Used" column free format 999,999,999 heading "Free" column largest format 999,999,999 heading "Largest" break on report
select nvl(b.tablespace_name,nvl(a.tablespace_name,'UNKOWN')) name,
kbytes_alloc kbytes, kbytes_alloc-nvl(kbytes_free,0) used, nvl(kbytes_free,0) free, ((kbytes_alloc-nvl(kbytes_free,0))/kbytes_alloc)*100 pct_used, nvl(largest,0) largest from ( select sum(bytes)/1024 Kbytes_free, max(bytes)/1024 largest, tablespace_name from sys.dba_free_space group by tablespace_name ) a, ( select sum(bytes)/1024 Kbytes_alloc, tablespace_name from sys.dba_data_files group by tablespace_name ) b
Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com
![]() |
![]() |