Skip to content

Instantly share code, notes, and snippets.

@yasu47b
Created April 4, 2017 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yasu47b/b8734d4905dedbd068f3cb431bb49c50 to your computer and use it in GitHub Desktop.
Save yasu47b/b8734d4905dedbd068f3cb431bb49c50 to your computer and use it in GitHub Desktop.

DBの実データサイズを調べる

SQLでデータベースのoidを確認し、データベースの実体が配置されているディレクトリの容量を調べる。

SQLによるoidの確認

select datid, datname from pg_stat_database

ディレクトリの容量を確認

cd /var/lib/posgresql/<version>/main/base
du -sh <oid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment