PostgreSQLメモ
Posted on 6th 2月 2009 by y
0
PostgreSQLのデータベース毎の容量調査方法を忘れていたのでメモ。統計情報が更新されていないと意味ないが。
psql -Upostgres -l -t -q | while read line
do
DBNAME=`awk <<< $line '{print $1}'`
if test -n "$DBNAME"&& test "$DBNAME" != "template0"
then
echo -n $DBNAME ":"
psql -Upostgres -d $DBNAME -t -q -c "SELECT sum(relpages) * 8 * 1024 from pg_class"
fi
done
Popularity: 3% [?]
