| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie - How can I check diskspace usage?
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
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
![]() |
![]() |