select pg_size_pretty(pg_database_size('lrisk')); --查询数据库剩余空间 select pg_database.datname,pg_size_pretty(pg_database_size('lrisk')) AS sizefrom pg_database; select * from pg_database; SELECT relname, relpages FROM pg_class ORDER BY relpages DESC; --查询
dba_data_files:数据库数据文件信息表.可以统计表空间大小(总空间大小). dba_free_space:可以统计剩余表空间大小. 增加表空间即向表空间增加数据文件,表空间大小就是数据文件总大小. 检查Oracle各个表空间的增长情况(各表空间使用率) select A.tablespace_name,(1-(A.total)/B.total)*100 used_percent from (select tablespace_name,sum(bytes) total from db
本文介绍MySQL查看数据库表容量大小的命令语句,提供完整查询语句及实例,方便大家学习使用. 1.查看所有数据库容量大小 select table_schema as '数据库', sum(table_rows) as '记录数', , )) as '数据容量(MB)', , )) as '索引容量(MB)' from information_schema.tables group by table_schema order by sum(data_length) desc, sum(index