首页 > 数据库技术 > 详细

Oracle DB , 计算各个用户/schema 的磁盘占用空间

时间:2017-05-11 16:00:46      阅读:320      评论:0      收藏:0      [点我收藏+]

http://www.dba-oracle.com/t_find_size_schema.htm

Question:  How do I find the size of a schema in my database?

Answer: It depends on how you define "size".  If you want the total disk space consumed by the schema (including indexes, tablespace free space), then the SQL query is quite simple:

select 
   owner,
   sum(bytes)/1024/1024/1024 schema_size_gig
from 
   dba_segments 
group by 
   owner;

 

If you just want the size of the schema in terms of the space consumed by table rows, you would use a different query to calculate the schema size:

select 
   sum(bytes)/1024/1024/1024 as size_in_gig, 
   segment_type
from 
   dba_segments
where 
   owner=SCOTT 
group by 
   segment_type;

 

Oracle DB , 计算各个用户/schema 的磁盘占用空间

原文:http://www.cnblogs.com/johnsonshu/p/6841318.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!