postgresqlのバックアップ
root su - postgres
バックアップ
pg_dump -Fc xxxdb > /var/lib/pgsql/backup/xxxdb.dmp
DB全体(ユーザーなど管理情報ふくめ)
pg_dumpall > /var/lib/pgsql/backup/dumpall.dmp
リストア (-c で全クリア後復元)
pg_restore -c -d xxxdb /var/lib/pgsql/backup/xxxdb.dmp
テーブルの復元
pg_restore -Fc -a -t xxxtable -d xxxdb /var/lib/pgsql/backup/xxxdb.dmp
dumpallの復元
psql -d template1 < /var/lib/pgsql/backup/dumpall.dmp
postgresqlのバックアップ.txt · 最終更新: 2019/06/30 12:22 by 127.0.0.1