關於postgresql - greenplum的數據備份-恢復
正文
記錄一下
備份
pg_dump -f m_device1.sql -t m_device -h 10.2.1.186 -p 5432 -U postgres slws2
或者以insert語句形式的插入數據的備份:
pg_dump -f m_device2.sql -t m_device –column-inserts -h 10.2.1.186 -p 5432 -U postgres slws2
-f 文件名
-t 加了備份某個表,多個表用空格隔開,不加默認備份全庫
-h -p -u都是數據庫的鏈接配置
最後是庫名
恢復:
psql -h 10.2.1.186 -p 5433 -U gpadmin -f m_device1.sql slws