pg_restore restores a PostgreSQL database from an archive created by pg_dump.

Usage:
  pg_restore [OPTION]... [FILE]

General options:
  -d, --dbname=NAME        connect to database name
  -f, --file=FILENAME      output file name
  -F, --format=c|d|t       backup file format (should be automatic)
  -l, --list               print summarized TOC of the archive
  -v, --verbose            verbose mode
  --help                   show this help, then exit
  --version                output version information, then exit

Options controlling the restore:
  -a, --data-only          restore only the data, no schema
  -c, --clean              clean (drop) database objects before recreating
  -C, --create             create the target database
  -e, --exit-on-error      exit on error, default is to continue
  -I, --index=NAME         restore named index
  -j, --jobs=NUM           use this many parallel jobs to restore
  -L, --use-list=FILENAME  use table of contents from this file for
                           selecting/ordering output
  -n, --schema=NAME        restore only objects in this schema
  -O, --no-owner           skip restoration of object ownership
  -P, --function=NAME(args)
                           restore named function
  -s, --schema-only        restore only the schema, no data
  -S, --superuser=NAME     superuser user name to use for disabling triggers
  -t, --table=NAME         restore named table
  -T, --trigger=NAME       restore named trigger
  -x, --no-privileges      skip restoration of access privileges (grant/revoke)
  -1, --single-transaction
                           restore as a single transaction
  --disable-triggers       disable triggers during data-only restore
  --no-data-for-failed-tables
                           do not restore data of tables that could not be
                           created
  --no-security-labels     do not restore security labels
  --no-tablespaces         do not restore tablespace assignments
  --use-set-session-authorization
                           use SET SESSION AUTHORIZATION commands instead of
                           ALTER OWNER commands to set ownership

Connection options:
  -h, --host=HOSTNAME      database server host or socket directory
  -p, --port=PORT          database server port number
  -U, --username=NAME      connect as specified database user
  -w, --no-password        never prompt for password
  -W, --password           force password prompt (should happen automatically)
  --role=ROLENAME          do SET ROLE before restore

If no input file name is supplied, then standard input is used.

Report bugs to <pgsql-bugs@postgresql.org>.

额外参考:https://xly3000.wordpress.com/2012/03/07/postgresql%E8%87%AA%E5%8A%A8%E5%A4%87%E4%BB%BDbackup%E4%B8%8E%E6%81%A2%E5%A4%8Drestore%E6%95%B0%E6%8D%AE%E5%BA%93%E5%9B%BE%E8%A7%A3/

 
 

pg_restore数据库恢复指令的更多相关文章

  1. oracle 数据恢复,只有oradata文件夹里的文件,没有备份文件的数据库恢复,重装系统后,oracle 10g数据库恢复

    格式化重装系统后,才想起来oracle 10g 数据库没有做备份,开始以为很麻烦,没想到数据库恢复的还挺顺利的 恢复方法: 1,把原来的数据库文件备份,(D:\oracle\product\10.2. ...

  2. Orcle数据库恢复

    不知道什么原因,服务器上的数据库报错:ORA-01033:ORACLE initialization or shutdown in progress 首先检查:监听文件的主机名及端口号是否更改 数据文 ...

  3. OCA读书笔记(16) - 执行数据库恢复

    16. Performing Database Recovery 确定执行恢复的必要性访问不同接口(EM以及命令行)描述和使用可用选项,如RMAN和Data Recovery Advisor执行恢复- ...

  4. oracle数据库恢复与备份

    一.oracle数据库恢复 1.恢复刚才删除的一条数据 delete from emp e where e.empname='SMITH' select * from flashback_transa ...

  5. 用友金蝶SQL数据库误格式化恢复 SQL数据库修复 SQL数据库恢复 工具 方法

    用友金蝶SQL数据库误格式化恢复 SQL数据库修复 SQL数据库恢复 硬盘误格式化.重分区.重装操作系统覆盖 SQL数据解决方法 [客户名称]:贵州铜仁市开天驾驶人培训中心 [软件名称]:用友T3普及 ...

  6. 医院his系统数据库恢复

    医院IT系统的重要性堪比金融行业,“银行系统宕机,老百姓不能取钱:医院HIS系统宕机,老百姓不能看病”, 医院信息系统称得上是迄今为止企业级信息系统中最复杂的一类.  某医院HIS系统SQL2008数 ...

  7. SQL数据库文件修复/用友/金蝶/管家婆/速达/思讯数据库恢复 硬盘恢复

    硬盘的故障情况可以分为以下几类: 1.控制电路故障 大部分外电路的问题是电源芯片或主轴驱动芯片烧坏引起的,由于硬盘电路板质量问题.设计缺陷.市电波动.突然断电.芯片老化或者散热不良.静电等原因造成芯片 ...

  8. 解剖SQLSERVER 第一篇 数据库恢复软件商的黑幕(有删减版)

    解剖SQLSERVER 第一篇  数据库恢复软件商的黑幕(有删减版) 这一系列,我们一起来解剖SQLSERVER 在系列的第一篇文章里本人可能会得罪某些人,但是作为一位SQLSERVER MVP,在我 ...

  9. 数据库恢复(database restore)之兵不血刃——半小时恢复客户数据库

    昨天,一个客户打打来电话,说他们的数据库坏了,不能用了,需要我帮助恢复下,这马上要放假了,居然出了这事儿,自己也不太喜欢恢复数据库这类,尤其是他们的数据库是个win上的库,但心里很清楚,客户比咱着急, ...

随机推荐

  1. Andriod的国际化-android学习之旅(五十八)

    android资源国际化

  2. Unity UGUI之Canvas&EventSystem

    最近想写一套关于UGUI所有控件的基础使用教程系列,主要是根据本人的使用心得来写的,所以其中可能难以避免会有不正确的地方. 好了进入主题,既然是第一篇,我觉得我有必要先介绍一下UGUI必不可缺的两个组 ...

  3. Gradle 1.12 翻译——第十二章 使用Gradle 图形用户界面

    有关其他已翻译的章节请关注Github上的项目:https://github.com/msdx/gradledoc/tree/1.12,或访问:http://gradledoc.qiniudn.com ...

  4. 安卓手机与ROS通信遥控Gazebo中仿真机器人小车运动(ROS_indigo)

    首先,先列出需要用到的一些文件: Gazebo中机器人模型及说明: http://wiki.ros.org/grizzly_simulator https://github.com/g/grizzly ...

  5. cocos2d-x初探

    今天把cocos2d-x下载下来装了准备试试. 就不用windows本了,主要想做iOS游戏,所以这里用mac. 先在http://cocos2d-x.org/download下载右边的cocos,然 ...

  6. python的文件操作file:(内置函数,如seek、truncate函数)

    file打开文件有两种方式,函数用file()或者open().打开后读入文件的内容用read()函数,其读入是从文件当前指针位置开始,所以需要控制指针位置用: 一.先介绍下file读入的控制函数: ...

  7. 敦泰FT6X06单层自容调屏

    总的概括来说,自电容调屏在配置好通道个数和顺序后,只需调整AFE相关的设置参数使各通道的Raw Data和CI值符合定义的标准即可.– AFE是模拟前端的缩写-Analog Front End• Ra ...

  8. 用 boost::multi_index 管理玩家

    用 boost::multi_index 管理玩家(金庆的专栏)网游服务器上的玩家集合需要多种索引:如用ID查找,角色名查找, 用登录时分配的会话ID查找.用boost::multi_index进行玩 ...

  9. python的w+到底是什么

    python 文件处理的打开方式有很多种, os.mknod("test.txt") 创建空文件 fp = open("test.txt",w) 直接打开一个文 ...

  10. Linux 学习笔记_12_Windows与Linux文件共享服务_1.1_--Samba(上)

    Samba简介:在UNIX系统中,Samba是通过服务器消息块协议(SMB)在网络上的计算机之间,共享文件和打印服务的软件包. SMB简介:Server Message Block,SMB协议是一种服 ...