您的位置:寻梦网首页编程乐园Java天地JSP 专辑JSP001 HTML 离线版
Java 天地
JSP001 HTML 离线版
FAQ汇萃 >> Oracle 专栏 >> 查看数据库各类型空间使用情况

由 macro 发布于: 2001-03-03 09:28


set pagesize 50000
set line 80

col "Total Used Meg" format 999,999,990
col "Data part" format 999,999,990
col "Index part" format 999,999,990
col "LOB part" format 999,999,990
col "RBS part" format 999,999,990

tti 'Used space in Meg by segment type'

select sum(bytes)/1024/1024 "Total Used",
sum( decode( substr(segment_type,1,5), 'TABLE', bytes/1024/1024, 0))
"Data part",
sum( decode( substr(segment_type,1,5), 'INDEX', bytes/1024/1024, 0))
"Index part",
sum( decode( substr(segment_type,1,3), 'LOB', bytes/1024/1024, 0))
"LOB part",
sum( decode(segment_type, 'ROLLBACK', bytes/1024/1024, 0))
"RBS part",
sum( decode(segment_type, 'TEMPORARY', bytes/1024/1024, 0))
"TEMP part"
from sys.dba_segments
/
tti off

tti "Total database size"

select sum(bytes)/1024/1024 "Total DB size in Meg"
from sys.v_$datafile
/
tti off


result screen:


Used space in Meg by segment type

Total Used Data part Index part LOB part RBS part TEMP part
---------- ------------ ------------ ------------ ------------ ----------
102.304688 57 26 1 15 .2734375


Total database size

Total DB size in Meg
--------------------
409.382813



资料来源: JSP001.com