查看整库大小
-
oracle一般是
-
select sum(bytes/1024/1024/1024) g from dba_segments;
-
-
达梦的方法是
-
整库:
-
select db_used_space; --单位是页
-
-
select round(db_used_space * para_value /1024/1024/1024) db_size_gb from v$dm_ini where para_name ='global_page_size';
-
-
用户:select user_used_space('loan') * para_value /1024/1024 used_mb from v$dm_ini where para_name ='global_page_size';
-
-
单表:select table_used_space('scott','emp') * para_value /1024/1024 used_mb from v$dm_ini where para_name ='global_page_size';
-
简单的方法也可查看v$database
当然,这里的total_size是页数,应该与下面这个一致
这个问题比较简单,但是做过数据清理后,例如删除表和清理快照等却查到的结果不一致。
db_used_space像是高水位线。
建议查看大小方法:
-
--整库大小
-
select round(sum((bytes0.1-0.1)/1024/1024/1024),1) db_size_gb from dba_segments;
-
-
--查看各用户大小
-
select username, user_used_space(username) * (select para_value from v$dm_ini where para_name ='global_page_size') /1024/1024 used_mb from dba_users;
-
阅读(106) | 评论(0) | 转发(0) |