GaussDB查看数据库、表空间、表、schema大小以及常用的数据库元命令

发布于:2024-01-10 ⋅ 阅读:(843) ⋅ 点赞:(0)
试读部分
查看表空间的大小 openGauss=# select pg_size_pretty(pg_tablespace_size('pg_default')); pg_size_pretty ---------------- 102 MB (1 row) openGauss=# select pg_size_pretty(pg_tablespace_size('hr_data')); pg_size_pretty ---------------- 1286 MB (1 row) 查看所有数据库的大小 select pg_size_pretty(sum(pg_database_size(oid))) from pg_database; 查看每个数据库的大小 openGauss=# select datname,pg_size_pretty(pg_database_size(oid)) from pg_database; datname | pg_size_pretty -----------+---------------- template1 | 14 MB test_gbk | 14 MB template0 | 14 MB test1 | 14 MB postgres | 31 MB mm | 14 MB db_hr | 1286 MB (7 rows) 元命令\l+可以快速查看 openGauss=# \l+ List of databases Name | Owner | Encoding | Collate ……
本文为 VIP 文章,已展示部分内容,开通 VIP 后查看全文

觉得这篇文章有帮助?

点个赞,或赞赏支持作者持续创作

微信公众号

今日签到

点亮在社区的每一天
去签到