备份还原方法:pg_dump和pg_restore,先仔细说明这两个命令,再记录我的操作方法。
远程复制scp:
#which scp
/usr/bin/scp
#rpm -qf /usr/bin/scp
/openssh-client.xxxx
# ssh -p 端口 [email protected]
# scp -v -P 端口 /home/zhoz/db_zhoz_081121.tar [email protected]:/home/zhoz/
数据备份pg_dump与还原pg_restore:
备份:pg_dump -h localhost -p 5432 -U tradesns -W -F c -b -v -f "/home/tradeworkwangbin/us2010.backup" us2010
恢复:pg_restore -h 192.168.0.100 -p 5432 -U postgres -W -d us2011 -v "/root/us2010.backup"
参照资料:
http://www.cnblogs.com/chjbbs/p/6480642.html?utm_source=itdadao&utm_medium=referral
http://www.cnblogs.com/starof/p/4709805.html
时间: 2024-10-27 19:18:11