20181112-PostgreSQL數據庫dmp文件導入
標注:dmp文件導入,場景:多個schema導入
1. 環境准備:
postgres集群master節點上,postgres用戶執行以下操作
cd ~
scp -rp file1:實際路徑 ./
chown postgres:postgres filename
2. 登錄數據庫
1.用 postgres 用戶 登錄postgres集群master數據庫 :
命令:psql
3. 新建數據庫用戶:
create user smlprft password 'smlprft';
create user countercust password 'countercust';
create user cuanadb password 'cuanadb';
4.在pg master 數據庫 依次導入數據:
# 向xpgdb導入
psql -f smlprft-20181110.dmp -d xpgdb
# 執行完成后,再執行下面的命令
psql -f countercust-20181110.dmp -d xpgdb
# 執行完成后,再執行下面的命令
psql -f cuanadb-20181110.dmp -d xpgdb