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/18
Message-ID: <32b76462.8451452@dcsun4>#1/1

create view free_space as
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 /

Build a default block on that and you'll have free space (works in 7.1 and up. In 7.0 you'll need to create views for the 'inline' views A and B and then create the view free_space).....

Same sort of thing will apply with v$sga and other tables. build your views on the v$sga tables and v$sgastat tables to get aggregate and detail memory usage reports.

On 17 Dec 1996 19:58:21 GMT, "Eric van Wessel" <evanwessel_at_maintain.nl> wrote:

>But is there a way to display disk usage (or free space) in a form ??
>Same question for memory.
>
>Eric.
>
>
>Ed Bruce <Ed.Bruce_at_ha.hac.com> wrote in article
><32B1D930.167E_at_ha.hac.com>...
>> Earvin C. Lim wrote:
>> > 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?
>>
>> I just use the server manager. Under the Storage drawer I click on the
>> Tablespaces tab and it lists Size(K), Used(K), Remain(K), % Used and for
>> 7.3 (maybe 7.2) % Extents Coalesced, % Blocks Coalesced.
>>
>>

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 Wed Dec 18 1996 - 00:00:00 CST

Original text of this message

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