pgsql备份数据库和恢复:
过程:
1创建postges数据库
createdb -E UTF8 -h 127.0.0.1-U admin postgres
pg_dump -h 127.0.0.1 -U admin -Fc -v postgres > /usr/local/pgsql/db_backup/2012-10-15/postgres.dmp
4.删除postgres数据库
dropdb -h 127.0.0.1 -U admin postgres
5.创建postgres数据库
createdb -E UTF8 -h 127.0.0.1 -U admin postgres
5.恢复数据库中表及数据
pg_restore -h 127.0.0.1 -U admin -d postgres -v /usr/local/pgsql/db_backup/2012-10-15/postgres.dmp
过程:
1创建postges数据库
createdb -E UTF8 -h 127.0.0.1-U admin postgres
2.向数据库中创建测试表及测试数据
……
3.备份数据库中表及数据pg_dump -h 127.0.0.1 -U admin -Fc -v postgres > /usr/local/pgsql/db_backup/2012-10-15/postgres.dmp
4.删除postgres数据库
dropdb -h 127.0.0.1 -U admin postgres
5.创建postgres数据库
createdb -E UTF8 -h 127.0.0.1 -U admin postgres
5.恢复数据库中表及数据
pg_restore -h 127.0.0.1 -U admin -d postgres -v /usr/local/pgsql/db_backup/2012-10-15/postgres.dmp
本文详细介绍使用PgSQL进行数据库备份和恢复的过程。包括创建数据库、导入测试数据、执行完整备份、删除原始数据库、重新创建并恢复数据等步骤。
6918

被折叠的 条评论
为什么被折叠?



