postgres=# select pg_size_pretty(pg_database_size('zabbixdb'));
pg_size_pretty
----------------
148 GB
(1 row)
查看所有数据库大小
postgres=# select pg_database.datname, pg_database_size(pg_database.datname) AS size from pg_database;
datname | size
-----------+--------------
postgres | 8135535
扫描二维码关注公众号,回复:
12432570 查看本文章
zabbixdb | 158902297455
template1 | 7987715
template0 | 7987715
(4 rows)
清理命令:
killall zabbix_server
psql -U zabbix -d zabbixdb
truncate table history;
truncate table history_uint ;
./zabbix_server