postgresql数据库备份与还原
postgresql数据库备份与还原
备份数据库:
$ su - postgres
$ pg_dump testdb > testdb.sql
备份单个表:
$ pg_dump --table=aa testdb > testdb_aa.sql
仅备份单个表的数据(不要结构)
$ pg_dump --table=aa --data-only testdb > testdb_aa.sql
恢复数据库:
$ su - postgres
$ createdb testdb
$ psql testdb < testdb.sql (恢复单个表也是这个命令)
转载于:https://blog.51cto.com/yangzhiming/1621432
postgresql数据库备份与还原相关推荐
- PostgreSQL 数据库备份
PostgreSQL 数据库备份 pg_dump 一.备份还原 注意:命令在pg_dump目录下进行 1.备份test数据库 pg_dump -h 127.0.0.1 -p 5432 -U usern ...
- Asp.net 不使用SQLDMO实现数据库备份和还原
今天需要做一个历史数据库,备份还原的程序,就是在sql服务器兴建一个数据库的历史版本的复.手工操作很方便,但是程序来实现我还没做过.上网找资料发现都调用了 SQLDMO 的 SQL COM 来实现. ...
- MySQL数据库备份和还原的常用命令小结
MySQL数据库备份和还原的常用命令小结,学习mysql的朋友可以参考下. 备份MySQL数据库的命令 mysqldump -hhostname -uusername -ppassword datab ...
- MySQL数据库备份和还原的常用命令
MySQL数据库备份和还原的常用命令 2012-03-27 14:43:34 标签:linux mysql 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追 ...
- sql还原数据库备份数据库_有关数据库备份,还原和恢复SQL面试问题–第一部分
sql还原数据库备份数据库 So far, we've discussed a lot about database backup-and-restore process. The backup da ...
- sql还原数据库备份数据库_有关数据库备份,还原和恢复SQL面试问题–第二部分
sql还原数据库备份数据库 In this article, we'll walk through, some of the refined list of SQL Server backup-and ...
- sql还原数据库备份数据库_有关数据库备份,还原和恢复SQL面试问题–第IV部分
sql还原数据库备份数据库 In this article, we'll see the how the backup-and-restore meta-data tables store the i ...
- sql还原数据库备份数据库_有关数据库备份,还原和恢复SQL面试问题–第三部分
sql还原数据库备份数据库 So far, we've discussed a lot about database backup commands. In this article, we'll d ...
- SQL Server数据库备份和还原报告
In the previous articles, we discussed several ways of taking backup and testing the restore process ...
最新文章
- 宁德时代机器人编程开发_全球首例丨可编程的活体机器人已诞生,100%青蛙基因,超级计算机时代,将无所不能?!...
- 从GPT-3到DETR,一起来盘点2020有哪些突破?
- JavaScript引用类型之Array数组之强大的splice()方法
- zabbix2.4.5自带mysql监控
- html quot代替src,html特效代码大全
- c# WinForm开发 DataGridView控件的各种操作总结(单元格操作,属性设置)
- mysql改密码脚本_mysql密码修改脚本
- Educational Codeforces Round 114总结
- C++虚继承的实现原理、内存分布、作用
- 微课|Python程序设计开发宝典(5.1.2节):函数嵌套定义1
- 浅谈极限编程(更新中)
- Win10如何关闭win11自动更新?
- 使用容联云通信实现发送验证码
- 关于线性回归和逻辑回归一些深入的思考
- Java Telephony
- celeste第二章_蔚蓝_第二章_初露锋芒_免费小说阅读_飞卢小说网
- 你明明是我师父,却偏要做我女朋友
- 入门级资料——电池的工作过程
- 微信小程序打开微信公众号中的文章实战教程
- 脉冲能量|Committer 专访——李理:Apache Pulsar 项目“体验师”
热门文章
- 系列10—消息中间件
- 拍拍贷信贷申请审核竞赛模拟
- android常用工具收集
- Web服务器超时处理
- bzoj 3131 [Sdoi2013]淘金(数位dp)
- ubuntu问题解答集锦
- 基于visual Studio2013解决面试题之0802数字最多元素
- Michael Nygard on Building Resilient Systems
- 每周分享第8期(2019.5.25)
- npm ERR! { Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_cache\_locks'