select sum(bytes),tablespace_name from dba_free_space where
tablespace_name not like 'TEMP%' and tablespace_name
not like 'RBS%' group by tablespace_name;
How to find the size of the database
select sum(BYTES)/1024/1024 from dba_free_space
Freespace/Largest Ext
select TABLESPACE_NAME,sum(BYTES) Total_free_space,
max(BYTES) largest_free_extent from dba_free_space
group by TABLESPACE_NAME
Objects in SYSTEM TS
select OWNER,SEGMENT_NAME,SEGMENT_TYPE,TABLESPACE_NAME,BYTES
from dba_segments
where TABLESPACE_NAME = 'SYSTEM'
and OWNER not in ('SYS','SYSTEM')
order by OWNER, SEGMENT_NAME
SYSTEM TABLESPACE USAGE NOTES:
select USERNAME,CREATED,PROFILE,DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE
from dba_users order by USERNAME
TABLESPACE USAGE NOTES:
select a.TABLESPACE_NAME,a.BYTES bytes_used,b.BYTES bytes_free, b.largest,
round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
from
( select TABLESPACE_NAME,sum(BYTES) BYTES
from dba_data_files
group by TABLESPACE_NAME
)
a,
( select TABLESPACE_NAME,sum(BYTES) BYTES ,max(BYTES) largest
from dba_free_space
group by TABLESPACE_NAME
)
b
where a.TABLESPACE_NAME=b.TABLESPACE_NAME
order by ((a.BYTES-b.BYTES)/a.BYTES) desc
TABLESPACE INFORMATION NOTES
select TABLESPACE_NAME,INITIAL_EXTENT,NEXT_EXTENT,MIN_EXTENTS,
MAX_EXTENTS,PCT_INCREASE,STATUS,CONTENTS
from dba_tablespaces
order by TABLESPACE_NAME
WAIT STATISTIC NOTES
select TABLESPACE_NAME,TOTAL_EXTENTS, EXTENTS_COALESCED, PERCENT_EXTENTS_COALESCED,TOTAL_BYTES, BYTES_COALESCED,
TOTAL_BLOCKS,BLOCKS_COALESCED, PERCENT_BLOCKS_COALESCED
from dba_free_space_coalesced
order by TABLESPACE_NAME
Table space with PCT free
select df.tablespace_name "Tablespace",
totalusedspace "Used MB",
(df.totalspace - tu.totalusedspace) "Free MB",
df.totalspace "Total MB",
round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace))
"Pct. Free"
from
(select tablespace_name,
round(sum(bytes) / 1048576) TotalSpace
from dba_data_files
group by tablespace_name) df,
(select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name
from dba_segments
group by tablespace_name) tu
where df.tablespace_name = tu.tablespace_name ;
No comments:
Post a Comment