pgsql数据库备份与还原

pg_dump -F t -h 59.202.43.176 -p 3433 -U ufgov -d cwy_ufgov2 -j 2 -f D:\cwy_ufgov2backup ----导出语句
 
pg_restore -h 59.202.45.3 -p 3433 -U ufgov -d cwysjce_nxl -j 2 D:\cwy_ufgov2backup-------导入语句
 
一般选项:
  -f, --file=FILENAME         output file or directory name
  -F, --format=c|d|t|p        output file format (custom, directory, tar, plain text)
  -v, --verbose            详细模式
  -Z, --compress=0-9       被压缩格式的压缩级别
--lock-wait-timeout=TIMEOUT 在等待表锁超时后操作失败
  --help                       显示此帮助信息, 然后退出
  --versoin                    输出版本信息, 然后退出
控制输出内容选项:
  -a, --data-only          只转储数据,不包括模式
  -b, --blobs              在转储中包括大对象
  -c, --clean              在重新创建之前,先清除(删除)数据库对象
  -C, --create             在转储中包括命令,以便创建数据库
  -E, --encoding=ENCODING     转储以ENCODING形式编码的数据
  -n, --schema=SCHEMA      只转储指定名称的模式
 -N, --exclude-schema=SCHEMA     不转储已命名的模式
  -o, --oids               在转储中包括 OID
  -O, --no-owner           在明文格式中, 忽略恢复对象所属者
  -s, --schema-only        只转储模式, 不包括数据
  -S, --superuser=NAME     在转储中, 指定的超级用户名
  -t, --table=TABLE        只转储指定名称的表
  -T, --exclude-table=TABLE       只转储指定名称的表
  -x, --no-privileges      不要转储权限 (grant/revoke)
  --binary-upgrade         只能由升级工具使用
  --column-inserts          以带有列名的INSERT命令形式转储数据
  --disable-dollar-quoting     取消美元 (符号) 引号, 使用 SQL 标准引号
  --disable-triggers         在只恢复数据的过程中禁用触发器
  --inserts                 以INSERT命令,而不是COPY命令的形式转储数据
  --no-security-labels        do not dump security label assignments
  --no-tablespaces           不转储表空间分配信息
  --no-unlogged-table-data    do not dump unlogged table data
  --quote-all-identifiers     quote all identifiers, even if not key words
  --serializable-deferrable   wait until the dump can run without anomalies
 --use-set-session-authorization
posted @   四毛二  阅读(698)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
点击右上角即可分享
微信分享提示