oracle查询每个表所占的空间

查看当前用户的每个表所占的空间大小:

select segment_name,sum(bytes)/1024/1024 size_M from user_extents group by segment_name order by size_M desc;

查询用户下面的所有表:

 select * from user_tables ;

但当我想查看表空间大小的时候,比如运行下面的语句,

Select Tablespace_Name,Sum(bytes)/1024/1024 From Dba_Segments Group By Tablespace_Name;

会报“[Err] ORA-00942: 表或视图不存在”的错误,初步判断应该是权限问题,这个问题先预留。

原文地址:https://www.cnblogs.com/klbc/p/5035546.html