Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie - How can I check diskspace usage?

Re: Newbie - How can I check diskspace usage?

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/12/06
Message-ID: <32a87e5c.11038342@dcsun4>#1/1

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
compute sum of kbytes on report
compute sum of free on report
compute sum of used 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

where a.tablespace_name (+) = b.tablespace_name /

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com


statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Fri Dec 06 1996 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US