您的位置:首页 > 其它

查看用户占空间大小

2015-01-20 18:08 134 查看
1、用DBA用户登录数据库。

2、以G为大小单位,查询语句:

select *

from (select owner || '.' || tablespace_name name, sum(b) g

from (select owner,

t.segment_name,

t.partition_name,

round(bytes / 1024 / 1024 / 1024, 2) b,

tablespace_name

from dba_segments t)

where owner not in

('SYS', 'OUTLN', 'SYSTEM', 'TSMSYS', 'DBSNMP', 'WMSYS')

group by owner || '.' || tablespace_name)

order by name;

2、查看表的使用空间大小

select num_rows * avg_row_len/1024/1024

from user_tables

where table_name = 'xxxx';
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: