|
Re: size of database [message #50321 is a reply to message #50320] |
Mon, 11 March 2002 10:06 |
saleem
Messages: 65 Registered: January 2002
|
Member |
|
|
select sum(bytes/1024/1024) as "Megs"
from dba_segments;
this will give you the size of the db at that moment. it is different from the amount of size available in the datafiles.
|
|
|
Re: size of database [message #50347 is a reply to message #50320] |
Tue, 12 March 2002 06:39 |
krb
Messages: 25 Registered: March 2002
|
Junior Member |
|
|
This query will return you the details of all datafiles, space occupied and free space.
select
b.file_id "File #",
substr(b.tablespace_name ,1, 10) "Tablespace Name",
ROUND(b.bytes/1024/1024,2) "Total(MB) ",
ROUND((b.bytes-sum(nvl(a.bytes,0)))/1024/1024,2) " Used(MB) ",
ROUND(sum(nvl(a.bytes,0))/1024/1024,2) "Free(MB)",
ROUND((sum(nvl(a.bytes,0))/(b.bytes))*100,2) "% Free"
,ltrim(rtrim(b.file_name)) "File Name"
from sys.dba_free_space a, sys.dba_data_files b
where a.file_id(+)=b.file_id
group by b.tablespace_name,b.file_id, b.bytes,b.file_name
order by b.tablespace_name
Hope this is helpful
KRB
|
|
|